DCMTK  Version 3.6.1 20170228
OFFIS DICOM Toolkit
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DVPSDisplayedArea Class Reference

an item of the displayed area selection sequence in a presentation state. More...

Public Member Functions

 DVPSDisplayedArea ()
 default constructor
 
 DVPSDisplayedArea (const DVPSDisplayedArea &copy)
 copy constructor
 
DVPSDisplayedAreaclone ()
 clone method. More...
 
virtual ~DVPSDisplayedArea ()
 destructor
 
OFCondition read (DcmItem &dset)
 reads an displayed area selection from a DICOM dataset. More...
 
OFCondition write (DcmItem &dset)
 writes the displayed area selection managed by this object to a DICOM dataset. More...
 
OFBool isApplicable (const char *instanceUID, unsigned long frame)
 checks if this displayed area is applicable to the given image and frame. More...
 
OFBool matchesApplicability (const char *instanceUID, unsigned long frame, DVPSObjectApplicability applicability)
 checks if this displayed area matches exactly the applicability defined by the instanceUID, frame and applicability parameters. More...
 
DVPSPresentationSizeMode getPresentationSizeMode ()
 gets the presentation size mode for this displayed area selection. More...
 
double getPresentationPixelAspectRatio ()
 gets the presentation pixel aspect ratio for this displayed area selection. More...
 
void getDisplayedArea (Sint32 &tlhcX, Sint32 &tlhcY, Sint32 &brhcX, Sint32 &brhcY)
 gets the displayed area top lefthand corner and bottom righthand corner. More...
 
OFCondition getPresentationPixelSpacing (double &x, double &y)
 gets the presentation pixel spacing for this displayed area if present. More...
 
OFCondition getPresentationPixelMagnificationRatio (double &magnification)
 gets the presentation pixel magnification ratio for this displayed area if present. More...
 
OFCondition addImageReference (const char *sopclassUID, const char *instanceUID, unsigned long frame, DVPSObjectApplicability applicability)
 add a new image reference. More...
 
void removeImageReference (DVPSReferencedSeries_PList &allReferences, const char *instanceUID, unsigned long frame, unsigned long numberOfFrames, DVPSObjectApplicability applicability)
 removes a reference to an image or frame. More...
 
void clearImageReferences ()
 removes all image references for this displayed area.
 
OFBool imageReferencesEmpty ()
 checks if the list of image references for this displayed area is empty. More...
 
OFBool canUseTrueSize ()
 checks if the TRUE SIZE mode is possible, i.e. More...
 
OFCondition setDisplayedAreaPixelSpacing (double spacingX, double spacingY)
 sets the displayed area pixel spacing and removes any pixel aspect ratio setting. More...
 
OFCondition setDisplayedAreaPixelSpacing (const char *spacing)
 sets the displayed area pixel spacing and removes any pixel aspect ratio setting. More...
 
OFCondition setDisplayedAreaPixelAspectRatio (double ratio)
 sets the displayed area pixel spacing and removes any pixel spacing setting. More...
 
OFCondition setDisplayedAreaPixelAspectRatio (const char *ratio)
 sets the displayed area pixel spacing and removes any pixel spacing setting. More...
 
OFCondition setDisplayedArea (DVPSPresentationSizeMode sizeMode, Sint32 tlhcX, Sint32 tlhcY, Sint32 brhcX, Sint32 brhcY, double magnification=1.0)
 sets the displayed area and size mode. More...
 
void rotateAndFlip (DVPSRotationType rotationFrom, OFBool isFlippedFrom, DVPSRotationType rotationTo, OFBool isFlippedTo)
 adjusts the displayed area coordinates for the rotation and flipping status of the image. More...
 

Private Member Functions

DVPSDisplayedAreaoperator= (const DVPSDisplayedArea &source)
 undefined private assignment operator
 
void switchHorizontalCorners ()
 swaps the horizontal (X) components of TLHC and BRHC
 
void switchVerticalCorners ()
 swaps the vertical (Y) components of TLHC and BRHC
 
void rotateAndFlipFromOrTo (DVPSRotationType rotation, OFBool isFlipped)
 adjusts the displayed area coordinates for rotation and flipping. More...
 

Private Attributes

DVPSReferencedImage_PList referencedImageList
 ReferencedImageSequence, Type 1c.
 
DcmSignedLong displayedAreaTopLeftHandCorner
 VR=SL, VM=2, Type 1.
 
