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.

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 43 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:
dispFunction 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

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.

OFCondition DVPresentationState::read ( DcmItem dset  ) 

reads a presentation state from a DICOM dataset.

The DICOM elements of the presentation state are copied from the dataset to this object. The completeness and correctness of the presentation state (presence of all required elements, value multiplicity) is checked. If this method returns an error code, the object is in undefined state afterwards.

Parameters:
dset the dataset from which the presentation state is to be read
Returns:
EC_Normal if successful, an error code otherwise.

Reimplemented from DcmPresentationState.

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::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::removeImageReferenceAttached (  ) 

removes a reference to the currently attached image from this presentation state.

Returns:
EC_Normal if successful, an error code otherwise.

OFCondition DVPresentationState::setCurrentPresentationLUT ( DVPSPresentationLUTType  newType  ) 

sets the current Presentation LUT type.

DVPSP_table can only be used if the presentation state contains a lookup table, i.e. if havePresentationLookupTable() returns OFTrue.

Parameters:
newType the new presentation LUT type.
Returns:
EC_Normal if successful, an error code otherwise.

OFCondition DVPresentationState::setDefaultPresentationLUTShape (  ) 

resets the Presentation LUT to the default LUT shape which is DVPSP_identity for MONOCHROME2 images and DVPSP_inverse for MONOCHROME1.

DVPSP_table can only be used if the presentation state contains a lookup table, i.e. if havePresentationLookupTable() returns OFTrue.

Returns:
EC_Normal if successful, an error code otherwise.

OFCondition DVPresentationState::setPresentationLookupTable ( DcmUnsignedShort lutDescriptor,
DcmUnsignedShort lutData,
DcmLongString lutExplanation 
)

stores a presentation lookup table in the presentation state.

This method stores a presentation lookup table in the presentation state and activates it. The LUT is copied to the presentation state. If the method returns EC_Normal, any old presentation LUT in the presentation state is overwritten. This method keeps the inverse/not inverse status intact, i.e. inverses the LUT if necessary.

Parameters:
lutDescriptor the LUT Descriptor in DICOM format (VM=3)
lutData the LUT Data in DICOM format
lutExplanation the LUT Explanation in DICOM format, may be empty.
Returns:
EC_Normal if successful, an error code otherwise.

OFCondition DVPresentationState::setPresentationLookupTable ( DcmItem dset  ) 

stores a presentation lookup table in the presentation state.

This method stores a presentation lookup table in the presentation state and activates it. The LUT is copied to the presentation state. Overwrites old LUT. If unsuccessful, LUT is set to DVPSP_identity. This method keeps the inverse/not inverse status intact, i.e. inverses the LUT if necessary.

Parameters:
dset dataset from which the Presentation LUT SQ or Shape is read.
Returns:
EC_Normal if successful, an error code otherwise.

OFCondition DVPresentationState::writePresentationLUTforPrint ( DcmItem dset  ) 

writes the current Presentation LUT to a DICOM dataset.

Copies of the DICOM element managed by this object are inserted into the DICOM dataset. In the case of a MONOCHROME1 image an inverted LUT is written to dataset because the print bitmap is always MONOCHROME2.

Parameters:
dset the dataset to which the Presentation LUT SQ/Shape is written
Returns:
EC_Normal if successful, an error code otherwise.

OFBool DVPresentationState::isMonochrome1Image (  )  [inline]

checks whether the attached image is MONOCHROME1.

In this case, the presentation LUT must be reversed when applied to the print bitmap which is always MONOCHROME2.

Returns:
OFTrue if attached image is MONOCHROME1, OFFalse otherwise.

Definition at line 203 of file dvpstat.h.

References currentImageMonochrome1.

OFBool DVPresentationState::haveActiveVOIWindow (  ) 

check if a VOI window is currently active

Returns:
OFTrue if a VOI window is active

OFBool DVPresentationState::haveActiveVOILUT (  ) 

check if a VOI LUT is currently active

Returns:
OFTrue if a VOI LUT is active

const char* DVPresentationState::getCurrentVOIDescription (  ) 

returns a description string for a currently active VOI transform.

If no description is available, NULL is returned.

Returns:
a pointer to a string or NULL.

OFCondition DVPresentationState::getCurrentWindowWidth ( double &  w  ) 

gets the width of the current VOI window.

May only be called if haveActiveVOIWindow() is OFTrue.

Parameters:
w the window width is returned in this parameter
Returns:
EC_Normal upon success, an error code otherwise.

OFCondition DVPresentationState::getCurrentWindowCenter ( double &  c  ) 

get the center of the current VOI window.

May only be called if haveActiveVOIWindow() is OFTrue.

Parameters:
c the window center is returned in this parameter
Returns:
EC_Normal upon success, an error code otherwise.

const char* DVPresentationState::getDescriptionOfVOILUTsInImage ( size_t  idx  ) 

returns a description string for the given VOI LUT in the attached image.

If no description for the given index is available, NULL is returned.

Parameters:
idx index, must be < getNumberOfVOILUTsInImage()
Returns:
a pointer to a string or NULL.

const char* DVPresentationState::getDescriptionOfVOIWindowsInImage ( size_t  idx  ) 

returns a description string for the given VOI Window in the attached image.

If no description for the given index is available, NULL is returned.

Parameters:
idx index, must be < getNumberOfVOIWindowsInImage()
Returns:
a pointer to a string or NULL.

OFCondition DVPresentationState::setVOILUTFromImage ( size_t  idx,
DVPSObjectApplicability  applicability = DVPSB_currentImage 
)

activates one of the VOI LUTs from the attached image.

The applicability of the activation is controlled by the applicability parameter.

Parameters:
idx index of the VOI transform, must be < getNumberOfVOILUTsInImage().
applicability defines the applicability of the new VOI transform.
Returns:
EC_Normal upon success, an error code otherwise.

OFCondition DVPresentationState::setVOIWindowFromImage ( size_t  idx,
DVPSObjectApplicability  applicability = DVPSB_currentImage 
)

activates one of the VOI Windows from the attached image.

The applicability of the activation is controlled by the applicability parameter.

Parameters:
idx index of the VOI transform, must be < getNumberOfVOIWindowsInImage().
applicability defines the applicability of the new VOI transform.
Returns:
EC_Normal upon success, an error code otherwise.

OFCondition DVPresentationState::setVOIWindow ( double  wCenter,
double  wWidth,
const char *  description = NULL,
DVPSObjectApplicability  applicability = DVPSB_currentImage 
)

sets a user defined VOI window center and width.

The applicability of the VOI window is controlled by the applicability parameter.

Parameters:
wCenter the window center
wWidth the window width
description an optional description. Default: absent.
applicability defines the applicability of the new VOI transform.
Returns:
EC_Normal upon success, an error code otherwise.

OFCondition DVPresentationState::setVOILUT ( DcmUnsignedShort lutDescriptor,
DcmUnsignedShort lutData,
DcmLongString lutExplanation,
DVPSObjectApplicability  applicability = DVPSB_currentImage 
)

stores a VOI lookup table in the presentation state.

This method stores a VOI lookup table in the presentation state and activates it. The LUT is copied to the presentation state. If the method returns an error code, an old LUT is left unchanged. The applicability of the VOI LUT is controlled by the applicability parameter.

Parameters:
lutDescriptor the LUT Descriptor in DICOM format (VM=3)
lutData the LUT Data in DICOM format
lutExplanation the LUT Explanation in DICOM format, may be empty.
applicability defines the applicability of the new VOI transform.
Returns:
EC_Normal if successful, an error code otherwise.

void DVPresentationState::deactivateVOI ( DVPSObjectApplicability  applicability = DVPSB_currentImage  ) 

deactivates the current VOI transformation.

The applicability of the deactivation is controlled by the applicability parameter. After a call to this method, no VOI transform is active for the current image and frame.

Parameters:
applicability defines the applicability of the new VOI transform.

OFCondition DVPresentationState::setGammaVOILUT ( double  gammaValue,
DVPSObjectApplicability  applicability = DVPSB_currentImage 
)

stores VOI lookup table with a gamma curve shape in the presentation state.

If a VOI window is currently active the center and width values are used to specify the number of LUT entries and the first value mapped, otherwise the full pixel range is used. The output range of the LUT is always 16 bit (data is stored as OW). This method stores a VOI lookup table in the presentation state and activates it. The LUT is copied to the presentation state. If the method returns an error code, an old LUT is left unchanged. The applicability of the VOI LUT is controlled by the applicability parameter.

Parameters:
gammaValue gamma value used to create the VOI LUT data
applicability defines the applicability of the new VOI transform.
Returns:
EC_Normal if successful, an error code otherwise.

DVPSPresentationSizeMode DVPresentationState::getDisplayedAreaPresentationSizeMode (  ) 

gets the presentation size mode for the current image and frame.

This method may only be called when an image is attached to the presentation state.

Returns:
presentation size mode

double DVPresentationState::getDisplayedAreaPresentationPixelAspectRatio (  ) 

gets the presentation pixel aspect ratio for for the current image and frame.

Pixel aspect ratio is defined here as the width of a pixel divided by the height of a pixel (x/y). This method may only be called when an image is attached to the presentation state.

Returns:
pixel aspect ratio

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

This method may only be called when an image is attached to the presentation state.

Parameters:
tlhcX the displayed area top lefthand corner X value is returned in this parameter
tlhcY the displayed area top lefthand corner Y value is returned in this parameter
brhcX the displayed area bottom righthand corner X value is returned in this parameter
brhcY the displayed area bottom righthand corner Y value is returned in this parameter
Returns:
EC_Normal if successful, an error code otherwise.

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

Parameters:
tlhcX the displayed area top lefthand corner X value is returned in this parameter
tlhcY the displayed area top lefthand corner Y value is returned in this parameter
brhcX the displayed area bottom righthand corner X value is returned in this parameter
brhcY the displayed area bottom righthand corner Y value is returned in this parameter
Returns:
EC_Normal if successful, an error code otherwise.

OFCondition DVPresentationState::getDisplayedAreaPresentationPixelSpacing ( double &  x,
double &  y 
)

gets the presentation pixel spacing for the current image and frame if it is known.

Parameters:
x the horizontal pixel spacing (mm) is returned in this parameter upon success
y the vertical pixel spacing (mm) is returned in this parameter upon success
Returns:
EC_Normal if successful, an error code if no presentation pixel spacing is available.

OFCondition DVPresentationState::getDisplayedAreaPresentationPixelMagnificationRatio ( double &  magnification  ) 

gets the presentation pixel magnification ratio for the current image and frame if it is present.

Parameters:
magnification the magnification ratio is returned in this parameter upon success
Returns:
EC_Normal if successful, an error code if no magnification ratio is available.

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::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).

Parameters:
sizeMode presentation size mode.
tlhcX displayed area top lefthand corner X
tlhcY displayed area top lefthand corner Y
brhcX displayed area bottom righthand corner X
brhcY displayed area bottom righthand corner Y
magnification magnification factor - ignored unless sizeMode==DVPSD_magnify.
applicability defines the applicability of the new displayed area definition. Possible choices are: DVPSB_currentFrame - current frame only, DVPSB_currentImage - all frames of current image (default), and DVPSB_allImages - all images referenced by this presentation state. The last choice should be used with care because it will also cause the pixel spacing or pixel aspect ratio of the current image to be applied to all images referenced by the presentation state.
Returns:
EC_Normal if successful, an error code otherwise.

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

Treats the image as if it was neither rotated nor flipped.

Parameters:
sizeMode presentation size mode.
tlhcX displayed area top lefthand corner X
tlhcY displayed area top lefthand corner Y
brhcX displayed area bottom righthand corner X
brhcY displayed area bottom righthand corner Y
magnification magnification factor - ignored unless sizeMode==DVPSD_magnify.
applicability defines the applicability of the new displayed area definition. Possible choices are: DVPSB_currentFrame - current frame only, DVPSB_currentImage - all frames of current image (default), and DVPSB_allImages - all images referenced by this presentation state. The last choice should be used with care because it will also cause the pixel spacing or pixel aspect ratio of the current image to be applied to all images referenced by the presentation state.
Returns:
EC_Normal if successful, an error code otherwise.

void DVPresentationState::removeShutter ( DVPSShutterType  type  ) 

deactivates display shutter of given type.

After a call to this method haveShutter(type) will return OFFalse.

Parameters:
type the shutter type

OFCondition DVPresentationState::setRectShutter ( Sint32  lv,
Sint32  rv,
Sint32  uh,
Sint32  lh 
)

sets and activates rectangular display shutter.

If a bitmap shutter is exists, it is deactivated if this method returns successfully. If no shutter display value exists, a default of 0 (black) is set.

Parameters:
lv the left vertical edge
rv the right vertical edge
uh the upper horizontal edge
lh the lower horizontal edge
Returns:
EC_Normal upon success, an error code otherwise.

OFCondition DVPresentationState::setCircularShutter ( Sint32  centerX,
Sint32  centerY,
Sint32  radius 
)

sets and activates circular display shutter.

If a bitmap shutter is exists, it is deactivated if this method returns successfully. If no shutter display value exists, a default of 0 (black) is set.

Parameters:
centerX the X component of the shutter center
centerY the Y component of the shutter center
radius the (horizontal) radius of the shutter
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.

OFCondition DVPresentationState::removeGraphicLayer ( size_t  idx  ) 

removes and deletes a graphic layer.

All text, graphic, curve and overlay objects on this graphic layer are also deleted or deactivated, respectively.

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

size_t DVPresentationState::getNumberOfTextObjects ( size_t  layer  ) 

returns the number of text objects for the given graphic layer.

Only the objects that are applicable to the current (attached) image and the selected frame number are used by this method.

Parameters:
layer index of the graphic layer, must be < getNumberOfGraphicLayers()
Returns:
number of text objects

DVPSTextObject* DVPresentationState::getTextObject ( size_t  layer,
size_t  idx 
)

