[Insight-users] TransformPhysicalPointToIndex not what i expected

Dženan Zukić dzenanz at gmail.com
Fri Apr 8 04:39:51 EDT 2011


I think the attached image will clarify it.

2011/4/8 Ella Maria Kadas <ella_kadas at yahoo.com>

Hi,
   I am not sure i understand what u are trying to say. My images are a copy
of the dicom series i read. And the ROI is created on those dicom series. So
the image and the roi position are very much related. I am just using osirix
to create the rois.
Maybe u can explain what u ment.
Cheers,
   Ella
--- Dženan Zukić <dzenanz at gmail.com> schrieb am Fr, 8.4.2011:

Von: Dženan Zukić <dzenanz at gmail.com>
Betreff: Re: [Insight-users] TransformPhysicalPointToIndex not what i
expected
An: "Ella Maria Kadas" <ella_kadas at yahoo.com>
CC: insight-users at itk.org
Datum: Freitag, 8. April, 2011 09:42 Uhr

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);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110408/a3580eeb/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ImageVsROI_transform.png
Type: image/png
Size: 53746 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110408/a3580eeb/attachment-0001.png>


More information about the Insight-users mailing list