write a 32 bit DCM_PixelData

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
jrovira
Posts: 2
Joined: Mon, 2015-01-12, 08:15

write a 32 bit DCM_PixelData

#1 Post by jrovira »

Hello,
I'm trying to create from the scratch a 32 bit pixeldata DICOM image with C++ using dcmtk. Diving into the forum and the dcmtk documentation I'm not being able to find how to use a 32 bit version of putAndInsertUint8Array() or putAndInsertUint16Array() functions.
How can I write a 32 bit DCM_PixelData array with dmtk?
Thanks in advance,
Juanjo

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: write a 32 bit DCM_PixelData

#2 Post by Michael Onken »

Hi,

you can use putAndInsertUint8...(). 32 Bit Pixel data is also just a sequence of bytes where 4 bytes belong to a single pixel. The putAndInsert() call does not interpret the data but just inserts the provided blob of pixel data in memory into the Pixel Data element.

Best regards,
Michael

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

Re: write a 32 bit DCM_PixelData

#3 Post by J. Riesmeier »

No, for Pixel Data where Bits Allocated is greater than 8, you always have to use the Uint16 (OW) version of the API.

From DICOM PS3.5: "If Pixel Data (7FE0,0010) is sent in a Native Format, the Value Representation OW is most often required.
The Value Representation OB may also be used for Pixel Data (7FE0,0010) in cases where Bits Allocated has a value less than
or equal to 8, but only with Transfer Syntaxes where the Value Representation is explicitly conveyed (see Annex A)."

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: write a 32 bit DCM_PixelData

#4 Post by Michael Onken »

Mea culpa :) Anyway, using the existing API functions is sufficient, you do not need a putAndInsertUint32() or the like.

Best,
Michael

jrovira
Posts: 2
Joined: Mon, 2015-01-12, 08:15

Re: write a 32 bit DCM_PixelData

#5 Post by jrovira »

I've achived to create my 32 bit pixeldata DICOM image with your help.
Thanks to both of you,
Juanjo

Post Reply

Who is online

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