[Insight-users] Figure out the index of a pixel

Luis Ibanez luis.ibanez at kitware.com
Thu Sep 2 18:50:05 EDT 2004

Hi Jian,

Yes, in general you can interpret and
index [x1,x2] as

            x1  =  x
            x2  =  y

and in 3D [x1,x2,x3] will imply

            x3  =  Z

Note that the index will be just a counter
of grid positions. It will not give you
coordinates in space (at least not in physical
units, like millimeters).

If you are looking for coordinates in space you
must use the method

   image->IndexToPhysicalPoint(index, point);

Please read the DataRepresentation chapter
on the Software Guide. In particular the
section about the itk::Image.




Jian XIE wrote:

> Dear ITK users, I just want to know if I'm accessing a 2D image using
> image iterator, then the GetIndex() method will return [x1,x2] where x1,x2 is a
> number. Is it true that x1 = x axis and x2 = y axis???
> so if I have a 3D image, GetIndex() will return [x1,x2,x3] where x1 and x2
> is the same as above and x3 = z axis???
> Figure out the Index of the pixel with GetIndex() means get the exact
> pixel position???
> thanks for your attention
> Jian
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users

More information about the Insight-users mailing list