gets the text object with the given index on the given layer.

If the text object or the graphic layer does not exist, NULL is returned. Only the objects that are applicable to the current (attached) image and the selected frame number are used by this method.

Parameters:
layer index of the graphic layer, must be < getNumberOfGraphicLayers()
idx index of the text object, must be < getNumberOfTextObjects(layer)
Returns:
a pointer to the text object

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::removeTextObject ( size_t  layer,
size_t  idx 
)

deletes the text object with the given index on the given layer.

Only the objects that are applicable to the current (attached) image and the selected frame number are used by this method.

Parameters:
layer index of the graphic layer, must be < getNumberOfGraphicLayers()
idx index of the text object, must be < getNumberOfTextObjects(layer)
Returns:
EC_Normal upon success, an error code otherwise

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

Only the objects that are applicable to the current (attached) image and the selected frame number are used by this method.

Parameters:
old_layer index of the graphic layer on which the text object is, must be < getNumberOfGraphicLayers()
idx index of the text object, must be < getNumberOfTextObjects(layer)
new_layer index of the graphic layer to which the text object is moved, must be < getNumberOfGraphicLayers()
applicability defines to which images/frames the new object applies from now on. Default: all images referenced by the presentation state.
Returns:
EC_Normal upon success, an error code otherwise

size_t DVPresentationState::getNumberOfGraphicObjects ( size_t  layer  ) 

returns the number of graphic objects for the given graphic layer.

Only the objects that are applicable to the current (attached) image and the selected frame number are used by this method.

Parameters:
layer index of the graphic layer, must be < getNumberOfGraphicLayers()
Returns:
number of graphic objects

DVPSGraphicObject* DVPresentationState::getGraphicObject ( size_t  layer,
size_t  idx 
)

gets the graphic object with the given index on the given layer.

If the graphic object or the graphic layer does not exist, NULL is returned. Only the objects that are applicable to the current (attached) image and the selected frame number are used by this method.

Parameters:
layer index of the graphic layer, must be < getNumberOfGraphicLayers()
idx index of the graphic object, must be < getNumberOfGraphicObjects(layer)
Returns:
a pointer to the graphic object

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::removeGraphicObject ( size_t  layer,
size_t  idx 
)

deletes the graphic object with the given index on the given layer.

Only the objects that are applicable to the current (attached) image and the selected frame number are used by this method.

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

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

Only the objects that are applicable to the current (attached) image and the selected frame number are used by this method.

Parameters:
old_layer index of the graphic layer on which the graphic object is, must be < getNumberOfGraphicLayers()
idx index of the graphic object, must be < getNumberOfGraphicObjects(layer)
new_layer index of the graphic layer to which the graphic object is moved, must be < getNumberOfGraphicLayers()
applicability defines to which images/frames the new object applies from now on. Default: all images referenced by the presentation state.
Returns:
EC_Normal upon success, an error code otherwise

DVPSCurve* DVPresentationState::getCurve ( size_t  layer,
size_t  idx 
)

gets the curve with the given index on the given layer.

If the curve or the graphic layer does not exist, NULL is returned.

Parameters:
layer index of the graphic layer, must be < getNumberOfGraphicLayers()
idx index of the curve, must be < getNumberOfCurves(layer)
Returns:
a pointer to the curve

size_t DVPresentationState::getNumberOfCurvesInImage (  ) 

returns the number of curves in the attached image that could be activated in the presentation state.

Returns:
number of available curves

DVPSCurve* DVPresentationState::getCurveInImage ( size_t  idx  ) 

gets the curve with the given index from the attached image.

If the curve does not exist, NULL is returned.

Parameters:
idx index of the curve, must be < getNumberOfCurvesInImage()
Returns:
a pointer to the curve

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

const char* DVPresentationState::getActiveOverlayLabel ( size_t  layer,
size_t  idx 
)

gets the overlay label of the given activated overlay.

Parameters:
layer index of the graphic layer, must be < getNumberOfGraphicLayers()
idx index of the overlay, must be < getNumberOfActiveOverlays().
Returns:
label string if it exists, NULL otherwise.

const char* DVPresentationState::getActiveOverlayDescription ( size_t  layer,
size_t  idx 
)

gets the overlay description of the given activated overlay.

Parameters:
layer index of the graphic layer, must be < getNumberOfGraphicLayers()
idx index of the overlay, must be < getNumberOfActiveOverlays().
Returns:
description string if it exists, NULL 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::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.