DcmSignedLong displayedAreaBottomRightHandCorner
 VR=SL, VM=2, Type 1.
 
DcmCodeString presentationSizeMode
 VR=CS, VM=1, Type 1.
 
DcmDecimalString presentationPixelSpacing
 VR=DS, VM=2, Type 1c (required if presentationSizeMode is "TRUE SIZE")
 
DcmIntegerString presentationPixelAspectRatio
 VR=IS, VM=2, Type 1c (required if presentationPixelSpacing is absent)
 
DcmFloatingPointSingle presentationPixelMagnificationRatio
 VR=FL, VM=1, Type 1c (required if presentationSizeMode is "MAGNIFY")
 

Detailed Description

an item of the displayed area selection sequence in a presentation state.

Member Function Documentation

OFCondition DVPSDisplayedArea::addImageReference ( const char *  sopclassUID,
const char *  instanceUID,
unsigned long  frame,
DVPSObjectApplicability  applicability 
)

add a new image reference.

Checks if the referenced SOP instance UID already exists in this sequence. If it exists, an error code is returned. Otherwise a new image reference is created and added to the ReferencedImageSequence.

Parameters
sopclassUIDthe SOP class UID of the image reference to be added.
instanceUIDthe SOP instance UID of the image reference to be added.
framethe frame number of the image reference (current image) to be added.
applicabilitythe applicability of the image reference (DVPSB_currentFrame or DVPSB_currentImage)
Returns
EC_Normal if successful, an error code otherwise.
OFBool DVPSDisplayedArea::canUseTrueSize ( )

checks if the TRUE SIZE mode is possible, i.e.

if pixel spacing is known.

Returns
OFTrue if TRUE SIZE mode is available, OFFalse otherwise.
DVPSDisplayedArea* DVPSDisplayedArea::clone ( )
inline

clone method.

Returns
a pointer to a new DVPSDisplayedArea object containing a copy of this object.
void DVPSDisplayedArea::getDisplayedArea ( Sint32 &  tlhcX,
Sint32 &  tlhcY,
Sint32 &  brhcX,
Sint32 &  brhcY 
)

gets the displayed area top lefthand corner and bottom righthand corner.

Parameters
tlhcXthe displayed area top lefthand corner X value is returned in this parameter
tlhcYthe displayed area top lefthand corner Y value is returned in this parameter
brhcXthe displayed area bottom righthand corner X value is returned in this parameter
brhcYthe displayed area bottom righthand corner Y value is returned in this parameter
double DVPSDisplayedArea::getPresentationPixelAspectRatio ( )

gets the presentation pixel aspect ratio for this displayed area selection.

Pixel aspect ratio is defined here as the width of a pixel divided by the height of a pixel (x/y).

Returns
pixel aspect ratio
OFCondition DVPSDisplayedArea::getPresentationPixelMagnificationRatio ( double &  magnification)

gets the presentation pixel magnification ratio for this displayed area if present.

Parameters
magnificationthe magnification ratio is returned in this parameter upon success
Returns
EC_Normal if successful, an error code if no magnification ratio is available.
OFCondition DVPSDisplayedArea::getPresentationPixelSpacing ( double &  x,
double &  y 
)

gets the presentation pixel spacing for this displayed area if present.

Parameters
xthe horizontal pixel spacing (mm) is returned in this parameter upon success
ythe 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.
DVPSPresentationSizeMode DVPSDisplayedArea::getPresentationSizeMode ( )

gets the presentation size mode for this displayed area selection.

Returns
presentation size mode
OFBool DVPSDisplayedArea::imageReferencesEmpty ( )
inline

checks if the list of image references for this displayed area is empty.

Returns
OFTrue if list of image references is empty, OFFalse otherwise.
OFBool DVPSDisplayedArea::isApplicable ( const char *  instanceUID,
unsigned long  frame 
)

checks if this displayed area is applicable to the given image and frame.

Parameters
instanceUIDSOP instance UID of the current image
framenumber of the current frame
Returns
OFTrue if applicable.
OFBool DVPSDisplayedArea::matchesApplicability ( const char *  instanceUID,
unsigned long  frame,
DVPSObjectApplicability  applicability 
)

checks if this displayed area matches exactly the applicability defined by the instanceUID, frame and applicability parameters.

Parameters
instanceUIDSOP instance UID of the current image
framenumber of the current frame
Returns
OFTrue if matching.
OFCondition DVPSDisplayedArea::read ( DcmItem dset)

