[Insight-users] viewing 3D DICOM Image

Soumen Dey soumend at magnum . barc . ernet . in
Tue, 23 Sep 2003 17:36:09 +0530 (IST)


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