[Insight-users] viewing 3D DICOM Image
Luis Ibanez
luis . ibanez at kitware . com
Thu, 25 Sep 2003 02:06:37 -0400
Hi Soumen,
It looks like the file "files.mhd" is not in the
directory from where you are running your executable.
Have you tried passing the absolute path to this file
in the method SetFileName() ?
Something like
reader->SetFileName("d:\\fusion\\vithal-ct\\files.mhd")
Also, note that you MUST put the metaimage header
file in the same directory where the DICOM files
are, therefore you SHOULDN'T put paths in the files
names of the dicom files inside the metaimage header.
That means that the last part o the metaimage header
should be something like
> NDims = 3
> DimSize = 512 512 100
> ElementType = MET_USHORT
> HeaderSize = -1
> ElementSize = 1 1 3
> ElementSpacing = 1 1 1
> ElementByteOrderMSB = False
> ElementDataFile = LIST
> 1187920
> 1187938
....
Note that the path to the dicom file has been
removed. The MetaImageIO assumes (and relies on)
the MetaImage header to be located in the same
directory as the dicom files.
Regards,
Luis
----------------
Soumen Dey wrote:
> Hello Insight Users,
> I am trying to display a 3D image from a series of dicom 2D-slices. For
> that I have written a code as follows.....
> ReaderType::Pointer reader= ReaderType::New();
> ConnectorFilterType::Pointer connector = ConnectorFilterType::New();
>
> itk::MetaImageIO::Pointer MetaIO;
> MetaIO = itk::MetaImageIO::New();
>
> reader->SetImageIO(MetaIO);
> reader->SetFileName( "files.mhd" );
>
> connector->SetInput( reader->GetOutput() );
> ......
>
> While i am getting following as output....
>
> NDims required and not defined.
> MetaObject: Read MET_Read Failed
> MetaImage:M_Read:Error parsing file
> MetaImage:Read:Cannot parse file
>
> I have written the metaimage header file like this....
> ObjectType = Image
> NDims = 3
> DimSize = 512 512 100
> ElementType = MET_USHORT
> HeaderSize = -1
> ElementSize = 1 1 3
> ElementSpacing = 1 1 1
> ElementByteOrderMSB = False
> ElementDataFile = LIST
> d:\fusion\vithal-ct\1187920
> d:\fusion\vithal-ct\1187938
>
> Will anyone help me out by pointing out the problem in the program
>
> Soumen
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>