[Insight-users] Series Read Dicom file using GDCMImageIO

Li, Wen WLi at childrensnational.org
Wed Apr 17 08:01:13 EDT 2013


Hi Wei,

Please see my comment below.

Wen

________________________________
From: insight-users-bounces at itk.org [insight-users-bounces at itk.org] on behalf of Liu,Wei [WLiu3 at mdanderson.org]
Sent: Tuesday, April 16, 2013 5:31 PM
To: insight-users at itk.org
Subject: [Insight-users] Series Read Dicom file using GDCMImageIO

I am trying to series read DICOM files as fixed image and moving image. I followed the examples in ITK 4.3.1/Example/IO/DicomSeriesReadSeriesWrite.cxx using GDCMImageIO.

However, i always get the error when compiling:
/work/01515/wliu3/LogSymmetricDemons-master/Applications/DemonsRegistration.cxx: In function ‘void DemonsRegistrationFunction(arguments)’:
/work/01515/wliu3/LogSymmetricDemons-master/Applications/DemonsRegistration.cxx:681: error: too few template-parameter-lists
/work/01515/wliu3/LogSymmetricDemons-master/Applications/DemonsRegistration.cxx:682: error: ‘FixedImageFileNames’ was not declared in this scope

The following is the part of the code to series read the DICOM files:

template <unsigned int Dimension>
void DemonsRegistrationFunction( arguments args )
{
  // Declare the types of the images (float or double only)
  typedef float                            PixelType;
  typedef itk::Image<PixelType, Dimension> ImageType;

  typedef itk::Vector<PixelType, Dimension> VectorPixelType;
  typedef typename itk::Image
  <VectorPixelType, Dimension>              DeformationFieldType;

  // Images we use
  typename ImageType::Pointer fixedImage = 0;
  typename ImageType::Pointer movingImage = 0;
  typename DeformationFieldType::Pointer inputDefField = 0;

  // Set up the file readers
  typedef itk::ImageSeriesReader<ImageType> ImageReaderSeriesType; //for the Image Dicom files
   typedef itk::ImageFileReader<DeformationFieldType> FieldReaderType;
  typedef itk::TransformFileReader                   TransformReaderType;

  typedef itk::GDCMImageIO ImageIOType;
  typedef itk::GDCMSeriesFileNames NamesGeneratorType;

  typedef itk::MetaImageIO ImageIOOutputType;

    { // for mem allocations
    typename ImageIOType::Pointer GDCMImageIO = ImageIOType::New();
    typename NamesGeneratorType::Pointer NamesGenerator = NamesGeneratorType::New();
    NamesGenerator->SetInputDirectory(args.fixedImageFile.c_str());

    std::cout<< args.fixedImageFile.c_str() << std::endl;

    typename const ImageReaderSeriesType::FileNamesContainer & FixedImageFileNames = NamesGenerator->GetInputFileNames(); //problems happens here error: too few template-parameter-lists
--------------------------------------------------------------------------------------------------------------------------------
You sure "typename" is needed??

    std::cout << "Number of Dicom Files" << FixedImageFileNames.size() <<std::endl;;

Does anybody know what is wrong here?
Thanks

Wei
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130417/fc598ba3/attachment.htm>


More information about the Insight-users mailing list