DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Public Member Functions | Private Member Functions | Private Attributes | List of all members
DVPSGraphicAnnotation Class Reference

an item of the graphic annotation sequence in a presentation state (internal use only). More...

## Public Member Functions
| DVPSGraphicAnnotation ()
| default constructor
| DVPSGraphicAnnotation (const DVPSGraphicAnnotation &copy)
| copy constructor
DVPSGraphicAnnotation * | clone ()
| clone method. More...
virtual | ~DVPSGraphicAnnotation ()
| destructor
OFCondition | read (DcmItem &dset)
| reads a graphic annotation from a DICOM dataset. More...
OFCondition | write (DcmItem &dset)
| writes the graphic annotation managed by this object to a DICOM dataset. More...
const char * | getAnnotationLayer ()
| get annotation layer name. More...
void | setAnnotationLayer (const char *aLayer)
| set annotation layer name of this annotation. More...
OFCondition | addImageReference (const char *sopclassUID, const char *instanceUID, unsigned long frame, DVPSObjectApplicability applicability)
| add a new image reference. More...
OFBool | isEmpty ()
| checks if this annotation layer is empty. More...
OFBool | isApplicable (const char *instanceUID, unsigned long frame, DVPSObjectApplicability applicability=DVPSB_currentFrame)
| checks if this annotation layer is applicable to the given image and frame. More...
size_t | getNumberOfTextObjects ()
| returns the number of text objects in this annotation. More...
size_t | getNumberOfGraphicObjects ()
| returns the number of graphic objects in this annotation. More...
DVPSTextObject * | getTextObject (size_t idx)
| returns a pointer to the text object with the given index or NULL if it does not exist. More...
DVPSGraphicObject * | getGraphicObject (size_t idx)
| returns a pointer to the graphic object with the given index or NULL if it does not exist. More...
void | addTextObject (DVPSTextObject *text)
| adds the given text object to the list of text objects managed by this object. More...
void | addGraphicObject (DVPSGraphicObject *graphic)
| adds the given graphic object to the list of graphic objects managed by this object. More...
DVPSTextObject * | removeTextObject (size_t idx)
| returns a pointer to the text object with the given index (or NULL if it does not exist) and removes it from the list. More...
DVPSGraphicObject * | removeGraphicObject (size_t idx)
| returns a pointer to the graphic object with the given index (or NULL if it does not exist) and removes it from the list. More...

## Private Member Functions
DVPSGraphicAnnotation & | operator= (const DVPSGraphicAnnotation &)
| private undefined assignment operator

## Private Attributes
DVPSReferencedImage_PList | referencedImageList
| ReferencedImageSequence, Type 1c.
DcmCodeString | graphicAnnotationLayer
| VR=CS, VM=1, Type 1.
DVPSTextObject_PList | textObjectList
| TextObjectSequence, Type 1c.
DVPSGraphicObject_PList | graphicObjectList
| GraphicObjectSequence, Type 1c

## Detailed Description

an item of the graphic annotation sequence in a presentation state (internal use only).

This class manages the data structures comprising one item of the Graphic Annotation Sequence in a Presentation State object.

## Member Function Documentation

## ◆ addGraphicObject()

void DVPSGraphicAnnotation::addGraphicObject | ( | DVPSGraphicObject * | graphic | ) |

adds the given graphic object to the list of graphic objects managed by this object.

Parameters

  graphic | text graphic object to be inserted.

## ◆ addImageReference()

OFCondition DVPSGraphicAnnotation::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

  sopclassUID | the SOP class UID of the image reference to be added.
  instanceUID | the SOP instance UID of the image reference to be added.
  frame | the frame number of the image reference (current image) to be added.
  applicability | the applicability of the image reference (DVPSB_currentFrame or DVPSX_currentImage)

Returns
  EC_Normal if successful, an error code otherwise.

## ◆ addTextObject()

void DVPSGraphicAnnotation::addTextObject | ( | DVPSTextObject * | text | ) |

adds the given text object to the list of text objects managed by this object.

Parameters

  text | text object to be inserted.

## ◆ clone()

