[ITK-users] GDCM Dicom reader
kamal.shahim at istb.unibe.ch
kamal.shahim at istb.unibe.ch
Thu Apr 23 09:07:06 EDT 2015
Hello,
I use following codes to read dicom series, but the output of spacing between slices is sometimes correct BUT not always:
// Read the input series
typedef itk::GDCMImageIO ImageIOType;
typedef itk::GDCMSeriesFileNames InputNamesGeneratorType;
ImageIOType::Pointer gdcmIO = ImageIOType::New();
InputNamesGeneratorType::Pointer inputNames = InputNamesGeneratorType::New();
inputNames->SetInputDirectory( dirPath );
inputNames->AddSeriesRestriction("0020|0013");
// Then I select a series identifier and pass it to the reader:
typedef itk::ImageSeriesReader< CTImageType > ReaderType;
ReaderType::Pointer reader = ReaderType::New(); ;
reader->SetImageIO( gdcmIO );
reader->SetFileNames( inputNames->GetFileNames( seriesIdentifier.c_str() ));
reader->UpdateOutputInformation();
--->>> reader->GetOutput()->GetSpacing()[2] is not correct always!!
I use the latest version of ITK and GDCM library.
Thanks a lot for your help,
Regards,
Kamal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20150423/74f1fc33/attachment.html>
More information about the Insight-users
mailing list