[Insight-users] Problem Reading Dicom Files

Luis Ibanez luis.ibanez@kitware.com
Thu, 31 Oct 2002 10:56:41 -0500


Hi Samuel,

What version of ITK are you using ?

The RegisterOneFactory() method is no longer needed.
Factories for common file formats are now registered
by default. It should be enough to provide the file
name (making sure that the ".dcm" extension is used).

The Dicom reader implemented in ITK support a
certain number of common lables.  You can find
the details at:

     Insight/Code/IO/itkDicomImageIO.cxx

--

Could you please try to read your dicom file using
one of the ITK example applications. For example:

1) GaussianFilter2D
2) DicomImageViewer


Please let us know if any of these applications can
read your dicom file.

Thanks


    Luis



==============================================
Samuel Rodríguez Bescos wrote:
> Hello everybody,
> 
>  
> 
> I'm executing then testing program of itk (itkIOTest.exe) for reading a 
> dicom files. The problem is that It can't read my dicom files. Does 
> anybody know if the Dicom Files must have got any special properties?.
> 
>  
> 
> I have only change the name of the file I want to read. This is the code:
> 
>  
> 
>       typedef unsigned short PixelType;
>  
>       typedef itk::Image<PixelType, 2> myImage;
> 
>  
> 
>       itk::ImageFileReader<myImage>::Pointer reader
>                                   = itk::ImageFileReader<myImage>::New();
> 
>  
> 
>  
>       // Register on factory capable of creating DicomImage readers
>      itk::DicomImageIOFactory::RegisterOneFactory();
>      reader->DebugOn();
>      reader->SetFileName"Estudio445.dcm");
>  
>       try
>      {
>         reader->Update();
>      }
>       catch (itk::ExceptionObject & e)
>       {
>         std::cerr << "exception in file reader " << std::endl;
>         std::cerr << e.GetDescription() << std::endl;
>         std::cerr << e.GetLocation() << std::endl;
>         return EXIT_FAILURE;
>      }
> 
>  
> 
>  
> 
> And the error is:
> 
>     Exception in file reader
> 
>     Could not create IO object for file Estudio445.dcm
> 
>     Unknwon.
> 
>  
> 
> Thnks!!
> 
>  
> 
> Sam
>