[Insight-users] TransformPhysicalPointToIndex not what i expected
Dženan Zukić
dzenanz at gmail.com
Fri Apr 8 02:42:44 EDT 2011
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.
HTH
On Thu, Apr 7, 2011 at 16:05, Ella Maria Kadas <ella_kadas at yahoo.com> wrote:
> Hi,
>
>
> 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.
>
> Please help:)
>
> Cheers,
>
> Ella
>
>
>
> Here is the code:
>
>
> ImageType::IndexType pixelIndex;
>
> ImageType::PointType pointTemp;
>
> NSPoint roiP = [[roiPoints objectAtIndex:k] point];
>
> float clocs[3];
>
> [ pix convertPixX: roiP.x pixY: roiP.y toDICOMCoords: clocs ];
>
> pointTemp[0] = clocs[0];
>
> pointTemp[1] = clocs[1];
>
> pointTemp[2] = clocs[2];
>
> bool isInside =
> result->TransformPhysicalPointToIndex(pointTemp,pixelIndex);
>
> if(inside)result->SetPixel(pixelIndex,0);
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110408/d3015823/attachment.htm>
More information about the Insight-users
mailing list