reads an displayed area selection from a DICOM dataset.

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

Parameters
dsetthe item of the DisplayedAreaSelectionSequence from which the data is to be read
Returns
EC_Normal if successful, an error code otherwise.
void DVPSDisplayedArea::removeImageReference ( DVPSReferencedSeries_PList allReferences,
const char *  instanceUID,
unsigned long  frame,
unsigned long  numberOfFrames,
DVPSObjectApplicability  applicability 
)

removes a reference to an image or frame.

If the current reference is empty ("global"), an explicit list of references is constructed from the list of series/instance references. The image or frame reference is removed from the total list of references in this object. If the only reference contained in this object is removed, the reference list becomes empty which means that the current reference becomes "global". This case must be handled by the caller.

Parameters
allReferenceslist of series/instance references registered for the presentation state.
instanceUIDSOP instance UID of the current image
framenumber of the current frame
numberOfFramesthe number of frames of the current image
applicabilitythe applicability of the image reference to be removed (DVPSB_currentFrame or DVPSB_currentImage)
void DVPSDisplayedArea::rotateAndFlip ( DVPSRotationType  rotationFrom,
OFBool  isFlippedFrom,
DVPSRotationType  rotationTo,
OFBool  isFlippedTo 
)

adjusts the displayed area coordinates for the rotation and flipping status of the image.

Parameters
rotationFromprevious rotation
isFlippedFromprevious flip status
rotationTonew rotation
isFlippedTonew flip status
void DVPSDisplayedArea::rotateAndFlipFromOrTo ( DVPSRotationType  rotation,
OFBool  isFlipped 
)
private

adjusts the displayed area coordinates for rotation and flipping.

This method can either be used to adjust from unrotated/unflipped to a rotated/flipped status or back from this status to original.

Parameters
rotationrotation
isFlippedflip status
OFCondition DVPSDisplayedArea::setDisplayedArea ( DVPSPresentationSizeMode  sizeMode,
Sint32  tlhcX,
Sint32  tlhcY,
Sint32  brhcX,
Sint32  brhcY,
double  magnification = 1.0 
)

sets the displayed area and size mode.

Parameters
sizeModepresentation size mode.
tlhcXdisplayed area top lefthand corner X
tlhcYdisplayed area top lefthand corner Y
brhcXdisplayed area bottom righthand corner X
brhcYdisplayed area bottom righthand corner Y
magnificationmagnification factor - ignored unless sizeMode==DVPSD_magnify.
Returns
EC_Normal if successful, an error code otherwise.
OFCondition DVPSDisplayedArea::setDisplayedAreaPixelAspectRatio ( double  ratio)

sets the displayed area pixel spacing and removes any pixel spacing setting.

Pixel aspect ratio is defined here as the width of a pixel divided by the height of a pixel (x/y).

Parameters
ratiopixel aspect ratio
Returns
EC_Normal if successful, an error code otherwise.
OFCondition DVPSDisplayedArea::setDisplayedAreaPixelAspectRatio ( const char *  ratio)

sets the displayed area pixel spacing and removes any pixel spacing setting.

Parameters
ratiopixel aspect ratio in DICOM IS format.
Returns
EC_Normal if successful, an error code otherwise.
OFCondition DVPSDisplayedArea::setDisplayedAreaPixelSpacing ( double  spacingX,
double  spacingY 
)

sets the displayed area pixel spacing and removes any pixel aspect ratio setting.

Parameters
spacingXhorizontal pixel spacing in mm
spacingYvertical pixel spacing in mm
Returns
EC_Normal if successful, an error code otherwise.
OFCondition DVPSDisplayedArea::setDisplayedAreaPixelSpacing ( const char *  spacing)

sets the displayed area pixel spacing and removes any pixel aspect ratio setting.

Parameters
spacingvertical/horizontal spacing in DICOM DS format.
Returns
EC_Normal if successful, an error code otherwise.
OFCondition DVPSDisplayedArea::write ( DcmItem dset)

writes the displayed area selection managed by this object to a DICOM dataset.

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

Parameters
dsetthe the item of the DisplayedAreaSelectionSequence to which the data is written
Returns
EC_Normal if successful, an error code otherwise.

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


Generated on Tue Feb 28 2017 for DCMTK Version 3.6.1 20170228 by Doxygen 1.8.8