signed data with DCMTK 3.5.3 and 3.5.4

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
ecoto
Posts: 14
Joined: Thu, 2006-03-23, 13:34

signed data with DCMTK 3.5.3 and 3.5.4

#1 Post by ecoto »

Hi all,

I have a previous implementation of a DICOM reader using version 3.5.3. This implementation only supports unsigned data and now I would like to extend it to support signed data too.

Currently I'm using findAndGetUint16Array(), which works perfectly. Nevertheless, if I change it to findAndGetSint16Array() for a signed dataset, it doesn't work (count==0 always). The data is compressed, but the codecs are registered and fully working for unsigned data. I can actually display the data, but it looks like a binary image, is just black and white.

Now, at this point of the post ... If I would like to change the previous implementation just by changing to findAndGetSint16Array(), what should I do ?? I've found previous posts regarding this subject, but I didn't found a clear solution to it.

Now, to get to the point with version 3.5.4 ...

I tried to change the code to use the DicomImage class and the new getInterData() method. Basically, I load the image and then I get the pointer to the DiPixels, and from there I get the pointer to the data. That way I easily replaced the old code. I'm just loading the data into an array, which later on I use to render the image. In a while I started loading images again, but the I still get exactly the same binary images than with the previous approach. In addition, unsigned images look different ... , they seem darker, like if the window/level would have changed.

What could be wrong ?

Thanks in advance.

Regards,

ecoto

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1445
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#2 Post by Marco Eichelberg »

Concerning the first part of your question, findAndGetSint16Array() never works on pixel data, because even if the pixel representation is signed, the value representation is OB/OW which are both unsigned types. If you access raw data (which is, what the findAndGet-methods will provide), you have to perform the pre-processing such as masking unused bits, sign-extending etc. by yourself.

Concerning the use of the DicomImage class library, these classes will handle the pre-processing for you and will also apply a modality transformation (such as rescale slope/intercept), which would explain why certain unsigned images suddenly look different. If they are CT, they most probably have a rescale intercept of about -1000, which means that after pre-processing the images are actually signed, not unsigned anymore.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest