[Insight-users] Problem with itkDeformableSimplexMesh3DFilter
Yan Geng
Yan.Geng at rwth-aachen.de
Thu Jun 24 10:31:23 EDT 2010
Hi,
I'm trying to use itkDeformableSimplexMesh3DFilter and have problem by the calculation of external force.
The simplex mesh is generated from labeled images. And I find out that the external force won't be calculated because the vertices in the mesh have wrong coordinates.
I saw the flowing lines in the source code of itkDeformableSimplexMesh3DFilter
coord[0] = static_cast<GradientIndexValueType>(data->pos[0]);
coord[1] = static_cast<GradientIndexValueType>(data->pos[1]);
coord[2] = static_cast<GradientIndexValueType>(data->pos[2]);
if ( (coord[0] >= 0) && (coord[1] >= 0) && (coord[2] >= 0) &&
(coord2[0] < m_ImageWidth) && (coord2[1] < m_ImageHeight) && (coord2[2] < m_ImageDepth) )
I think coord < 0 means this point is out of image and GetPixel(coord)[0] will crash. But it actually looks like this: http://bit.ly/bZCZsF the mesh is still in the image.
I'm not sure what I did wrong to use this filter.
Thanks for your help,
YG
More information about the Insight-users
mailing list