[Insight-developers] Re: have you tested itkOrientedImage

Kent Williams kent at psychiatry.uiowa.edu
Fri Mar 10 16:13:24 EST 2006


I'm forwarding this e-mail to the ITK developers list, as I'm not sure 
what the answer is. If you are right -- and what you've written sounds 
plausible -- there's a problem with precedence in how the physical 
coordinates are derived from the index.  Yet others are using 
itk::OrientedImage without complaints.

Either your assumptions are incorrect, or the code is incorrect, and I'm 
hoping the more informed among the developers will set us straight!

Leila Baghdadi wrote:

>Hello Kent,
>
>sorry again, I was just doing some testing and I see that (at least
>according to my understanding) even though itkOrientedImage does take
>direction cosines into account, it actually does not calculate 
>voxel --> world correctly! I have attached my formula as well,
>
>can you please tell me what I am doing wrong!
>Thanks very much
>Leila
>
>for instance, 
>
>suppose for one of the dimensions of my image say Z
>
>Z --> 
>start -2.2 
>space 0.06
>direction cosine 0 0 0.9
>index 63
>
>so my calculation manually and from my visualization says
>
>(-2.2 + (0.06 * 63)) * 0.9 = 1.42
>
>now in itkOrientedImage.h the first thing is calculation of spacing
>multiplied by direction cosines so matrix(2,2) = 0.054 or 0.9 * 0.06
>which is fine but it "leaves" the multiplication of start by direction
>cosines (i.e, -2.2 * 0.9) behind!
>which results in
>-2.2 + (0.06 * 63) * 0.9 = 1.202
>
>which is what I see printed from my itk test and I also printed values
>from itkImageTransformHelper!!
>
>and I have confirmation for the other two dimensions in my image
>  
>
>
> ------------------------------------------------------------------------
>



More information about the Insight-developers mailing list