[Insight-users] TriangleMeshToBinaryImageFilter with direction cosines different from identity

Dženan Zukić dzenanz at gmail.com
Wed May 26 07:51:27 EDT 2010


Hi everyone!

While wrestling with DeformableMesh3DFilter, I wanted to create binary mask
of my initial mesh (so I could use it with examples), but I ran into a
problem. TriangleMeshToBinaryImageFilter is not designed to produce images
with direction cosines matrix different from identity matrix. When I supply
it with such an image and mesh which is valid with respect to ITK's physical
coordinate handling routines (TransformPhysicalPointToContinuousIndex and
friends), it crashes.

typedef itk::TriangleMeshToBinaryImageFilter<MeshType,VisualizingImageType>
MeshFilterType;
MeshFilterType::Pointer meshFilter = MeshFilterType::New();
meshFilter->SetInfoImage(visualizing); //TransformMatrix = 0 1 0 -0.0939968
0 -0.995573 -0.995573 0 0.0939968
meshFilter->SetInput(mesh);
meshFilter->Update(); //crashes

For usage in examples, I can edit my transform matrix in .mha files and set
it to identity, but what about normal usage? Is there some quick (and
possibly dirty) way to get this right, or do I have to do all the math on
paper in order to transform between representations with and without
direction cosines?

Thanks,
Dženan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100526/1f411baf/attachment.htm>


More information about the Insight-users mailing list