DVPresentationState Class Reference

a Grayscale Softcopy Presentation State. More...

Inheritance diagram for DVPresentationState:

DcmPresentationState List of all members.

Public Member Functions

 DVPresentationState (DiDisplayFunction **dispFunction=NULL, unsigned long minPrintBitmapX=0, unsigned long minPrintBitmapY=0, unsigned long maxPrintBitmapX=0, unsigned long maxPrintBitmapY=0, unsigned long maxPreviewImageX=0, unsigned long maxPreviewImageY=0)
 default constructor
virtual ~DVPresentationState ()
 destructor
void clear ()
 resets the object to initial state.
OFCondition read (DcmItem &dset)
 reads a presentation state from a DICOM dataset.
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.
OFCondition addImageReferenceAttached (const char *aetitle=NULL, const char *filesetID=NULL, const char *filesetUID=NULL)
 adds a reference to the currently attached image to this presentation state.
OFCondition removeImageReferenceAttached ()
 removes a reference to the currently attached image from this presentation state.
OFCondition setCurrentPresentationLUT (DVPSPresentationLUTType newType)
 sets the current Presentation LUT type.
OFCondition setDefaultPresentationLUTShape ()
 resets the Presentation LUT to the default LUT shape which is DVPSP_identity for MONOCHROME2 images and DVPSP_inverse for MONOCHROME1.
OFCondition setPresentationLookupTable (DcmUnsignedShort &lutDescriptor, DcmUnsignedShort &lutData, DcmLongString &lutExplanation)
 stores a presentation lookup table in the presentation state.
OFCondition setPresentationLookupTable (DcmItem &dset)
 stores a presentation lookup table in the presentation state.
OFCondition writePresentationLUTforPrint (DcmItem &dset)
 writes the current Presentation LUT to a DICOM dataset.
OFBool isMonochrome1Image ()
 checks whether the attached image is MONOCHROME1.
OFBool haveActiveVOIWindow ()
 check if a VOI window is currently active
OFBool haveActiveVOILUT ()
 check if a VOI LUT is currently active
const char * getCurrentVOIDescription ()
 returns a description string for a currently active VOI transform.
OFCondition getCurrentWindowWidth (double &w)
 gets the width of the current VOI window.
OFCondition getCurrentWindowCenter (double &c)
 get the center of the current VOI window.
size_t getNumberOfVOILUTsInImage ()
 gets the number of VOI LUTs available in the attached image.
size_t getNumberOfVOIWindowsInImage ()
 gets the number of VOI Windows available in the attached image.
const char * getDescriptionOfVOILUTsInImage (size_t idx)
 returns a description string for the given VOI LUT in the attached image.
const char * getDescriptionOfVOIWindowsInImage (size_t idx)
 returns a description string for the given VOI Window in the attached image.
OFCondition setVOILUTFromImage (size_t idx, DVPSObjectApplicability applicability=DVPSB_currentImage)
 activates one of the VOI LUTs from the attached image.
OFCondition setVOIWindowFromImage (size_t idx, DVPSObjectApplicability applicability=DVPSB_currentImage)
 activates one of the VOI Windows from the attached image.
OFCondition setVOIWindow (double wCenter, double wWidth, const char *description=NULL, DVPSObjectApplicability applicability=DVPSB_currentImage)
 sets a user defined VOI window center and width.
OFCondition setVOILUT (DcmUnsignedShort &lutDescriptor, DcmUnsignedShort &lutData, DcmLongString &lutExplanation, DVPSObjectApplicability applicability=DVPSB_currentImage)
 stores a VOI lookup table in the presentation state.
void deactivateVOI (DVPSObjectApplicability applicability=DVPSB_currentImage)
 deactivates the current VOI transformation.
OFCondition setGammaVOILUT (double gammaValue, DVPSObjectApplicability applicability=DVPSB_currentImage)
 stores VOI lookup table with a gamma curve shape in the presentation state.
