[Insight-users] use itk::ImageFileReader to read a dicom file without extension ???

wassim_belhadj at topnet.tn wassim_belhadj at topnet.tn
Mon Mar 2 06:12:58 EST 2009


hi
How to use itk::ImageFileReader to read a dicom file without extension 


   typedef   unsigned char			InternalPixelType; 
   typedef   unsigned char			OutputPixelType; 
   const     unsigned int			Dimension = 2; 

   typedef itk::Image< InternalPixelType, Dimension >  InternalImageType; 
   typedef itk::Image< OutputPixelType, Dimension > OutputImageType; 

    typedef  itk::ImageFileReader< InternalImageType > ReaderType; 
    typedef  itk::ImageFileWriter<  OutputImageType  > WriterType; 
  
    ReaderType::Pointer reader = ReaderType::New(); 
    WriterType::Pointer writer = WriterType::New(); 

    ReaderType::Pointer reader = ReaderType::New(); 
    WriterType::Pointer writer = WriterType::New(); 


    reader->SetFileName("IMG0045");  

    writer->SetFileName( "Res"); 

   .....

It does not work -It works when i use The File Extension  like IMG0045.dcm
and Res. dcm -

Thank you in advance





More information about the Insight-users mailing list