diff --git a/ChangeLog.md b/ChangeLog.md index b4e69c15..996e960f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,11 +1,17 @@ # 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)) + - *converters* - mesh2vol: small fix to read generic mesh. (Bertrand Kerautret [#444](https://github.com/DGtal-team/DGtal/pull/444)) + # DGtalTools 1.3 - *build* 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;