[Insight-users] Nifti vs Dicom orientation
Mathieu Coursolle
mcoursolle at rogue-research.com
Mon Apr 6 11:35:35 EDT 2009
Hi,
I am having a similar issue, which may be related.
I have a NIfTI file, which I load using itkNIfTIImageIO.
By stepping into ITK, I can see that the s-form (sto_xyz) is:
[1, 0, 0, -90]
[0, 1, 0, -126]
[0, 0, 1, -72]
[0, 0, 0, 1]
However, when it read the origin and orientation of the resulting
itkImage,
I get:
[-1, 0, 0, 90]
[0, -1, 0, 126]
[0, 0, 1, -72]
[0, 0, 0, 1]
This data is in the MNI-152 space. I know that the index (0, 0, 0)
should be
(-90, -126, -72) mm in LPI coordinate system (NIfTI's default I
believe).
Since I want my data in the RAI coordinate system, I then use the
itkOrientImageFilter.
Assuming it converts the image from LPI to RAI, I would expect the
ouput to be:
[-1, 0, 0, 90]
[0, -1, 0, 90]
[0, 0, 1, -72]
[0, 0, 0, 1]
But I get:
[1, 0, 0, -90]
[0, 1, 0, -90]
[0, 0, 1, -72]
[0, 0, 0, 1]
By the way, my image dimensions are 181 x 217 x 181.
I know that index (0, 0, 0) is (90, 90, -72) mm in RAI.
I am right that the matrix I get from ITK is not what is expected ?
It looks to me that the itkNIfTIImageIO is doing some transform to
the orientation matrix.
What would be that transformation's purpose ?
Thanks a lot!
Mathieu
____________________
Mathieu Coursolle, M.Ing.
Rogue Research Inc.
www.rogue-research.com
On 6-Apr-09, at 10:46 AM, Antoine DUCHAMPS wrote:
> Hi all,
>
> I have a DWI sequence (brain) acquired with a Siemens scanner in Dicom
> format. After converting it to NIfTI with dcm2nii
> (http://www.sph.sc.edu/comd/rorden/mricron/dcm2nii.html) I tried to
> read
> it an recover the orientation by using ITK (I've copied the code
> below).
> The matrix I obtain is the following:
>
> 0.9997 0.0000 0.0252
> 0.0002 -1.0000 -0.0072
> -0.0252 -0.0072 0.9997
>
> However, the transforation matrix in the Dicom header is
>
> 0.9997 0.0000 0.0252
> 0.0002 1.0000 -0.0072
> -0.0252 0.0072 0.9997
>
> If the Dicom image orientation is LPS, this means that the image
> orientation in NIfTI is LAS (And not RAS as I believed). Could anybody
> clarify this please? Are there several possible orientations in NIfTI?
> If so, how can I know the specific image orientation?
>
> Antoine.
>
>
> #include "itkImageFileReader.h"
> #include "itkOrientedImage.h"
>
> const unsigned int Dimension = 4;
> typedef short PixelType;
> typedef itk::OrientedImage<PixelType, Dimension> ImageType;
> typedef ImageType::Pointer ImagePointerType;
> typedef itk::ImageFileReader< ImageType > ReaderType;
>
>
> int main(int argc, char* argv[])
> {
>
> ImageType::Pointer image = ImageType::New();
>
> ReaderType::Pointer reader = ReaderType::New();
> reader->SetFileName(argv[1]);
> reader->Update();
>
> image = reader -> GetOutput();
> std::cout << image->GetDirection() << std::endl; std::cout.flush();
>
> }
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090406/30eb1859/attachment-0001.htm>
More information about the Insight-users
mailing list