DVPSGraphicAnnotation* DVPSGraphicAnnotation::clone | ( |  | ) |
| inline

clone method.

Returns
  a pointer to a new DVPSGraphicAnnotation object containing a deep copy of this object.

## ◆ getAnnotationLayer()

const char* DVPSGraphicAnnotation::getAnnotationLayer | ( |  | ) |

get annotation layer name.

Returns
  a pointer to the annotation layer name

## ◆ getGraphicObject()

DVPSGraphicObject* DVPSGraphicAnnotation::getGraphicObject | ( | size_t | idx | ) |

returns a pointer to the graphic object with the given index or NULL if it does not exist.

Parameters

  idx | index, must be < getNumberOfGraphicObjects()

Returns
  pointer to graphic object or NULL

## ◆ getNumberOfGraphicObjects()

size_t DVPSGraphicAnnotation::getNumberOfGraphicObjects | ( |  | ) |

returns the number of graphic objects in this annotation.

Returns
  number of graphic objects

## ◆ getNumberOfTextObjects()

size_t DVPSGraphicAnnotation::getNumberOfTextObjects | ( |  | ) |

returns the number of text objects in this annotation.

Returns
  number of text objects

## ◆ getTextObject()

DVPSTextObject* DVPSGraphicAnnotation::getTextObject | ( | size_t | idx | ) |

returns a pointer to the text object with the given index or NULL if it does not exist.

Parameters

  idx | index, must be < getNumberOfTextObjects()

Returns
  pointer to text object or NULL

## ◆ isApplicable()

OFBool DVPSGraphicAnnotation::isApplicable | ( | const char * | instanceUID,
|  | unsigned long | frame,
|  | DVPSObjectApplicability | applicability = `DVPSB_currentFrame`
| ) |  |

checks if this annotation layer is applicable to the given image and frame.

Parameters

  instanceUID | SOP instance UID of the current image
  frame | number of the current frame
  applicability | the required (minimum) applicability of the reference. Default: annotation layer applies to the current frame of the current image.

Returns
  OFTrue if applicable.

## ◆ isEmpty()

OFBool DVPSGraphicAnnotation::isEmpty | ( |  | ) |

checks if this annotation layer is empty.

An annotation layer is empty when it contains no text object and no graphic object.

Returns
  OFTrue if empty.

## ◆ read()

OFCondition DVPSGraphicAnnotation::read | ( | DcmItem & | dset | ) |

reads a graphic annotation from a DICOM dataset.

The DICOM elements of the Graphic Annotation 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

  dset | the item of the GraphicAnnotationSequence from which the data is to be read

Returns
  EC_Normal if successful, an error code otherwise.

## ◆ removeGraphicObject()

DVPSGraphicObject* DVPSGraphicAnnotation::removeGraphicObject | ( | size_t | idx | ) |

returns a pointer to the graphic object with the given index (or NULL if it does not exist) and removes it from the list.

Parameters

  idx | index, must be < getNumberOfGraphicObjects()

Returns
  pointer to graphic object or NULL

## ◆ removeTextObject()

DVPSTextObject* DVPSGraphicAnnotation::removeTextObject | ( | size_t | idx | ) |

returns a pointer to the text object with the given index (or NULL if it does not exist) and removes it from the list.

Parameters

  idx | index, must be < getNumberOfTextObjects()

Returns
  pointer to text object or NULL

## ◆ setAnnotationLayer()

void DVPSGraphicAnnotation::setAnnotationLayer | ( | const char * | aLayer | ) |

set annotation layer name of this annotation.

Parameters

  aLayer | a pointer to the annotation layer name, which is copied into this object.

## ◆ write()

OFCondition DVPSGraphicAnnotation::write | ( | DcmItem & | dset | ) |

writes the graphic annotation managed by this object to a DICOM dataset.

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

Parameters

  dset | the the item of the GraphicAnnotationSequence 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:

- dcmpstat/include/dcmtk/dcmpstat/dvpsga.h

Generated on Mon Dec 15 2025 for DCMTK Version 3.7.0 by Doxygen 1.9.1