Question to FAQ #24 (how to access original pixel data)

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Lauper
Posts: 3
Joined: Tue, 2006-01-17, 16:46

Question to FAQ #24 (how to access original pixel data)

#1 Post by Lauper »

I'm working with DCMTK 3.5.4 and I'm trying to retrieve original pixel data (e.g. hounsfield values). I planned to use getInterData() from the DicomImage class. Is there an example (sample code) available that shows how to use this function?

Thanks

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 »

Thank you for your hint. I've updated the FAQ entry accordingly.

The method DicomImage::getInterData() provides access to the internal representation of the pixel data. The return value is of type const DiPixel*, i.e. you have read-only access to all (const) methods of this class. For example, use getData() in order to get a pointer to the internal pixel data, getRepresentation() for the integer representation of the pixel values (see diutils.h), and getCount() for the number of pixel values.

Lauper
Posts: 3
Joined: Tue, 2006-01-17, 16:46

#3 Post by Lauper »

Working with getInterData() from the DicomImage class works for me. Thanks

Now I hit on the following question: is there a convenient way to find out, what byte order the raw data has (little endian, big endian)? Do I really have to work with the Transfer Syntax UID in order to find that out?

mhavu
Posts: 15
Joined: Wed, 2005-11-23, 16:23
Location: Jyväskylä, Finland

#4 Post by mhavu »

The data you get from getInterData() is always in your system's native byte order. If you want to know the original byte order of the DICOM file, you can use DcmDataset::getOriginalXfer().

Post Reply

Who is online

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