[Insight-developers] question regarding direction cosines

Kent Williams norman-k-williams at uiowa.edu
Thu Nov 10 09:54:10 EST 2005


Well, the definition of the direction cosines is that they define 3 
vectors, which define a coordinate system. The first vector corresponds 
to the fastest moving dimension in the image, the second to the next 
fastest, and the third to the slowest.

In other words, the direction cosines define a relationship between 
patient space and the indices into the image data array.

I suppose it would be possible to have a file with more than 3 
dimensions, with an organization such that the dimensions are ordered 
T,U,X,V,Z,Y (fastest moving index to slowest) or something like that. 
But I would worry about getting the most common case right, and work up 
from there.

I've written an article that will be in the Insight Journal, and here is 
a preliminary copy:

http://cornwarning.com/xfer/OrientationArticle.pdf

I hope that helps somewhat. Any more questions, feel free to ask.

Leila baghdadi wrote:

>Hi Kent
>
>that sounds like a good solution, the only problem with this is what if
>the spatial dimensions with meaningful directions are *not* the first 3
>dimensions,
>
>The way I envisioned this, the image could have dimensions of any order
>
>i.e, the three spatial dimensions can show up in any order, so that
>would make the upper left 3x3 of an NxN not meaningful
>
>will work on your solution plus correct ordering, I am sure once I
>commit the code I hear complaints about it
>
>
>Thanks again
>
>Leila
>On Tue, 2005-11-08 at 17:11 -0600, Kent Williams wrote:
>  
>
>>Direction Matrix is NxN where N is the number of dimensions in the 
>>image.  In general, only the first 3 directions have any spatial 
>>meaning, and 3D images are the most common by far.
>>
>>I'd suggest setting the direction matrix to identity, and then filling 
>>in the X,Y,Z (0,1,2) columns with the direction cosines representing the 
>>3D orientation -- basically the upper left 3x3 of the matrix.  Anyone 
>>else have a suggestion?
>>
>>Leila baghdadi wrote:
>>
>>    
>>
>>>Hi guys
>>>
>>>I am writing ImageIO classes for our specific file format (minc2) which
>>>is like itk N-dimensional,
>>>
>>>I am a bit confused about how to create a correct matrix for direction
>>>cosines,
>>>
>>>suppose I have an image with the following
>>>
>>>u,x,r,y,w,z
>>>
>>>so direction cosines are only for x,y,z
>>>
>>>the question is what is the correct way to create m_Direction of
>>>itkImageIOBase.*
>>>
>>>do I create a matrix (6x3) where I have (0,0,0) (1,0,0) (0,0,0) 
>>>
>>>or basically how do you carry the correct index for the spatial
>>>dimensions,
>>>
>>>Hopefully my question is clear if not please let me know
>>>
>>>Thanks
>>>
>>>Leila
>>>
>>>
>>>_______________________________________________
>>>Insight-developers mailing list
>>>Insight-developers at itk.org
>>>http://www.itk.org/mailman/listinfo/insight-developers
>>>
>>> 
>>>
>>>      
>>>



More information about the Insight-developers mailing list