[Insight-users] Getting data type for DICOM data

Jenny Simpson simpson at cs.utah.edu
Thu, 5 Feb 2004 15:02:26 -0700 (MST)


How do I get the data type (i.e. unsigned short, float, etc.) for the
pixel values stored in a DICOM file?

Right now I'm using these two objects to access my DICOM data:
itk::DicomImageIO::Pointer io,
ImageNDType::Pointer image

To get the pixel dat:
PixelType * data = image->GetPixelContainer()->GetBufferPointer();

The problem is that I don't know how to find out what data type to set
PixelType as. I've tried hard-coding every c++ type for it and when I
print out the pixel values they always look wrong (some are correct,
others are not -- as if I'm using the wrong data format every time).  Any
ideas?

Thanks,

Jenny Simpson
Scientific Computing and Imaging Institute
University of Utah