Presentation State

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
AAndrey
Posts: 2
Joined: Fri, 2010-01-22, 13:16

Presentation State

#1 Post by AAndrey »

Hello!

I have the problem with using DVPresentationState class. I'm trying to apply presentation to image. I'm using code from dcmtk354.chm. The presentation file I created with DICOMScope. The presentation file contained graphical annotation and shutters but in result image they are absent. The code example:

DcmFileFormat imagefile;
DcmFileFormat gspsfile;
if (imagefile.loadFile("image.dcm").good() &&
gspsfile.loadFile("gsps.dcm").good())
{
DVPresentationState pstate; // presentation state handler
if (pstate.read(*gspsfile.getDataset()).good()) // parse gsps object
{
// attach presentation state to image data
if (pstate.attachImage(&imagefile, OFFalse).good())
{
const void *pixel; // pointer to pixel data, one byte per pixel
unsigned long width; // width of image bitmap
unsigned long height; // height of image bitmap
if (pstate.getPixelData(pixel, width, height).good())
{
/* do something useful with the pixel data */
}
pstate.detachImage(); // release connection between GSPS and image
}
}
}

What I do wrong?

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 »

According to the API documentation of DVPresentationState::getPixelData(), only the grayscale transformations are applied to the resulting bitmap. The other aspects of the GSPS object are applied by the Java layer of DICOMscope (and not by the DCMTK classes).

AAndrey
Posts: 2
Joined: Fri, 2010-01-22, 13:16

#3 Post by AAndrey »

Thank you for quick answer!

Is there class in DCMTK that I can use with other aspects of the GSPS object?

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest