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?
Presentation State
Moderator: Moderator Team
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
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).
Who is online
Users browsing this forum: Baidu [Spider] and 1 guest