Parameters:
layer index of the graphic layer on which this overlay is activated, must be < getNumberOfGraphicLayers().
idx index of the overlay activation on the given layer, must be < getNumberOfActiveOverlays(layer).
overlayData upon success a pointer to the overlay plane is passed back in this parameter. The overlay plane is organized as one byte or one word per pixel. The byte/word values are already transformed from pvalues to DDLs.
width upon success the width of the overlay bitmap in pixels is returned in this parameter.
height upon success the height of the overlay bitmap in pixels is returned in this parameter.
left_pos upon success the horizontal position of the overlay relative to the image is returned. 0 means that the overlay is left aligned with the image. Since the overlay is cropped at the borders of the image, values < 0 are impossible.
top_pos upon success the vertical position of the overlay relative to the image is returned.
isROI returns OFTrue if the overlay is ROI, OFFalse if the overlay is Graphic.
fore returns value of foreground color (pvalue), all other values are transparent
bits number of bits used for overlayData (valid: 8 or 12, default: 8). If bits is less than or equal to 8 the resulting overlayData is an array of 8 bit values, an array 16 bit values otherwise.
Returns:
EC_Normal upon success, an error code otherwise.

size_t DVPresentationState::getNumberOfOverlaysInImage (  ) 

gets the number of overlays which are embedded in the image currently attached to the presentation state.

Overlays in the image are counted only if they are not shadowed by overlays that are embedded in the presentation state and use the same repeating group number.

Returns:
number of overlays in attached image

Uint16 DVPresentationState::getOverlayInImageGroup ( size_t  idx  ) 

gets the repeating group number of the given overlay in the attached image.

Parameters:
idx index of the overlay, must be < getNumberOfOverlaysInImage().
Returns:
repeating group number if found, 0 otherwise.

const char* DVPresentationState::getOverlayInImageLabel ( size_t  idx  ) 

gets the overlay label of the given overlay in the attached image.

Parameters:
idx index of the overlay, must be < getNumberOfOverlaysInImage().
Returns:
label string if it exists, NULL otherwise.

const char* DVPresentationState::getOverlayInImageDescription ( size_t  idx  ) 

gets the overlay description of the given overlay in the attached image.

Parameters:
idx index of the overlay, must be < getNumberOfOverlaysInImage().
Returns:
description string if it exists, NULL otherwise.

size_t DVPresentationState::getOverlayInImageActivationLayer ( size_t  idx  ) 

gets the index of the activation layer on which the given overlay from the attached image is activated.

Parameters:
idx index of the overlay, must be < getNumberOfOverlaysInImage().
Returns:
layer index (which is < getNumberOfGraphicLayers()) if overlay exists and is activated, DVPS_IDX_NONE otherwise.

OFBool DVPresentationState::overlayInImageIsROI ( size_t  idx  ) 

checks whether the given overlay in the attached image is a ROI (region of interest) overlay.

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

OFCondition DVPresentationState::removeOverlayFromPresentationState ( size_t  idx  ) 

removes an overlay from the presentation state.

If the overlay is activated, the activation is also removed. 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().
Returns:
EC_Normal upon success, an error code 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.

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
groupInItem 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.

OFBool DVPresentationState::overlayIsSuitableAsBitmapShutter ( size_t  idx  ) 

checks if an overlay from the presentation state is suitable for use as a bitmap shutter.

An overlay is suitable if it is a graphic overlay with the same size as the attached image and with the origin 1. This method does not check wether the overlay is already activated as overlay or bitmap shutter.

Parameters:
idx index of the overlay, must be < getNumberOfOverlaysInPresentationState().
Returns:
OFTrue if overlay can be used as display shutter.

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.

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.

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

Parameters:
layer index of the graphic layer on which this overlay is activated, must be < getNumberOfGraphicLayers().
idx index of the overlay activation on the given layer, must be < getNumberOfActiveOverlays(layer).
Returns:
EC_Normal upon success, an error code otherwise.

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.

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.

void DVPresentationState::detachImage (  ) 

detaches and frees the image (incl.

preview) attached to the presentation state.

OFBool DVPresentationState::isInverse (  ) 

checks whether image is inverse (shape, plut or mono1).

Returns:
OFTrue if image is inverse, OFFalse otherwise.

OFCondition DVPresentationState::invertImage (  ) 

inverts image by changing presentation state LUT or presentation state LUT shape.

Pixel data has to be re-get after this transformation.

Returns:
EC_Normal upon success, an error code otherwise.

OFCondition DVPresentationState::getPixelData ( const void *&  pixelData,
unsigned long &  width,
unsigned long &  height 
)

applies presentation state to attached image and returns image bitmap.

This method sets all parameter required to correctly render the pixel data in the image attached to the presentation state and then creates the required pixel data which contains all grayscale transformations but none of the none-grayscale transformations of the presentation state "burned in" into the pixel data. The pixel data returned is already corrected by a display transform for the current display device and can be mapped directly to digital driving levels of the graphics board. The pointer to the pixel data remains valid until the next call to this function, or until the image is detached or the presentation state is deleted.

