dcmj2pnm.exe to get CT pixelvalues

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
rullbandspelare
Posts: 18
Joined: Fri, 2005-12-09, 11:40

dcmj2pnm.exe to get CT pixelvalues

#1 Post by rullbandspelare »

Hi!
Any help is appreciated!
I whant to extract the CT pixeldata for computation (get HU).
> dcmj2pnm.exe +opw CT.dcm CT.pgm
Gives me a .pgm ASCII file that looks like this.
"P2
512 512
65535
15568 15568 15568 15568 ..."

But I get 15568(3CD0 Hex) instead of 973(03CD Hex) for a specific pixel.
The Pixel Value is 973 and a HU value of -51 according to Fiji Dicom viewer.
The DICOM file pixels looks like this in a HEX editor: cd 03 cd 03 cd 03

Part of the DICOM dump:
...
| (0002,0010) : UI Len: 20 HeaderTransferSyntaxUID Value: [1.2.840.10008.1.2.1]
...
| (0028,0002) : US Len: 2 SamplesperPixel Value: [1]
| (0028,0004) : CS Len: 12 PhotometricInterpretation Value: [MONOCHROME2 ]
| (0028,0010) : US Len: 2 Rows0028 Value: [512]
| (0028,0011) : US Len: 2 Columns0028 Value: [512]
| (0028,0030) : DS Len: 4 PixelSpacing Value: [1\1 ]
| (0028,0100) : US Len: 2 BitsAllocated0028 Value: [16]
| (0028,0101) : US Len: 2 BitsStored Value: [12]
| (0028,0102) : US Len: 2 HighBit Value: [11]
| (0028,0103) : US Len: 2 PixelRepresentation Value: [0]
| (0028,1050) : DS Len: 6 WindowCenter Value: [50\300]
| (0028,1051) : DS Len: 8 WindowWidth Value: [350\2000]
| (0028,1052) : DS Len: 6 RescaleIntercept Value: [-1024 ]
| (0028,1053) : DS Len: 2 RescaleSlope Value: [1 ]
| (0028,1054) : LO Len: 2 Rescaletype Value: [HU]
...

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: dcmj2pnm.exe to get CT pixelvalues

#2 Post by J. Riesmeier »

dcmj2pnm creates a a rendered output of the DICOM image (in various formats). The output pixel values are always unsigned, i.e. not in Hounsfield Units.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest