[Insight-users] Question about DICOM files and grey levels

Mathieu Malaterre mathieu.malaterre at kitware.com
Wed Mar 1 10:36:45 EST 2006


Remi Vieux wrote:
> Hi everyone,
> Here is my question:
> A DICOM file contains pixel data coded on 12 bits am I right? 

It's more complicated than that, You can have a more choice in between 
8/12/16bits and how many bits are actually used to store the data. But 
from now on I'll assume you are talking about "Bits Stored" (vs "Bits 
Allocated")

> So that is
> to say when you read a DICOM file you should obtain in example grey
> levels from 0 to 4095.

no :-P
You did not mention the signesss of your data.

> So, I'm trying to read a 2D DICOM serie and put it in the so defined itk
> Image:
> typedef unsigned short PixelVolumeType;
> const unsigned int VolumeDimension = 3;
> typedef itk::Image<PixelVolumeType, 3> VolumeType;

Yes. At least if you are using GDCM. GDCM will indeed convert the 12bits 
data into 16bits data. This is the easiest way IMHO to deal with this 
type of pixel type.

> When I check the values of the pixel, its "all" in the 64000's, that is
> to say well above the theoric 4095 max value. In the documentation it is
> suggested to use signed short as Pixel Type for reading DICOM files, so
> my guess is that it is the conversion from signed to unsigned which
> results in those anormal values. So, is it possible to get the data with
> the "correct" values directly?

Use "DicomImageReadPrintTags" to read the info from the header.
In particular:
(0028|0101) Bits Stored = 12
and
(0028|0103) Pixel Representation = 0

HTH
Mathieu


More information about the Insight-users mailing list