From 1580ab4cb96667b0c3e4b2015ac8d181c2ccb267 Mon Sep 17 00:00:00 2001 From: Bertrand Kerautret Date: Sun, 25 Dec 2022 11:17:22 +0100 Subject: [PATCH 1/2] export vol when ITK activated (without gridSizeReSample) --- volumetric/volReSample.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/volumetric/volReSample.cpp b/volumetric/volReSample.cpp index b94ec522..1de36f62 100644 --- a/volumetric/volReSample.cpp +++ b/volumetric/volReSample.cpp @@ -135,13 +135,22 @@ int main( int argc, char** argv ) const functors::Identity aFunctor{}; SamplerImageAdapter sampledImage ( input3dImage, reSampler.getSubSampledDomain(), reSampler, aFunctor ); #ifdef WITH_ITK - ITKWriter::exportITK(outputFileName, sampledImage, - Z3i::RealPoint(aGridSizeReSample[0], - aGridSizeReSample[1], - aGridSizeReSample[2])); + const std::string ext = outputFileName.substr( outputFileName.find_last_of(".") + 1 ); + if (std::find(ITK_IO_IMAGE_EXT.begin(), + ITK_IO_IMAGE_EXT.end(), ext) != ITK_IO_IMAGE_EXT.end() ) + { + ITKWriter::exportITK(outputFileName, sampledImage, + Z3i::RealPoint(aGridSizeReSample[0], + aGridSizeReSample[1], + aGridSizeReSample[2])); + } + else + { + GenericWriter::exportFile(outputFileName, sampledImage); + } + #else GenericWriter::exportFile(outputFileName, sampledImage); - #endif return 0; From 8273a5bade8617cc7a060442180f2a5fe07ef667 Mon Sep 17 00:00:00 2001 From: Bertrand Kerautret Date: Sun, 25 Dec 2022 11:22:44 +0100 Subject: [PATCH 2/2] changelog --- ChangeLog.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index de72f4cb..2a55c58f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,8 @@ # DGtalTools 1.4 (beta) - +- *volumetric* + - volReSample: fix the impossibility to export to vol when ITK is activated + (Bertrand Kerautret [#445](https://github.com/DGtal-team/DGtalTools/pull/445)) # DGtalTools 1.3