DVPSPresentationSizeMode getDisplayedAreaPresentationSizeMode ()
 gets the presentation size mode for the current image and frame.
double getDisplayedAreaPresentationPixelAspectRatio ()
 gets the presentation pixel aspect ratio for for the current image and frame.
OFCondition getStandardDisplayedArea (Sint32 &tlhcX, Sint32 &tlhcY, Sint32 &brhcX, Sint32 &brhcY)
 gets the displayed area top lefthand corner and bottom righthand corner for the current potentially rotated and flipped image and frame.
OFCondition getImageRelativeDisplayedArea (Sint32 &tlhcX, Sint32 &tlhcY, Sint32 &brhcX, Sint32 &brhcY)
 gets the displayed area top lefthand corner and bottom righthand corner for the current image and frame, as if the image was unrotated This method may only be called when an image is attached to the presentation state.
OFCondition getDisplayedAreaPresentationPixelSpacing (double &x, double &y)
 gets the presentation pixel spacing for the current image and frame if it is known.
OFCondition getDisplayedAreaPresentationPixelMagnificationRatio (double &magnification)
 gets the presentation pixel magnification ratio for the current image and frame if it is present.
OFBool canUseDisplayedAreaTrueSize ()
 checks if "TRUE SIZE" can be used as presentation size mode for the current image and frame (i.e.
OFCondition setStandardDisplayedArea (DVPSPresentationSizeMode sizeMode, Sint32 tlhcX, Sint32 tlhcY, Sint32 brhcX, Sint32 brhcY, double magnification=1.0, DVPSObjectApplicability applicability=DVPSB_currentImage)
 sets the displayed area and size mode (for the current frame, the current image or all images referenced by the presentation state object).
OFCondition setImageRelativeDisplayedArea (DVPSPresentationSizeMode sizeMode, Sint32 tlhcX, Sint32 tlhcY, Sint32 brhcX, Sint32 brhcY, double magnification=1.0, DVPSObjectApplicability applicability=DVPSB_currentImage)
 sets the displayed area and size mode (for the current frame, the current image or all images referenced by the presentation state object).
void removeShutter (DVPSShutterType type)
 deactivates display shutter of given type.
OFCondition setRectShutter (Sint32 lv, Sint32 rv, Sint32 uh, Sint32 lh)
 sets and activates rectangular display shutter.
OFCondition setCircularShutter (Sint32 centerX, Sint32 centerY, Sint32 radius)
 sets and activates circular display shutter.
OFCondition addPolyShutterVertex (Sint32 x, Sint32 y)
 sets polygonal display shutter point.
OFCondition removeGraphicLayer (size_t idx)
 removes and deletes a graphic layer.
size_t getNumberOfTextObjects (size_t layer)
 returns the number of text objects for the given graphic layer.
DVPSTextObjectgetTextObject (size_t layer, size_t idx)
 gets the text object with the given index on the given layer.
DVPSTextObjectaddTextObject (size_t layer, DVPSObjectApplicability applicability=DVPSB_allImages)
 creates a new text object on the given layer.
OFCondition removeTextObject (size_t layer, size_t idx)
 deletes the text object with the given index on the given layer.
OFCondition moveTextObject (size_t old_layer, size_t idx, size_t new_layer, DVPSObjectApplicability applicability=DVPSB_allImages)
 moves the text object with the given index on the given layer to a different layer.
size_t getNumberOfGraphicObjects (size_t layer)
 returns the number of graphic objects for the given graphic layer.
DVPSGraphicObjectgetGraphicObject (size_t layer, size_t idx)
 gets the graphic object with the given index on the given layer.
DVPSGraphicObjectaddGraphicObject (size_t layer, DVPSObjectApplicability applicability=DVPSB_allImages)
 creates a new graphic object on the given layer.
OFCondition removeGraphicObject (size_t layer, size_t idx)
 deletes the graphic object with the given index on the given layer.
OFCondition moveGraphicObject (size_t old_layer, size_t idx, size_t new_layer, DVPSObjectApplicability applicability=DVPSB_allImages)
 moves the graphic object with the given index on the given layer to a different layer.
DVPSCurvegetCurve (size_t layer, size_t idx)
 gets the curve with the given index on the given layer.
size_t getNumberOfCurvesInImage ()
 returns the number of curves in the attached image that could be activated in the presentation state.
DVPSCurvegetCurveInImage (size_t idx)
 gets the curve with the given index from the attached image.
OFCondition addCurve (size_t layer, size_t curveidxinimage)
 activates curve in presentation state.
const char * getActiveOverlayLabel (size_t layer, size_t idx)
 gets the overlay label of the given activated overlay.
const char * getActiveOverlayDescription (size_t layer, size_t idx)
 gets the overlay description of the given activated overlay.
OFBool activeOverlayIsROI (size_t layer, size_t idx)
 checks whether the given activated overlay is a ROI (region of interest) overlay.
OFCondition getOverlayData (size_t layer, size_t idx, const void *&overlayData, unsigned int &width, unsigned int &height, unsigned int &left_pos, unsigned int &top_pos, OFBool &isROI, Uint16 &fore, unsigned int bits=8)
 gets one overlay bitmap.
size_t getNumberOfOverlaysInImage ()
 gets the number of overlays which are embedded in the image currently attached to the presentation state.
Uint16 getOverlayInImageGroup (size_t idx)
 gets the repeating group number of the given overlay in the attached image.
const char * getOverlayInImageLabel (size_t idx)
 gets the overlay label of the given overlay in the attached image.
const char * getOverlayInImageDescription (size_t idx)
 gets the overlay description of the given overlay in the attached image.
size_t getOverlayInImageActivationLayer (size_t idx)
 gets the index of the activation layer on which the given overlay from the attached image is activated.
OFBool overlayInImageIsROI (size_t idx)
 checks whether the given overlay in the attached image is a ROI (region of interest) overlay.
OFCondition removeOverlayFromPresentationState (size_t idx)
 removes an overlay from the presentation state.
OFCondition changeOverlayGroupInPresentationState (size_t idx, Uint16 newGroup=0)
 changes the repeating group used for an overlay in the presentation state.
OFCondition addOverlayToPresentationState (DcmItem &overlayIOD, Uint16 groupInItem, Uint16 newGroup=0)
 adds a new overlay bitmap to the presentation state.
OFBool overlayIsSuitableAsBitmapShutter (size_t idx)
 checks if an overlay from the presentation state is suitable for use as a bitmap shutter.
OFCondition activateOverlayInImage (size_t layer, size_t idx)
 activates the given overlay from the attached image on the given graphic layer.
OFCondition activateOverlayInPresentationState (size_t layer, size_t idx)
 activates the given overlay from the presentation state on the given graphic layer.
OFCondition activateOverlayAsBitmapShutter (size_t idx)
 activates an overlay as bitmap shutter.
OFCondition deactivateOverlay (size_t layer, size_t idx)
 removes activation for an overlay which may be embedded in the attached image or part of the presentation state.
OFCondition attachImage (DcmDataset *dataset, OFBool transferOwnership)
 attaches an image to the presentation state.
OFCondition attachImage (DcmFileFormat *fileformat, OFBool transferOwnership)
 attaches an image to the presentation state.
void detachImage ()
 detaches and frees the image (incl.
OFBool isInverse ()
 checks whether image is inverse (shape, plut or mono1).
OFCondition invertImage ()
 inverts image by changing presentation state LUT or presentation state LUT shape.
OFCondition getPixelData (const void *&pixelData, unsigned long &width, unsigned long &height)
 applies presentation state to attached image and returns image bitmap.
OFCondition getPixelData (void *pixelData, unsigned long size)
 same as method above apart from the fact that the storage area is handled externally.
const char * getAttachedImageSOPClassUID ()
 returns the SOP Class UID of the currently attached image.
const char * getAttachedImageSOPInstanceUID ()
 returns the SOP Instance UID of the currently attached image.
OFCondition getImageWidth (unsigned long &width)
 gets the width of the attached image.
OFCondition getImageHeight (unsigned long &height)
 gets the height of the attached image.
unsigned long getPrintBitmapSize ()
 gets number of bytes used for the print bitmap.
OFCondition setMinimumPrintBitmapWidthHeight (unsigned long width, unsigned long height)
 sets the minimum print bitmap width and height.
OFCondition setMaximumPrintBitmapWidthHeight (unsigned long width, unsigned long height)
 sets the maximum print bitmap width and height.
OFCondition getPrintBitmapWidthHeight (unsigned long &width, unsigned long &height)
 gets width and height of print bitmap.
OFCondition getPrintBitmapWidth (unsigned long &width)
 gets width of print bitmap.
OFCondition getPrintBitmapHeight (unsigned long &height)
 gets height of print bitmap.
double getPrintBitmapPixelAspectRatio ()
 gets the presentation pixel aspect ratio for the print bitmap.
OFCondition getPrintBitmapRequestedImageSize (OFString &requestedImageSize)
 gets requested image size for print bitmap.
OFCondition getPrintBitmap (void *bitmap, unsigned long size, OFBool inversePLUT=OFFalse)
 writes the bitmap data into the given buffer.
OFCondition createPreviewImage (unsigned long maxWidth, unsigned long maxHeight, OFBool clipMode=OFFalse)
 creates a new preview image based on the current image and pstate.
void deletePreviewImage ()
 deletes and disables the current preview image.
unsigned long getPreviewImageSize ()
 gets number of bytes used for the preview image bitmap.
OFCondition getPreviewImageWidthHeight (unsigned long &width, unsigned long &height)
 gets current width and height of the preview image.
OFCondition getPreviewImageWidth (unsigned long &width)
 gets current width of the preview image.
OFCondition getPreviewImageHeight (unsigned long &height)
 gets current height of the preview image.
OFCondition getPreviewImageBitmap (void *bitmap, unsigned long size)
 writes the bitmap data of the preview image into the given buffer.
OFCondition getImageMinMaxPixelRange (double &minValue, double &maxValue)
 gets smallest and biggest possible pixel value in the attached image.
OFCondition getImageMinMaxPixelValue (double &minValue, double &maxValue)
 gets smallest and biggest occuring pixel value in the attached image.
OFCondition getImageNumberOfFrames (unsigned long &frames)
 gets the number of frames of the current (attached) image.
OFCondition selectImageFrameNumber (unsigned long frame)
 selects one frame of a multiframe image.
unsigned long getSelectedImageFrameNumber ()
 gets the index of the currently selected frame in a multi-frame image.
DVPSDisplayTransform getDisplayTransform ()
 gets the currently selected display transform.
void setDisplayTransform (DVPSDisplayTransform transform)
 activates or deactivates display correction.
Uint16 convertPValueToDDL (Uint16 pvalue, unsigned int bits=8)
 converts a 16-bit P-Value to an 8-bit DDL value for on-sceen display.
OFCondition writeHardcopyImageAttributes (DcmItem &dset)
 writes the patient module attributes and a source image sequence for a grayscale hardcopy image.
const char * getCurrentImageModality ()
 gets the modality of the attached image.
Uint16 findOverlayGroup (Uint16 currentGroup=0)
 tries to find an overlay repeating group that is not used in the presentation state or the attached image.
void renderPixelData (OFBool display=OFTrue)
 prepares pixel data for image and overlays for access.
DVPSDisplayedAreagetDisplayedAreaSelection ()
 attempts to find the displayed area selection for the current image and frame.
DVPSSoftcopyVOIgetCurrentSoftcopyVOI ()
 attempts to find the Softcopy VOI LUT item for the current image and frame.
void setLog (OFConsole *stream, OFBool verbMode, OFBool dbgMode)
 sets a new log stream

Static Private Member Functions

static OFCondition activateOverlayHelper (DVPSOverlay &ovl, DicomImage &image, OFBool asShutter=OFFalse, Uint16 pvalue=0)
 helper method that activates the given overlay in the given image

Private Attributes

DcmDatasetcurrentImageDataset
 a pointer to the DICOM dataset comprising the image to which the presentation state is currently applied
DcmFileFormatcurrentImageFileformat
 a pointer to the fileformat (if it exists) of the DICOM dataset comprising the image to which the presentation state is currently applied
DicomImagecurrentImage
 a pointer to the dcmimage representation of the image to which the presentation state is currently applied
DicomImagepreviewImage
 a pointer to the dcmimage representation of the (smaller) preview image to which the presentation state is currently applied
unsigned long currentImageWidth
 contains the width of the attached image without consideration of rotation.
unsigned long currentImageHeight
 contains the height of the attached image without consideration of rotation.
unsigned long renderedImageWidth
 contains the width of the attached image after pixel data have been rendered (w/o clipping).
unsigned long renderedImageHeight
 contains the height of the attached image after pixel data have been rendered (w/o clipping).
signed long renderedImageTop
 contains the top hand corner of the attached image after pixel data have been rendered.
signed long renderedImageLeft
 contains the left hand corner of the attached image after pixel data have been rendered.
signed long renderedImageBottom
 contains the bottom hand corner of the attached image after pixel data have been rendered.
signed long renderedImageRight
 contains the right hand corner of the attached image after pixel data have been rendered.
char * currentImageSOPClassUID
 contains the SOP Class UID of the attached image
char * currentImageSOPInstanceUID
 contains the SOP Instance UID of the attached image
unsigned long currentImageSelectedFrame
 contains the current selected frame number of the attached image.
OFBool currentImageOwned
 a flag describing whether the presentation state is owner of the DICOM dataset in currentImageDataset/currentImageFileformat.
OFBool currentImageVOIValid
 a flag describing whether the VOI settings in currentImage match the ones in the presentation state.
OFBool currentImagePLUTValid
 a flag describing whether the presentation LUT settings in currentImage match the ones in the presentation state.
OFBool currentImageFlip
 a flag describing whether currentImage has been flipped
DVPSRotationType currentImageRotation
 a flag describing the current rotation angle of currentImage
int currentImageOverlaysValid
 a flag describing whether the Overlay settings in currentImage match the ones in the presentation state.
DVPSCurve_PList currentImageCurveList
 list of curves of the currently attached image
DVPSVOILUT_PList currentImageVOILUTList
 list of VOI LUTs of the currently attached image
DVPSVOIWindow_PList currentImageVOIWindowList
 list of VOI Windows of the currently attached image
DcmCodeString currentImageModality
 modality of currently attached image (if any)
OFBool currentImageMonochrome1
 true if attached image is MONOCHROME1
DVPSDisplayTransform displayTransform
 flag indicating the currently selected display transform DVPSD_none if switched off
OFBool imageInverse
 a flag describing whether current image is inverse
DiDisplayFunction ** displayFunction
 reference to list of display functions if existing
unsigned long minimumPrintBitmapWidth
 minimum width of print bitmap (used for implicit scaling)
unsigned long minimumPrintBitmapHeight
 minimum height of print bitmap (used for implicit scaling)
unsigned long maximumPrintBitmapWidth
 maximum width of print bitmap (used for implicit scaling)
unsigned long maximumPrintBitmapHeight
 maximum height of print bitmap (used for implicit scaling)
unsigned long maximumPreviewImageWidth
 maximum width of (optional) preview image
unsigned long maximumPreviewImageHeight
 maximum height of (optional) preview image

Detailed Description

a Grayscale Softcopy Presentation State.

This class manages the data structures comprising a Presentation State object. Presentation states can be created, read, written, and modified.

Definition at line 47 of file dvpstat.h.


Constructor & Destructor Documentation

DVPresentationState::DVPresentationState DiDisplayFunction **  dispFunction = NULL,
unsigned long  minPrintBitmapX = 0,
unsigned long  minPrintBitmapY = 0,
unsigned long  maxPrintBitmapX = 0,
unsigned long  maxPrintBitmapY = 0,
unsigned long  maxPreviewImageX = 0,
unsigned long  maxPreviewImageY = 0
 

default constructor

Parameters:
displayFunction list of objects describing the display characteristics of the monitor. Used to implement the standard display function. The parameter should be an array with DVPSD_max entries (see DVInterface). If absent, no display transform is performed.
minPrintBitmapX default value for minimum print bitmap size X
minPrintBitmapY default value for minimum print bitmap size Y
maxPrintBitmapX default value for maximum print bitmap size X
maxPrintBitmapY default value for maximum print bitmap size Y
maxPreviewImageX default value for maximum preview image size X
maxPreviewImageY default value for maximum preview image size Y


Member Function Documentation

OFCondition DVPresentationState::activateOverlayAsBitmapShutter size_t  idx  ) 
 

activates an overlay as bitmap shutter.

The overlay must not be activated on a graphic layer (i.e. getOverlayInPresentationStateActivationLayer(idx) != DVPS_IDX_NONE, otherwise this method fails.

Parameters:
idx index of the overlay, must be < getNumberOfOverlaysInPresentationState().
Returns:
EC_Normal upon success, an error code otherwise.

static OFCondition DVPresentationState::activateOverlayHelper DVPSOverlay ovl,
DicomImage image,
OFBool  asShutter = OFFalse,
Uint16  pvalue = 0
[static, private]
 

helper method that activates the given overlay in the given image

Parameters:
ovl overlay to activate
image image to be rendered
asShutter true if overlay should be used as bitmap shutter
pvalue pvalue for overlay foreground
Returns:
EC_Normal if successful, an error code otherwise

OFCondition DVPresentationState::activateOverlayInImage size_t  layer,
size_t  idx
 

activates the given overlay from the attached image on the given graphic layer.

If the overlay is already activated (i.e. getOverlayInImageActivationLayer(idx) != DVPS_IDX_NONE) this method fails.

Parameters:
layer index of the graphic layer, must be < getNumberOfGraphicLayers()
idx index of the overlay, must be < getNumberOfOverlaysInImage().
Returns:
EC_Normal upon success, an error code otherwise.

OFCondition DVPresentationState::activateOverlayInPresentationState size_t  layer,
size_t  idx
 

activates the given overlay from the presentation state on the given graphic layer.

If the overlay is already activated or used as a bitmap overlay (i.e. getOverlayInPresentationStateActivationLayer(idx) != DVPS_IDX_NONE or overlayIsBitmapShutter(idx) == OFTrue) this method fails.

Parameters:
layer index of the graphic layer, must be < getNumberOfGraphicLayers()
idx index of the overlay, must be < getNumberOfOverlaysInPresentationState().
Returns:
EC_Normal upon success, an error code otherwise.

OFBool DVPresentationState::activeOverlayIsROI size_t  layer,
size_t  idx
 

checks whether the given activated overlay is a ROI (region of interest) overlay.

Parameters:
layer index of the graphic layer, must be < getNumberOfGraphicLayers()
idx index of the overlay, must be < getNumberOfActiveOverlays().
Returns:
OFTrue if overlay exists and is ROI, OFFalse otherwise.

OFCondition DVPresentationState::addCurve size_t  layer,
size_t  curveidxinimage
 

activates curve in presentation state.

This method adds an activation for the given curve from the attached image to the given graphic layer in the presentation state.

Parameters:
layer index of the graphic layer, must be < getNumberOfGraphicLayers()
curveidxinimage index of the curve in the attached image, must be < getNumberOfCurvesInImage()
Returns:
EC_Normal upon success, an error code otherwise

DVPSGraphicObject* DVPresentationState::addGraphicObject size_t  layer,
DVPSObjectApplicability  applicability = DVPSB_allImages
 

creates a new graphic object on the given layer.

Returns a pointer to the new graphic object. If the creation of the graphic object fails or if the graphic layer does not exist, NULL is returned.

Parameters:
layer index of the graphic layer, must be < getNumberOfGraphicLayers()
applicability defines to which images/frames the new object applies. Default: all images referenced by the presentation state.
Returns:
a pointer to the new graphic object

OFCondition DVPresentationState::addImageReferenceAttached const char *  aetitle = NULL,
const char *  filesetID = NULL,
const char *  filesetUID = NULL
 

adds a reference to the currently attached image to this presentation state.

This method checks if the given image is not yet referenced and if its Study UID and SOP class match for this presentation state and returns an error code otherwise.

Parameters:
aetitle the series retrieveAETitle. Must be a valid DICOM 'AE' value. Default: value absent.
filesetID the series storageMediaFileSetID. Must be a valid DICOM 'SH' value. Default: value absent.
filesetUID the series storageMediaFileSetUID. Must be a valid DICOM UID. Default: value absent.
Returns:
EC_Normal if successful, an error code otherwise.

OFCondition DVPresentationState::addOverlayToPresentationState DcmItem overlayIOD,
Uint16  groupInItem,
Uint16  newGroup = 0
 

adds a new overlay bitmap to the presentation state.

The overlay is read from a DICOM dataset which must contain the attributes required for a graphic or ROI overlay, see class DVPSOverlay. The dataset can be an image or standalone overlay IOD. The overlay data is copied into the presentation state, i.e. the DICOM dataset can be deleted after execution of this method.

Parameters:
overlayIOD the DICOM dataset from which the overlay is to be read the repeating group 0x6000..0x61F (even) of the overlay to be read
newGroup repeating group number 0x6000-0x601F (even) to be used for the overlay in the presentation state. If this optional parameter is omitted, the method attemps to automatically determine a new group number so that no overlay in the attached image is shadowed any more. If this is impossible, a group number so far unused in the presentation state is taken.
Returns:
EC_Normal upon success, an error code otherwise.

OFCondition DVPresentationState::addPolyShutterVertex Sint32  x,
Sint32  y
 

sets polygonal display shutter point.

This method adds a point to the polygonal display shutter, which must already have at least an origin. If the point set with this method is identical to the origin of the shutter, the shutter is activated and a possible bitmap shutter is deactivated. If no shutter display value exists, a default of 0 (black) is set.

Parameters:
x the x component of the shutter origin
y the x component of the shutter origin
Returns:
EC_Normal upon success, an error code otherwise.

DVPSTextObject* DVPresentationState::addTextObject size_t  layer,
DVPSObjectApplicability  applicability = DVPSB_allImages
 

creates a new text object on the given layer.

Returns a pointer to the new text object. If the creation of the text object fails or if the graphic layer does not exist, NULL is returned.

Parameters:
layer index of the graphic layer, must be < getNumberOfGraphicLayers()
applicability defines to which images/frames the new object applies. Default: all images referenced by the presentation state.
Returns:
a pointer to the new text object

OFCondition DVPresentationState::attachImage DcmFileFormat fileformat,
OFBool  transferOwnership
 

attaches an image to the presentation state.

If an image is already attached to the presentation state, the old image is detached (and freed if necessary) and the new image is attached. A preview image is created automatically (if values for preview resolution are valid).

Parameters:
fileformat pointer to the DICOM image as DcmFileFormat.
transferOwnership if true, the presentation state assumes ownership of the passed DcmFileFormat, which is freed when a different image is attached or the presentation state is deleted.
Returns:
EC_Normal if successful, an error code otherwise. If an error code is returned, the presentation state has the same state as before the call to this method.

OFCondition DVPresentationState::attachImage DcmDataset dataset,
OFBool  transferOwnership
 

attaches an image to the presentation state.

If an image is already attached to the presentation state, the old image is detached (and freed if necessary) and the new image is attached. A preview image is created automatically (if values for preview resolution are valid).

Parameters:
dataset pointer to the DICOM image as DcmDataset.
transferOwnership if true, the presentation state assumes ownership of the passed DcmDataset, which is freed when a different image is attached or the presentation state is deleted.
Returns:
EC_Normal if successful, an error code otherwise. If an error code is returned, the presentation state has the same state as before the call to this method.

OFBool DVPresentationState::canUseDisplayedAreaTrueSize  ) 
 

checks if "TRUE SIZE" can be used as presentation size mode for the current image and frame (i.e.

pixel spacing is known).

Returns:
OFTrue if TRUE SIZE mode is available, OFFalse otherwise.

OFCondition DVPresentationState::changeOverlayGroupInPresentationState size_t  idx,
Uint16  newGroup = 0
 

changes the repeating group used for an overlay in the presentation state.

Since overlays in the presentation state can shadow overlays in the attached image, execution of this method may change the number of overlays reported in the attached image.

Parameters:
idx index of the overlay, must be < getNumberOfOverlaysInPresentationState().
newGroup new repeating group number 0x6000-0x601F (even). If this optional parameter is omitted, the method attemps to automatically determine a new group number so that no overlay in the attached image is shadowed any more. If this is impossible, the method fails and leaves the overlay repeating group unchanged.
Returns:
EC_Normal upon success, an error code otherwise.

void DVPresentationState::clear  ) 
 