Parameters:
pixelData in this parameter a pointer to the pixel data is returned (array of 8 bit values). The storage area allocated for this pointer must not be freed by the caller. If the return value is an error code, no valid pixel data pointer may be assumed.
width returns the width of the bitmap in pixels
height returns the height of the bitmap in pixels
Returns:
EC_Normal upon success, an error code otherwise.

OFCondition DVPresentationState::getPixelData ( void *  pixelData,
unsigned long  size 
)

same as method above apart from the fact that the storage area is handled externally.

Parameters:
pixelData pointer to storage area where the pixel data is copied to (array of 8 bit values). The storage area must be allocated and deleted from the calling method.
size specifies size of the storage area in bytes.
Returns:
EC_Normal upon success, an error code otherwise.

const char* DVPresentationState::getAttachedImageSOPClassUID (  ) 

returns the SOP Class UID of the currently attached image.

Returns:
SOP class UID of current image, NULL if absent

const char* DVPresentationState::getAttachedImageSOPInstanceUID (  ) 

returns the SOP Instance UID of the currently attached image.

Returns:
SOP instance UID of current image, NULL if absent

OFCondition DVPresentationState::getImageWidth ( unsigned long &  width  ) 

gets the width of the attached image.

The rotation status of the presentation state is not taken into account, i.e. the width of an unrotated image is returned. This method may only be called when an image is attached to the presentation state.

Parameters:
width upon success, the image width (pixels) is returned in this parameter.
Returns:
EC_Normal upon success, an error code otherwise

OFCondition DVPresentationState::getImageHeight ( unsigned long &  height  ) 

gets the height of the attached image.

The rotation status of the presentation state is not taken into account, i.e. the height of an unrotated image is returned. This method may only be called when an image is attached to the presentation state.

Parameters:
height upon success, the image height (pixels) is returned in this parameter.
Returns:
EC_Normal upon success, an error code otherwise

unsigned long DVPresentationState::getPrintBitmapSize (  ) 

gets number of bytes used for the print bitmap.

(depends on width, height and depth)

Returns:
number of bytes used for the print bitmap

OFCondition DVPresentationState::setMinimumPrintBitmapWidthHeight ( unsigned long  width,
unsigned long  height 
)

sets the minimum print bitmap width and height.

Smaller images are scaled up by an appropriate integer factor. Both maximum values need to be twice greater than the maximum of the minimum values.

Parameters:
width minimum width of print bitmap (in pixels)
height minimum height of print bitmap (in pixels)
Returns:
EC_Normal upon success, an error code otherwise

OFCondition DVPresentationState::setMaximumPrintBitmapWidthHeight ( unsigned long  width,
unsigned long  height 
)

sets the maximum print bitmap width and height.

Larger images are scaled down by an appropriate integer factor. Both maximum values need to be twice greater than the maximum of the minimum values.

Parameters:
width maximum width of print bitmap (in pixels)
height maximum height of print bitmap (in pixels)
Returns:
EC_Normal upon success, an error code otherwise

OFCondition DVPresentationState::getPrintBitmapWidthHeight ( unsigned long &  width,
unsigned long &  height 
)

gets width and height of print bitmap.

Bitmap size depends on implicit scaling, a heuristic is used for very small images. The return values depend on the current minimum/maximum print bitmap width/height values!

Parameters:
width upon success, the bitmap width (in pixels) is returned in this parameter
height upon success, the bitmap height (in pixels) is returned in this parameter
Returns:
EC_Normal upon success, an error code otherwise

OFCondition DVPresentationState::getPrintBitmapWidth ( unsigned long &  width  ) 

gets width of print bitmap.

Bitmap size depends on implicit scaling, a heuristic is used for very small images. The return value depends on the current minimum/maximum print bitmaps width/height values!

Parameters:
width upon success, the image width (in pixels) is returned in this parameter
Returns:
EC_Normal upon success, an error code otherwise

OFCondition DVPresentationState::getPrintBitmapHeight ( unsigned long &  height  ) 

gets height of print bitmap.

bitmap size depends on implicit scaling, a heuristic is used for very small images The return value depends on the current minimum/maximum print bitmaps width/height values!

Parameters:
height upon success, the image height (in pixels) is returned in this parameter
Returns:
EC_Normal upon success, an error code otherwise

double DVPresentationState::getPrintBitmapPixelAspectRatio (  ) 

gets the presentation pixel aspect ratio for the print bitmap.

Pixel aspect ratio is defined here as the width of a pixel divided by the height of a pixel (x/y). The related image is already rotated and flipped!

Returns:
pixel aspect ratio

