Voxel membership tests and contours from meshes

(Dan) #1

I am investigating whether or not we can convert a signification portion of our software to ITK. I’ve written a sample program to do much of what we need but there is still a couple significant question marks. I’ve done some searching but see no clear answers. The two types of computation I need to prototype before beginning the change are:

  1. Perform membership tests for coordinates using a mesh (or some other object created from reading a RTstruct file). The purpose of this would be to create a mask which indicates which voxels are within a volume (or contour if thinking in two dimensions).

  2. Create a contour from the points of a mesh which intersect with an arbitrary 2D plane

I can provide more information if this is not clear. Does ITK have these features already (or partially) implemented? If so, can you point to some examples?

Thank you for your time and for ITK.

(Tim Evain) #2

Hello Dan,

ITK is not really powerful when it comes to meshes: maybe you should use VTK which is way more appropriate there.
That said, ITK have what you’re asking for in its SpatialObject framework, provided you convert your meshes into these SpatialObjects. Examples:

  1. If you have a PolygonSpatialObject, you can test membership through the IsInsideInObjectSpace method.
  2. You can define your 2D plane as an image and use the SpatialObjectToImageFilter to get the mask/contour. I think the SpatialObjectToPointSetFilter could be of some use also, but I’ve never used it.

HTH,

Tim

1 Like