[Insight-users] Nifti vs Dicom orientation
Luis Ibanez
luis.ibanez at kitware.com
Wed Apr 8 14:40:10 EDT 2009
Hi Antoine,
Thanks for looking at the original image orientation.
It seems that the problem lies in the interpretation
of orientation in the Nii file...
or... it may be a bug in dcm2nii...
I would suggest to post the question about the assumed
orientation of the Nifti file format to the Nifti forum:
http://nifti.nimh.nih.gov/board/list.php?f=1
Of course, we will be interested in learning about their
reply.
It may mean that we need to modify the NiftiImageIO
class in ITK...
---
On the other hand, please note that in practice you don't
need to use "dcm2nii" since you can achieve exactly the
same goal by runing the example:
Insight/Examples/IO
DicomSeriesReadImageWrite2.cxx
(reading DICOM and saving it as a nifti file).
Which should give you a consistent set of orientations.
Thanks
Luis
------------------------
Antoine DUCHAMPS wrote:
> Hi Luis,
>
> I've read the original DICOM with ITK and I've obtained exactly the same
> direction cosines:
>
> 0.9997 0.0000 0.0252
> 0.0002 1.0000 -0.0072
> -0.0252 0.0072 0.9997
>
> So, should I assume a LAS orientation in nii image? (even when the
> standard is RAS)
>
> Antoine.
>
>
>
> Le lundi 06 avril 2009 à 11:47 -0400, Luis Ibanez a écrit :
>
>>Hi Antoine,
>>
>>Could you please read the original DICOM series with ITK and
>>report the Direction that you get from the ITK image in that case ?
>>
>>
>>
>>In this way we will be able to figure out if the problem is in
>>
>>
>>A) the conversion from DICOM to Nifti as processed by "dcm2nii"
>>
>> or
>>
>>B) the process of reading the nifti file with itkNiftiImageIo.
>>
>>
>>Please post to the list the Direction cosines that you obtain
>>when your read the original DICOM series with ITK.
>>
>>
>> Thanks
>>
>>
>> Luis
>>
>>
>>-----------------
>>On Mon, Apr 6, 2009 at 10:46 AM, Antoine DUCHAMPS
>><antoine.duchamps at gmail.com> 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
>>>
>
>
>
More information about the Insight-users
mailing list