[Insight-users] Image to world coordinates

Dan Mueller dan.muel at gmail.com
Wed Jun 30 08:50:00 EDT 2010


Hi Dženan

For an unobfuscated formula, you can check the CVS archive:
    http://www.itk.org/cgi-bin/viewcvs.cgi/Code/Common/itkImage.h?revision=1.143&root=Insight&view=markup

HTH

Cheers, Dan

2010/6/30 Dženan Zukić <dzenanz at gmail.com>:
> Yes, I am interested in a plain formula for those conversions. The code in
> ITK is very convoluted - optimized for performance not for clarity.
> Dženan
>
> On Mon, Jun 28, 2010 at 15:08, Vincent Garcia
> <Vincent.Garcia at sophia.inria.fr> wrote:
>>
>> Thank you. The only problem here is that you have to check the source code
>> to interpret the origin, spacing, and direction cosine value.
>> It should be written into the programming guide, or at least somewhere.
>> When you know the correct formula, the answer is straight forward.
>> I'll try to write something about that in a next email if anyone wants to
>> know the answer to my question.
>> One more time, thank you!
>>
>> Vincent
>>
>>
>> Dan Mueller wrote:
>>>
>>> Hi Vincent,
>>>
>>> The following will convert an index in "image" coordinates to a
>>> physical point in "world" coordinates:
>>>    image->TransformIndexToPhysicalPoint( index, point );
>>>
>>> This function is specified in Common/itkImageBase.h
>>>
>>> HTH
>>>
>>> Cheers, Dan
>>>
>>> On 28 June 2010 09:48, Vincent Garcia <Vincent.Garcia at sophia.inria.fr>
>>> wrote:
>>>
>>>>
>>>> Hi all,
>>>>
>>>> When you read a medical image (let's say 3D), you have a 3D matrix
>>>> containing image data and some information about the
>>>> position/orientation of
>>>> the image in the world coordinates. Given the image coordinates (i,j,k),
>>>> I'd
>>>> like to understand how to compute the corresponding world coordinates
>>>> (x,y,z).
>>>> I have access to some information from the itk::Image object:
>>>>
>>>> GetOrigin () : (vector) position of the first voxel in the world
>>>> coordinates
>>>> GetSpacing () : (vector) size of the voxels in mm
>>>> GetDirection () : (matrix) direction cosine
>>>>
>>>> I've tried to search on the documentation but I haven't found the way to
>>>> use
>>>> these vectors and matrix to compute the world coordinates.
>>>> The formula should be very simple but I just can't found it.
>>>>
>>>> Many thanks,
>>>>
>>>> Vincent Garcia


More information about the Insight-users mailing list