[Insight-users] from image to spatial object

Michal Plotkowiak michal.plotkowiak at bnc.ox.ac.uk
Tue Jul 31 10:47:48 EDT 2007


thanks Luis for your help. I'm still having some difficulties.

trying to compile programs from InsightApplications/Auxiliary/vtk I got the 
following error: fatal error LNK1104:cannot open file vtkRendering.lib

I tried another approach. I took SurfaceExtraction code and added the following 
lines:

typedef itk::MeshSpatialObject<MeshType>     MeshSpatialObjectType;
  MeshSpatialObjectType::Pointer myMeshSpatialObject = 
                                        MeshSpatialObjectType::New();
  myMeshSpatialObject->SetMesh(meshSource->GetOutput());
  myMeshSpatialObject->GetMesh();

  typedef itk::SpatialObjectWriter<3> WriterType;
  WriterType::Pointer writer = WriterType::New();
  writer->SetInput(myMeshSpatialObject);
  writer->SetFileName("mesh.mha");
  writer->Update();

but the program crashes and I dont get any output.

could you give me some suggestions?

meny thanks
michal


In message <46AE5DBF.3000201 at kitware.com> Luis Ibanez <luis.ibanez at kitware.com> 
writes:
> 
> 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
> > 
> > 
> 

-- 
Michal Plotkowiak
Doctoral Researcher
Oxford University LSI DTC



More information about the Insight-users mailing list