[Insight-users] convert between the point position in GLSliceView and index in the image

Luis Ibanez luis.ibanez at kitware.com
Wed Dec 10 15:43:20 EST 2008


Sajendra,


A) You will use:

    image->TransformContinuousIndexToPhysicalPoint (index, point);

    When you have the position of an index and you need to convert it
    to the physical coordinates corresponding to taht index.



B) You will use:

     image->TransformPhysicalPointToContinuousIndex (point,  index);


    When you have the position of a point in physical coordinates
    and you need to convert it the image grid index coordinates.


Please read the ITK Software Guide


    http://www.itk.org/ItkSoftwareGuide.pdf


in particular, you MUST read section:


       4.1.4 "Defining Origin and Spacing"

in pdf pages: 71-75.



    Regards,


       Luis


------------------
Sajendra N wrote:
> Luis,
> 
> Can you please elaborate on when one should use the methods you
> mentioned, and one when should use:
>    image->TransformContinuousIndexToPhysicalPoint (index, point);
>    image->TransformPhysicalPointToContinuousIndex (point,  index);
> I've found these methods more useful for my purposes, but the
> documentation is lacking on when to use one and the other.
> 
> Thank you
> 
> 
> On Wed, Dec 10, 2008 at 2:02 PM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
> 
>>In general, whenever you need to convert between one an the other, you
>>can use the methods:
>>
>>   image->TransformIndexToPhysicalPoint( index, point );
>>
>>   image->TransformPhysicalPointToIndex( point, index );
>>
> 
> 


More information about the Insight-users mailing list