get pixel array in raw format

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
parvez
Posts: 3
Joined: Mon, 2009-04-06, 18:51

get pixel array in raw format

#1 Post by parvez »

I am trying to get pixels using below code

const DiPixel *DP = image->getInterData();
void *pixelData = (void *) DP->getData();

I actually want to print the raw data of picture to a file.

Also i want to check whether an image in dicom is 8bit , 16 bit or 24 bit.
Any help from dicom family will be highly appreciated.

regards,
Parvez Ahmad Hakim

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

What do you mean by "raw data": the uncompressed pixel data stored in the Pixel Data element or the output of the Modality LUT transformation?

parvez
Posts: 3
Joined: Mon, 2009-04-06, 18:51

thanks for reply

#3 Post by parvez »

I am intrested in
the uncompressed pixel data stored in the Pixel Data element

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#4 Post by Jörg Riesmeier »

Since you want to store the pixel data in a raw file, why don't you just use dcmdump with the --write-pixel (+W) option?

parvez
Posts: 3
Joined: Mon, 2009-04-06, 18:51

#5 Post by parvez »

Actually i want to do it in source code..


Also for my second question how to determine if image ios 8bit or 16 bit

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#6 Post by Jörg Riesmeier »

In this case, use findAndGetUint8Array() or findAndGetUint16Array() depending on the value representation of the Pixel Data element (OB or OW). For more details, see the documentation or use the "search" function of this forum system.

liuxinming
Posts: 83
Joined: Thu, 2009-03-19, 04:19

#7 Post by liuxinming »

I think that you can use the "getVR" function so that you can get the value representation; And in order to get the number of bits used for a special dcm file, you can try having a look at the DCM_bitAllocated or DCM_bitStored tag (something like that, I cannot remember them clearly now). "findAndgetOFString" funtion can be used for this purpose.

Post Reply

Who is online

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