OFCondition DVPresentationState::getPrintBitmapRequestedImageSize ( OFString requestedImageSize  ) 

gets requested image size for print bitmap.

If the presentation state mode is DVPSD_trueSize, this method computes the true physical width (in mm) of the print image (under consideration of the rotation status) and writes it to the requestedImageSize string.

Parameters:
requestedImageSize requested image size is written to this parameter upon successful return. Otherwise string is empty upon return.
Returns:
EC_Normal upon success, an error code otherwise

OFCondition DVPresentationState::getPrintBitmap ( void *  bitmap,
unsigned long  size,
OFBool  inversePLUT = OFFalse 
)

writes the bitmap data into the given buffer.

The bitmap has the format: 12 bits stored and 16 bits allocated. This method is used to create the preformatted bitmap where the annotations are later burned in. Implicit scaling is performed if the bitmap is too small (see minimum bitmap size). The storage area must be allocated and deleted from the calling method.

Parameters:
bitmap pointer to storage area where the pixel data is copied to.
size specifies size of the storage area in bytes
inversePLUT render inverse PLUT into bitmap if OFTrue (optional)
Returns:
EC_Normal upon success, an error code otherwise

OFCondition DVPresentationState::createPreviewImage ( unsigned long  maxWidth,
unsigned long  maxHeight,
OFBool  clipMode = OFFalse 
)

creates a new preview image based on the current image and pstate.

The maximum size of this image is specified by the two parameters maxWidth and maxHeight. The actual size should be determined using one of the following appropriate methods (e.g. getPreviewImageWidthHeight) since the original pixel aspect ratio is alsways considered. The preview image includes all grayscale and spatial transformations performed on the current image so far. The method renderPixelData also renders the preview image (if existing). Therefore the preview image is always held consistent with the current image. Overlays, bitmapped shutters and any other annotations are not rendered into the preview image.

Parameters:
maxWidth the maximum width used to create the preview image
maxHeight the maximum height used to create the preview image
clipMode specifies whether to clip the preview image to the displayed area (not implemented!)
Returns:
EC_Normal upon success, an error code otherwise

unsigned long DVPresentationState::getPreviewImageSize (  ) 

gets number of bytes used for the preview image bitmap.

(depends on width and height)

Returns:
number of bytes used for the preview image bitmap

OFCondition DVPresentationState::getPreviewImageWidthHeight ( unsigned long &  width,
unsigned long &  height 
)

gets current width and height of the preview image.

Parameters:
width upon success, the image width (in pixels) is returned in this parameter
height upon success, the image height (in pixels) is returned in this parameter
Returns:
EC_Normal upon success, an error code otherwise

OFCondition DVPresentationState::getPreviewImageWidth ( unsigned long &  width  ) 

gets current width of the preview image.

Parameters:
width upon success, the image width (in pixels) is returned in this parameter
Returns:
EC_Normal upon success, an error code otherwise

OFCondition DVPresentationState::getPreviewImageHeight ( unsigned long &  height  ) 

gets current height of the preview image.

Parameters:
height upon success, the image height (in pixels) is returned in this parameter
Returns:
EC_Normal upon success, an error code otherwise

OFCondition DVPresentationState::getPreviewImageBitmap ( void *  bitmap,
unsigned long  size 
)

writes the bitmap data of the preview image into the given buffer.

The storage area must be allocated and deleted from the calling method.

Parameters:
bitmap pointer to storage area where the pixel data is copied to (array of 8 bit values)
size specifies size of the storage area in bytes
Returns:
EC_Normal upon success, an error code otherwise

OFCondition DVPresentationState::getImageMinMaxPixelRange ( double &  minValue,
double &  maxValue 
)

gets smallest and biggest possible pixel value in the attached image.

These values are defined as the smallest and biggest number that could possibly be contained in the image after application of the Modality transform, but before any VOI, Presentation or display transform. This method may only be called when an image is attached to the presentation state.

Parameters:
minValue upon success, the smallest value is returned in this parameter.
maxValue upon success, the biggest value is returned in this parameter.
Returns:
EC_Normal upon success, an error code otherwise

OFCondition DVPresentationState::getImageMinMaxPixelValue ( double &  minValue,
double &  maxValue 
)

gets smallest and biggest occuring pixel value in the attached image.

These values are defined as the smallest and biggest number that are actually contained in the image after application of the Modality transform, but before any VOI, Presentation or display transform. This method may only be called when an image is attached to the presentation state.

Parameters:
minValue upon success, the smallest value is returned in this parameter.
maxValue upon success, the biggest value is returned in this parameter.
Returns:
EC_Normal upon success, an error code otherwise

OFCondition DVPresentationState::getImageNumberOfFrames ( unsigned long &  frames  ) 

gets the number of frames of the current (attached) image.

