[Insight-users] re:re:why not ITK can read the spacing correctly?

Luis Ibanez luis.ibanez at kitware.com
Sat Apr 29 20:09:14 EDT 2006


Hi Yixun,

When you are performing medical imaging,
you should write applications that are
intended for specific a clinical context.

The minimal information that you should
know is the modality of the image that
you expect to process. The modality will
define the pixel type.

If you are planning to write an application
that can reay "any" type of image, chances
are that your processing will not be appropriate
for none of them...

There are ways of having your application support
the reading of multiple image types. It basically
involve having the GDCMImageIO class to first look
at the DICOM file, and report its pixel type.
Using that information, you can select one among
several pre-instantiated types of the ImageSeriesReader.

This will mean, that after the Reading process you
should cast the images to a common denominator type.


Please let us know if you need additional details
on how to write such code.


   Thanks


      Luis



-----------------
Yixun Liu wrote:
> Thank you!
> 
> It's just my assumption to have slices that are non-consecutive.:-)
> 
> Dicom series use short, float data type. When I use itkSeriesReader to read them, I firstly need to specify the image type. However, I do not know which data type the series use befor I read them. If I use the float type to read all the dicoms series, the memory will be wasted when reading series with short data type and it's troublesome to rescale them to short too.
> 
> Regards,
> 
> Yixun Liu
> 
> 
> ----- Original Message ----- 
> From: "Luis Ibanez" <luis.ibanez at kitware.com>
> To: "Yixun Liu" <yxliu at fudan.edu.cn>
> Cc: "ITK" <insight-users at itk.org>
> Sent: Sunday, April 30, 2006 2:53 AM
> 
> 
> 
> 
>>Hi Yixun,
>>
>>Please don't use DICOMImageIO2, nor DICOMImageIO,
>>
>>You should use GDCMImageIO which is the class that
>>provides better support for DICOM reading in ITK.
>>
>>
>>If the DICOM slices are not consecutive, you will
>>have problems reading the slices.
>>
>>
>>Why do you have slices that are non-consecutive ?
>>Is your dataset incomplete ?
>>
>>
>>
>>   Regards,
>>
>>
>>     Luis
>>
>>
>>
>>==================
>>Yixun Liu wrote:
>>
>>>Hi Luis,
>>>Thank your help!
>>>Yes I compare it with the dicom header.
>>> 
>>>One question. If the dicom files are not consecutive. Could ITK read 
>>>them correctly?
>>> 
>>>Another question. I use DICOMImageIO2 and DicomImageIO to read a same 
>>>series. The DICOMImageIO2 can read  the spacing[2] correctly, but 
>>>DICOMImageIO is error. Why?
>>> 
>>>Regards,
>>> 
>>>Yixun Liu
>>> 
>>> 
>>> 
>>>
>>>----- Original Message -----
>>>From: "Luis Ibanez" <luis.ibanez at kitware.com>
>>>To: "Yixun Liu" <yxliu at fudan.edu.cn>
>>>Cc: "ITK" <insight-users at itk.org>
>>>Sent: Friday, April 28, 2006 9:17 PM
>>>Subject: Re: [Insight-users] why not ITK can read the spacing correctly?
>>>
>>>
>>> >
>>> > Hi Yixun,
>>> >
>>> > What lead you to think that the value of spacing[2] is incorrect ?
>>> >
>>> > Are you comparing the value of spacing[2] against the value in
>>> > the DICOM header ?
>>> >
>>> >
>>> > If so, then it is normal that they differ.
>>> >
>>> > The spacing[2] is computed using the difference in
>>> > origin between consecutive slices. This value does not
>>> > have to match the spacing value in the DICOM header.
>>> >
>>> >
>>> >
>>> >   Regards,
>>> >
>>> >
>>> >      Luis
>>> >
>>> >
>>> >
>>> > ------------------------
>>> > Yixun Liu wrote:
>>> > > Hi,
>>> > > 
>>> > > I use the below codes to read a series of MRI,
>>> > > 
>>> > >  this->dicomReader = ReaderType_Short::New();//itk
>>> > >  itk::DICOMSeriesFileNames::Pointer nameGenerator =
>>> > > itk::DICOMSeriesFileNames::New();
>>> > >  nameGenerator->SetDirectory( (const char*)strPath );
>>> > >  typedef std::vector<std::string> fileNamesContainer;
>>> > >  fileNamesContainer fileNames;
>>> > >  fileNames = nameGenerator->GetFileNames();
>>> > >  this->dicomReader->SetImageIO( itk::DICOMImageIO2::New() );
>>> > >  this->dicomReader->SetFileNames( fileNames );
>>> > >  this->dicomReader->Update();
>>> > > 
>>> > > However, the spacing[2], namely spacing between slices, is uncorrect.
>>> > > 
>>> > > Hope your help!
>>> > > 
>>> > > 
>>> > > Regards,
>>> > > 
>>> > > Yixun Liu
>>> > >
>>> > >
>>> > > 
>>>------------------------------------------------------------------------
>>> > >
>>> > > _______________________________________________
>>> > > Insight-users mailing list
>>> > > Insight-users at itk.org
>>> > > http://www.itk.org/mailman/listinfo/insight-users
>>> >
>>> >
>>>
>>>
>>>------------------------------------------------------------------------
>>>
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users at itk.org
>>>http://www.itk.org/mailman/listinfo/insight-users
>>
>>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 




More information about the Insight-users mailing list