resets the object to initial state.

After this call, the object is in the same state as after creation with the default constructor.

Reimplemented from DcmPresentationState.

Uint16 DVPresentationState::convertPValueToDDL Uint16  pvalue,
unsigned int  bits = 8
 

converts a 16-bit P-Value to an 8-bit DDL value for on-sceen display.

If a display function is set and enabled (see setDisplayTransform()), the DDL is corrected for the nonlinearity of the display, otherwise a simple linear mapping is performed. For 12-bit DDL values (hardcopy) the display function is automatically disabled.

Parameters:
pvalue P-Value 0..0xFFFF
bits number of bits used for the output DDL value (8 = softcopy, 12 = hardcopy)
Returns:
display driving level (DDL), 0..0xFF (8 bit) / 0..0xFFF (12 bit)

OFCondition DVPresentationState::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.

A number of flags specify how curves, overlays, VOI transformations, a display shutter and a presentation LUT shape should be treated when found in the image IOD. If this method returns an error code, the object is in undefined state afterwards.

Parameters:
dset the DICOM dataset containing the image IOD
overlayActivation flag defining how overlays should be handled (copied, activated or ignored). Default: Copy overlays.
voiActivation flag defining how VOI LUTs or VOI window width/center should be handled. Default: Use VOI and prefer VOI LUT from VOI window.
curveActivation flag defining whether curves in the image should be activated. Default: Activate curves.
shutterActivation flag defining whether a shutter (not bitmap shutter) should be copied to the presentation state when found in the image. Default: Copy shutter.
presentationActivation flag defining whether a presentation LUT shape should be copied to the presentation state when found in the image. Default: Copy presentation LUT shape.
layering flag defining how graphic layers should be created for activated overlays and curves. Default: Create one layer for all overlays and another layer for all curves.
aetitle the series retrieveAETitle. Must be a valid DICOM 'AE' value. Default: value absent.
filesetID the series storageMediaFileSetID. Must be a valid DICOM 'SH' value. Default: value absent.
filesetUID the series storageMediaFileSetUID. Must be a valid DICOM UID. Default: value absent.
Returns:
EC_Normal upon success, an error code otherwise.

Reimplemented from DcmPresentationState.

OFCondition DVPresentationState::createPreviewImage unsigned long  maxWidth,
unsigned long  maxHeight,
OFBool  clipMode