[Insight-users] Series Read Dicom file using GDCMImageIO

Liu,Wei WLiu3 at mdanderson.org
Tue Apr 16 17:31:29 EDT 2013


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
    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/20130416/63cc3889/attachment.htm>


More information about the Insight-users mailing list