This method may only be called when an image is attached to the presentation state.

Parameters:
frames upon success, the number of frames is returned in this parameter.
Returns:
EC_Normal upon success, an error code otherwise

OFCondition DVPresentationState::selectImageFrameNumber ( unsigned long  frame  ) 

selects one frame of a multiframe image.

This affects the image bitmap that is rendered, the overlay bitmaps and the visibility of graphic and text objects. This method may only be called when an image is attached to the presentation state.

Parameters:
frame frame number in the range [1..getImageNumberOfFrames()]
Returns:
EC_Normal upon success, an error code otherwise

unsigned long DVPresentationState::getSelectedImageFrameNumber (  ) 

gets the index of the currently selected frame in a multi-frame image.

Returns:
index of the currently selected frame, 0 if an error occurred

DVPSDisplayTransform DVPresentationState::getDisplayTransform (  )  [inline]

gets the currently selected display transform.

Display transform will only be performed if switched on _and_ a valid monitor characteristics description exists. Default after creation of a presentation state is "on".

Returns:
current display transform if on, DVPSD_none if off.

Definition at line 1111 of file dvpstat.h.

References displayTransform.

void DVPresentationState::setDisplayTransform ( DVPSDisplayTransform  transform  )  [inline]

activates or deactivates display correction.

Display transform will only be performed if switched on _and_ a valid display function object exists.

Parameters:
transform display transform to be set, DVPSD_none to switch off.

Definition at line 1118 of file dvpstat.h.

References displayTransform.

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::writeHardcopyImageAttributes ( DcmItem dset  ) 

writes the patient module attributes and a source image sequence for a grayscale hardcopy image.

Copies of the DICOM elements managed by this object are inserted into the DICOM dataset.

Parameters:
dset the dataset to which the data is written
Returns:
EC_Normal if successful, an error code otherwise.

const char* DVPresentationState::getCurrentImageModality (  ) 

gets the modality of the attached image.

Returns:
modality string if it exists, NULL or empty string otherwise.

Uint16 DVPresentationState::findOverlayGroup ( Uint16  currentGroup = 0  ) 

tries to find an overlay repeating group that is not used in the presentation state or the attached image.

If that does not exist, it returns a group number that is unused in the presentation state but used in the image.

Parameters:
currentGroup the current group number of the overlay to be changed (if any)
Returns:
group number 0x6000..0x601F if found, 0 otherwise.

void DVPresentationState::renderPixelData ( OFBool  display = OFTrue  ) 

prepares pixel data for image and overlays for access.

This method is called internally before any image pixel data or overlay bitmaps is created. It makes sure that the following settings of the presentation state are reflected in the dcmimage-based image processing routines: VOI transformation, Presentation LUT, rotation, flip, overlay activation.

Parameters:
display use current display function if OFTrue, don't use otherwise

DVPSDisplayedArea* DVPresentationState::getDisplayedAreaSelection (  ) 

attempts to find the displayed area selection for the current image and frame.

If not found, creates a default.

Returns:
displayed area selection item. If creation of a default failed or no image is attached to the presentation state, returns NULL.

DVPSSoftcopyVOI* DVPresentationState::getCurrentSoftcopyVOI (  ) 

attempts to find the Softcopy VOI LUT item for the current image and frame.

If not found, returns NULL.

Returns:
softcopy VOI LUT item for current image and frame if found, NULL 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


Member Data Documentation

signed long DVPresentationState::renderedImageLeft [private]

contains the left hand corner of the attached image after pixel data have been rendered.

(the following equation is always true: renderedImageTop <= renderedImageBottom)

Definition at line 1230 of file dvpstat.h.

signed long DVPresentationState::renderedImageBottom [private]

contains the bottom hand corner of the attached image after pixel data have been rendered.

(the following equation is always true: renderedImageLeft <= renderedImageRight)

Definition at line 1234 of file dvpstat.h.

unsigned long DVPresentationState::currentImageSelectedFrame [private]

contains the current selected frame number of the attached image.

Frame numbers are counted from 1 (like in DICOM, unlike dcmimgle).

Definition at line 1247 of file dvpstat.h.

OFBool DVPresentationState::currentImageOwned [private]

a flag describing whether the presentation state is owner of the DICOM dataset in currentImageDataset/currentImageFileformat.

If the presentation state is owner, it will delete the dataset upon its own destruction or attachment of a different image.

Definition at line 1253 of file dvpstat.h.

int DVPresentationState::currentImageOverlaysValid [private]

a flag describing whether the Overlay settings in currentImage match the ones in the presentation state.

values: 0=invalid, 1=invalid, but no external overlay added, 2=valid

Definition at line 1272 of file dvpstat.h.


The documentation for this class was generated from the following file:


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1