Alternatives to TriangleMeshToBinaryImageFilter

Hi all,

As title suggests, are there any other ways to convert a mesh to an image? the current filter causes these barcode artefacts to appear and this ruins the image. I’ve tried using VTK and the barcodes don’t appear but the lack of ‘direction’ makes the image ‘inaccurate’ to what is expected in ITK.

Hi @CrownMella ,

One approach is to use the anti-alias binary image filter followed by surface extraction with the cuberille filter.

Hi Matt,

thanks for your reply, I was hoping for the other way around? I have the stl/mesh, i want it to be a binary image. My current pipeline involves using vtk moving to itk then resampling + filter but I’m concerned of all the jumping that might affect the final image. Currently, it looks fine to me but maybe there’s a purely ITK way?

Oh – another idea, then, is SpatialObjectToImageFilter with a MeshSpatialObject. Here is an example:

1 Like