From 9a7c6b4573af523a975810f0c09793bfadc4b716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 16 Feb 2024 12:28:41 +0100 Subject: [PATCH] Update examples following Image_3 IO changes --- .../examples/Isosurfacing_3/contouring_image.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Isosurfacing_3/examples/Isosurfacing_3/contouring_image.cpp b/Isosurfacing_3/examples/Isosurfacing_3/contouring_image.cpp index 18d02a792b7..707c6061070 100644 --- a/Isosurfacing_3/examples/Isosurfacing_3/contouring_image.cpp +++ b/Isosurfacing_3/examples/Isosurfacing_3/contouring_image.cpp @@ -95,17 +95,23 @@ int main(int argc, char* argv[]) } // convert image to a Cartesian grid - auto [grid, values] = IS::IO::read_Image_3(image); + Grid grid; + Values values { grid }; + if(!IS::IO::read_Image_3(image, grid, values)) + { + std::cerr << "Error: Cannot convert image to Cartesian grid" << std::endl; + return EXIT_FAILURE; + } + + std::cout << "Bbox: " << grid.bbox() << std::endl; + std::cout << "Cell dimensions: " << grid.spacing()[0] << " " << grid.spacing()[1] << " " << grid.spacing()[2] << std::endl; + std::cout << "Cell #: " << grid.xdim() << ", " << grid.ydim() << ", " << grid.zdim() << std::endl; for (std::size_t i=0; i