[Insight-users] from image to spatial object

Luis Ibanez luis.ibanez at kitware.com
Mon Jul 30 17:53:03 EDT 2007


Hi Michal,

 From the list of file formats listed in:
http://tetgen.berlios.de/fformats.html

One possibility seems to be for you to use the STL file format.

ITK doesn't directly write to it, but
you can take your segmented image, save it as a
.vtk or .mhd images, using the itkImageFileWriter.

Then read the image into VTK and use the vtkContourFilter
http://www.vtk.org/doc/nightly/html/classvtkContourFilter.html
and save the resulting surface as an STL file
using the STL Writer
http://www.vtk.org/doc/nightly/html/classvtkSTLWriter.html


You can also do it in a single program mixing ITK and
VTK and converting the ITK image into a vtkImageData.
You will find examples of this conversion in the directory


    InsightApplications/Auxiliary/vtk
             itkReadITKImage3DSegmentShowVTK.cxx
             itkReadITKImageSegmentShowVTK.cxx
             itkReadITKImageShowSplineVTK.cxx
             itkReadITKImageShowVTK.cxx


   Regards,


      Luis


------------------------
Michal Plotkowiak wrote:
> Hi
> 
> could someone tell me how can I convert a segmented image stored in .mha file 
> to a spatial object readable by TetGen (FE mesh generator)?
> 
> many thanks
> michal
> 
> 


More information about the Insight-users mailing list