[Insight-users] How to use TriangleMeshToBinaryImageFilter?

Paul Laurent l.paul at uclouvain.be
Mon Dec 13 11:24:23 EST 2010


Dear users,

I have a strange error using TriangleMeshToBinaryImageFilter, and it 
seems that I'm not the only one to get it.
I have created a stlreader and convert it into a ITK::Mesh.
It seems ok since I get 39844 points and 79684 cells.
When I pass it to TriangleMeshToBinaryImageFilter, I get an error with 
indices : "no image indices found" (m_StencilIndex.size() = 0)
Does it mean that the mesh lies outside the created image (If I change 
the exception to a Warning macro, I get a black Image) ?
The mesh comes from a segmentation from the "InfoImage" thus info passed 
to this filter are correct (I have checked, both images share the same 
coordinates)...

     typedef itk::TriangleMeshToBinaryImageFilter < MeshType, 
InputImageType > MeshToImageType;
     MeshToImageType::Pointer MeshToImage = MeshToImageType::New();
     MeshToImage->SetInfoImage(ImageReader->GetOutput()); //Image that 
was used for segmentation
     MeshToImage->SetOutsideValue(1000);
     MeshToImage->SetInsideValue(2000);
     MeshToImage->SetInput(mesh);

Thanks for your help.
Cheers,
Laurent.


More information about the Insight-users mailing list