I use this code from the doc to attach presentation state to image data
Code: Select all
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
}
}
}
If I have a 16 bit image, I think I get a 8 bit pixel data.pixelData in this parameter a pointer to the pixel data is returned (array of 8 bit values)
How can I get a 16 bit pixel data?