[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> </DIV>
<DIV><FONT face=3DArial =
size=3D2>I'm executing then 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> </DIV>
<DIV><FONT face=3DArial size=3D2>I have only change the name of the =
file I want=20
to read. This is the code:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> typedef =
unsigned=20
short PixelType;<BR> <BR> typedef=20
itk::Image<PixelType, 2> myImage;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> =20
itk::ImageFileReader<myImage>::Pointer reader=20
<BR> &nb=
sp; &nbs=
p; =20
=3D itk::ImageFileReader<myImage>::New();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> <BR> // =
Register on=20
factory capable of creating DicomImage =
readers<BR> =20
itk::DicomImageIOFactory::RegisterOneFactory();<BR> &nbs=
p; =20
reader->DebugOn();<BR> =20
reader->SetFileName"Estudio445.dcm");<BR> <BR> =
=20
try<BR> {<BR> =
=20
reader->Update();<BR> }<BR> =
=20
catch (itk::ExceptionObject & e)<BR> =20
{<BR> std::cerr << "exception =
in file=20
reader " << std::endl;<BR> =
std::cerr=20
<< e.GetDescription() << std::endl;<BR> =20
std::cerr << e.GetLocation() <<=20
std::endl;<BR> return=20
EXIT_FAILURE;<BR> }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>And the error is:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> Exception in file=20
reader</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> Could not create IO =
object for=20
file Estudio445.dcm</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
Unknwon.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thnks!!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Sam</FONT></DIV></BODY></HTML>
------=_NextPart_000_0005_01C27F41.3131BC20--