How to get data from dcm which PR = 1?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
kamil
Posts: 63
Joined: Fri, 2009-04-17, 09:18

How to get data from dcm which PR = 1?

#1 Post by kamil »

I can't get the size of the pixel data from dcm files which PR =1 using getOutPutDataSize(), how to get its size and data?

Thank you!

I have solved this problem, when PR = 1, the function "getOutPutDateSize()" return the double size of Pixel Size, because of 2's complement integer.

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 »

No, getOutputData() always returns unsigned pixel data even if the original pixel data is signed (because the output of the VOI LUT transformation is always unsigned).

kamil
Posts: 63
Joined: Fri, 2009-04-17, 09:18

#3 Post by kamil »

Jörg Riesmeier wrote:No, getOutputData() always returns unsigned pixel data even if the original pixel data is signed (because the output of the VOI LUT transformation is always unsigned).
I mean that when I use createWindowsDIB(), the parameter of "size" is the half of getOutPutData() when PR = 1, am I right?

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 »

There is no such general rule. The size of the output image depends on the image data and the parameters which are passed to the method(s).

kamil
Posts: 63
Joined: Fri, 2009-04-17, 09:18

#5 Post by kamil »

Jörg Riesmeier wrote:There is no such general rule. The size of the output image depends on the image data and the parameters which are passed to the method(s).
Because I want to display the image which PR = 1, because of the getOutPutData() return the 2's complement integer's size, so how do I set the 'size' parameter of 'CreateWindowsDIB()'? May I use the way of allcating the memory internaly?

Thank you!

Best wishes,

kamil

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 »

May I use the way of allcating the memory internaly?
Sure, just set "size" to "0" in this case (see documentation).

kamil
Posts: 63
Joined: Fri, 2009-04-17, 09:18

#7 Post by kamil »

Jörg Riesmeier wrote:No, getOutputData() always returns unsigned pixel data even if the original pixel data is signed (because the output of the VOI LUT transformation is always unsigned).
Hi, I want to know how to get raw data, but I find DicomImage::getInterData() return the data after modality transformation has been applied.

findAndGetUint16Array() function only get Unsigned data.

How can I get the raw unsigned data?

thank you!

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

#8 Post by J. Riesmeier »

How can I get the raw unsigned data?
What do you mean by that? What do you intend to do?

You can either switch off the Modality LUT Transformation using the flag CIF_IgnoreModalityTransformation in the DicomImage constructor or you can use findAndGetUint8/16Array() and do the extraction and possible transformation in your own code.

kamil
Posts: 63
Joined: Fri, 2009-04-17, 09:18

#9 Post by kamil »

J. Riesmeier wrote:
How can I get the raw unsigned data?
What do you mean by that? What do you intend to do?
How can I get the raw signed data?

sorry, I wrote wrong.

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

#10 Post by J. Riesmeier »

You could e.g. use getInterData() and switch off the modality transform with the above mentioned flag.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest