[Insight-users] Problem Reading Dicom Files

Samuel Rodríguez Bescos srodrigu@gbt.tfo.upm.es
Tue, 29 Oct 2002 11:49:09 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C27F41.3131BC20
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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;
 =20
      typedef itk::Image<PixelType, 2> myImage;

      itk::ImageFileReader<myImage>::Pointer reader=20
                                  =3D =
itk::ImageFileReader<myImage>::New();

 =20
      // Register on factory capable of creating DicomImage readers
      itk::DicomImageIOFactory::RegisterOneFactory();
      reader->DebugOn();
      reader->SetFileName"Estudio445.dcm");
 =20
      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

------=_NextPart_000_0005_01C27F41.3131BC20
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2715.400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hello everybody,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>I'm&nbsp;executing&nbsp;then&nbsp;testing program=20
of itk (itkIOTest.exe) for reading a dicom files. The problem is that It =
can't=20
read my dicom files. Does anybody know if the Dicom Files must have got =
any=20
special properties?.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have only change the name of the =
file&nbsp;I want=20
to read. This is the code:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; typedef =
unsigned=20
short PixelType;<BR>&nbsp; <BR>&nbsp; &nbsp;&nbsp;&nbsp; typedef=20
itk::Image&lt;PixelType, 2&gt; myImage;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; &nbsp;&nbsp;&nbsp;=20
itk::ImageFileReader&lt;myImage&gt;::Pointer reader=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=3D itk::ImageFileReader&lt;myImage&gt;::New();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; <BR>&nbsp;&nbsp;&nbsp; &nbsp; // =
Register on=20
factory capable of creating DicomImage =
readers<BR>&nbsp;&nbsp;&nbsp;&nbsp; =20
itk::DicomImageIOFactory::RegisterOneFactory();<BR>&nbsp;&nbsp;&nbsp;&nbs=
p; =20
reader-&gt;DebugOn();<BR>&nbsp;&nbsp;&nbsp;&nbsp; =20
reader-&gt;SetFileName"Estudio445.dcm");<BR>&nbsp; <BR>&nbsp; =
&nbsp;&nbsp;&nbsp;=20
try<BR>&nbsp;&nbsp;&nbsp;&nbsp;  {<BR>&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;=20
reader-&gt;Update();<BR>&nbsp;&nbsp;&nbsp;&nbsp;  }<BR>&nbsp; =
&nbsp;&nbsp;&nbsp;=20
catch (itk::ExceptionObject &amp; e)<BR>&nbsp; &nbsp;&nbsp;&nbsp;=20
{<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; "exception =
in file=20
reader " &lt;&lt; std::endl;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
std::cerr=20
&lt;&lt; e.GetDescription() &lt;&lt; std::endl;<BR>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; std::cerr &lt;&lt; e.GetLocation() &lt;&lt;=20
std::endl;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return=20
EXIT_FAILURE;<BR>&nbsp;&nbsp;&nbsp;&nbsp;  }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>And the error is:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; Exception in file=20
reader</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; Could not create IO =
object for=20
file Estudio445.dcm</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
Unknwon.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thnks!!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Sam</FONT></DIV></BODY></HTML>

------=_NextPart_000_0005_01C27F41.3131BC20--