Hi Yan,<div><br></div><div>Deformable simplex mesh filter uses image-coordinates, not physical coordinates. You will have to transform your coordinates using image->TransformPhysicalPointToContinuousIndex before passing your mesh into this filter.</div>
<div><br></div><div>Regards,</div><div>Dženan<br><br><div class="gmail_quote">On Thu, Jun 24, 2010 at 16:31, Yan Geng <span dir="ltr"><<a href="mailto:Yan.Geng@rwth-aachen.de">Yan.Geng@rwth-aachen.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
I'm trying to use itkDeformableSimplexMesh3DFilter and have problem by the calculation of external force.<br>
<br>
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.<br>
<br>
I saw the flowing lines in the source code of itkDeformableSimplexMesh3DFilter<br>
<br>
<br>
coord[0] = static_cast<GradientIndexValueType>(data->pos[0]);<br>
coord[1] = static_cast<GradientIndexValueType>(data->pos[1]);<br>
coord[2] = static_cast<GradientIndexValueType>(data->pos[2]);<br>
<br>
<br>
if ( (coord[0] >= 0) && (coord[1] >= 0) && (coord[2] >= 0) &&<br>
(coord2[0] < m_ImageWidth) && (coord2[1] < m_ImageHeight) && (coord2[2] < m_ImageDepth) )<br>
<br>
<br>
I think coord < 0 means this point is out of image and GetPixel(coord)[0] will crash. But it actually looks like this: <a href="http://bit.ly/bZCZsF" target="_blank">http://bit.ly/bZCZsF</a> the mesh is still in the image.<br>
<br>
I'm not sure what I did wrong to use this filter.<br>
<br>
Thanks for your help,<br>
<br>
YG<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br></div>