Skip to content

Commit

Permalink
Merge branch 'master' of github.com:DGtal-team/DGtalTools into MeshVi…
Browse files Browse the repository at this point in the history
…ewerEdit
  • Loading branch information
kerautret committed Feb 13, 2023
2 parents b80abe2 + 288cdca commit 8b12bd3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
10 changes: 10 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
Kerautret
[#448](https://github.com/DGtal-team/DGtalTools/pull/448))

- *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

Expand Down
2 changes: 1 addition & 1 deletion converters/mesh2vol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void voxelizeAndExport(const std::string& inputFilename,
trace.beginBlock("Preparing the mesh");
trace.info() << "Reading input file: " << inputFilename;
Mesh<PointR3> inputMesh;
MeshReader<PointR3>::importOFFFile(inputFilename.c_str(), inputMesh);
inputMesh << inputFilename.c_str();
trace.info() << " [done]" << std::endl;
const std::pair<PointR3, PointR3> bbox = inputMesh.getBoundingBox();
trace.info()<< "Mesh bounding box: "<<bbox.first <<" "<<bbox.second<<std::endl;
Expand Down
19 changes: 14 additions & 5 deletions volumetric/volReSample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<SamplerImageAdapter>::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<SamplerImageAdapter>::exportITK(outputFileName, sampledImage,
Z3i::RealPoint(aGridSizeReSample[0],
aGridSizeReSample[1],
aGridSizeReSample[2]));
}
else
{
GenericWriter<SamplerImageAdapter>::exportFile(outputFileName, sampledImage);
}

#else
GenericWriter<SamplerImageAdapter>::exportFile(outputFileName, sampledImage);

#endif

return 0;
Expand Down

0 comments on commit 8b12bd3

Please sign in to comment.