<font size="2"><font face="verdana,sans-serif"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; ">TransformPhysicalPointToIndex works on an image and requires indices related to the image, not for some ROI you want. You must add ROI's start indices to XYZ of a point within ROI.</span></font></font><div>
<font><font class="Apple-style-span" face="arial, sans-serif"><br></font></font></div><div><font><font class="Apple-style-span" face="arial, sans-serif">HTH<br></font></font><br><div class="gmail_quote">On Thu, Apr 7, 2011 at 16:05, Ella Maria Kadas <span dir="ltr"><<a href="mailto:ella_kadas@yahoo.com">ella_kadas@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit"><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
Hi,</p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><br></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"> I am trying to convert coordinates that a get from points in a roi from a DICOM series to pixelindexes. The Coordinates that i use to initialize pointTemp are the right ones but when i use TransformPhysicalPointToIndex the index coordinates are all the same.</p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"> Please help:)</p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">Cheers,</p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
Ella</p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><br></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><br></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
Here is the code:</p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><br></p><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">ImageType::IndexType pixelIndex;</p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="white-space:pre-wrap">                                </span>ImageType::PointType pointTemp;</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">                                </span>NSPoint roiP = [[roiPoints objectAtIndex:k] point];</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">                                </span>float clocs[3];</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">                                </span>[ pix convertPixX: roiP.x pixY: roiP.y toDICOMCoords: clocs ];</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">                                </span>pointTemp[0] = clocs[0];</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">                                </span>pointTemp[1] = clocs[1];</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">                                </span>pointTemp[2] = clocs[2];</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">                                </span>bool isInside = result->TransformPhysicalPointToIndex(pointTemp,pixelIndex);</p>
<p style="margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo"><span style="white-space:pre-wrap">                                </span>if(inside)result->SetPixel(pixelIndex,0);</p><div><br></div></td></tr></tbody></table><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>
<br></blockquote></div><br></div>