DCMTK: dcmpstat: a presentation state library and utility apps

DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
dcmpstat: a presentation state library and utility apps

This module contains classes that implement a high-level API for the DICOM Softcopy Grayscale Presentation State Storage SOP Class. It also contains various support classes that are used by DICOMscope, a free DICOM viewer that has been developed as a demonstrator for presentation states. See https://dicom.offis.de/en/dicomscope/

The main interface classes are:

- DVPresentationState
- DVInterface
- DVPSStoredPrint

# Tools

This module contains the following command line tools:

- dcmmkcrv: Add 2D curve data to image
- dcmmklut: Create DICOM look-up tables
- dcmp2pgm: Read DICOM image and presentation state and render bitmap
- dcmprscp: DICOM basic grayscale print management SCP
- dcmprscu: Print spooler for presentation state viewer
- dcmpschk: Checking tool for presentation states
- dcmpsmk: Create DICOM grayscale softcopy presentation state
- dcmpsprt: Read DICOM images and presentation states and render print job
- dcmpsrcv: Network receive for presentation state viewer
- dcmpssnd: Network send for presentation state viewer

# Examples

The following example shows how to create a default presentation state for a DICOM image:

DcmFileFormat infile;
DcmFileFormat outfile;
if (infile.loadFile("image.dcm").good())
{
DVPresentationState pstate; // presentation state handler
if (pstate.createFromImage(*infile.getDataset()).good())
{
// serialize presentation state into DICOM data set structure
if (pstate.write(*outfile.getDataset(), OFFalse).good())
{
// and write to file
outfile.saveFile("gsps.dcm", EXS_LittleEndianExplicit);
}
}
}
DVPresentationState
a Grayscale Softcopy Presentation State.
Definition dvpstat.h:37
DVPresentationState::createFromImage
OFCondition createFromImage(DcmItem &dset, DVPSoverlayActivation overlayActivation=DVPSO_copyOverlays, DVPSVOIActivation voiActivation=DVPSV_preferVOILUT, OFBool curveActivation=OFTrue, OFBool shutterActivation=OFTrue, OFBool presentationActivation=OFTrue, DVPSGraphicLayering layering=DVPSG_twoLayers, const char *aetitle=NULL, const char *filesetID=NULL, const char *filesetUID=NULL)
creates a default presentation state for a DICOM image.
DcmFileFormat
a class handling the DICOM file format (with meta header)
Definition dcfilefo.h:44
DcmPresentationState::write
OFCondition write(DcmItem &dset, OFBool replaceSOPInstanceUID)
writes the presentation state managed by this object to a DICOM dataset.
OFCondition::good
OFBool good() const
check if the status is OK.
Definition ofcond.h:312
EXS_LittleEndianExplicit
@ EXS_LittleEndianExplicit
Explicit VR Little Endian.
Definition dcxfer.h:46

The following example shows how to apply the grayscale transformation pipeline from a presentation state to a DICOM image:

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
}
}
}
DVPresentationState::read
OFCondition read(DcmItem &dset)
reads a presentation state from a DICOM dataset.
DVPresentationState::getPixelData
OFCondition getPixelData(const void *&pixelData, unsigned long &width, unsigned long &height)
applies presentation state to attached image and returns image bitmap.
DVPresentationState::detachImage
void detachImage()
detaches and frees the image (incl.
DVPresentationState::attachImage
OFCondition attachImage(DcmDataset *dataset, OFBool transferOwnership)
attaches an image to the presentation state.
DcmFileFormat::getDataset
DcmDataset * getDataset()
get dataset part of the fileformat
DcmFileFormat::loadFile
virtual OFCondition loadFile(const OFFilename &fileName, const E_TransferSyntax readXfer=EXS_Unknown, const E_GrpLenEncoding groupLength=EGL_noChange, const Uint32 maxReadLength=DCM_MaxReadLength, const E_FileReadMode readMode=ERM_autoDetect)
load object from a DICOM file.

Generated on Sat Mar 1 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2