ImageGear .NET v24.12 - Updated
Annotations
User Guide > How to Work with... > DICOM > Presentation State > Annotations

Annotation objects include: Textbox, Point, Polyline, Spline, Circle, Ellipse. Graphical objects can be filled or not filled. Annotations can be grouped into layers.

ImageGear .NET uses ART marks to represent DICOM annotation objects. When a Presentation State DataSet is applied to an image, ImageGear creates ART marks for each of the annotation objects. These marks can then be edited with the ART API methods.

DICOM Graphic Annotation objects can be grouped into Layers. All objects on the same layer have the same color (recommended grayscale value). ImageGear uses ART mark groups to represent layers.

Use PreparePresStateMetadata Method to prepare presentation state metadata from image's display settings and annotation marks. This metadata can be saved as a presentation state object file.

When preparing presentation state from ImGearPage Class that has ART marks attached to it, ART marks are converted to DICOM Graphic Annotation objects or Text Annotation objects. The table below lists ART marks that can be converted, corresponding DICOM Graphic Annotation objects, and properties that Graphic Annotation objects support. Marks that are not listed in this table are ignored. 

ImGearARTMarkType Value DICOM Graphic Annotation Object Supported Properties
POINT POINT Point coordinates
POLYLINE POLYLINE Node coordinates, "Filled" property
POLYGON POLYLINE Node coordinates, "Filled" property
FILLED_POLYGON POLYLINE Node coordinates, "Filled" property
CURVE INTERPOLATED Node coordinates, "Filled" property
ELLIPSE ELLIPSE Bounds coordinates, "Filled" property
FILLED_ELLIPSE ELLIPSE Bounds coordinates, "Filled" property
HOLLOW_ELLIPSE ELLIPSE Bounds coordinates, "Filled" property

The following ART marks are saved as DICOM Text Annotation objects:

TEXT Text, bounds coordinates, anchor point coordinates, anchor point visibility
TYPED_TEXT Text, bounds coordinates
CALLOUT Text, bounds coordinates, anchor point coordinates, anchor point visibility

Graphic Annotation objects do not have a color property. Instead, Graphic Layer has "Recommended Display Grayscale Value" property. ImageGear uses the color of the first mark in the ART group as the color for the entire Graphic Layer. If R, G, and B channels of the color of that first mark are equal, ImageGear converts the color to grayscale and uses this value to initialize the "Recommended Display Grayscale Value" property of the layer.
Otherwise, ImageGear initializes the "Recommended Display RGB Value" property of the layer by that color.

There are some aspects of saving/loading of POLYLINE and POLYGON ART marks that should be considered. As the DICOM specification for Presentation State does not define POLYGON Graphic Annotation object, only POLYLINE (see PS 3.3 2008, C.10.5 Graphic Annotation Module), ImageGear saves a POLYGON ART mark as a POLYLINE DICOM Graphic object in the Presentation State metadata. The DICOM Tag "Graphic Filled" (0070,0024) indicates whether the POLYLINE is filled or not. Additionally, it indicates whether a non-filled POLYLINE is closed or not – if it has a "No" value, then the polyline is closed, otherwise, if that Tag is absent at all, then the polyline is opened (see aforementioned DICOM specification).

The saving logic of POLYGON and POLYLINE ART marks is as follows:

ART Annotation to Save Saved Graphic Filled Tag Value Saved DICOM Graphical Object
POLYLINE If IsClosed Property is true, then ImageGear writes this tag with "No" value; otherwise it does not write this tag at all. POLYLINE
POLYGON If FillColor Property is not null, ImageGear writes this tag with "Yes" value; otherwise it writes this tag with "No" value. POLYLINE

The loading logic of a POLYLINE DICOM Graphical object is as follows:

Loaded DICOM Graphical Object Loaded Graphic Filled Tag Value Created ART Annotation
POLYLINE None - absent in the Presentation State metadata. POLYLINE mark, IsClosed Property is false.
POLYLINE No POLYLINE mark, IsClosed Property is true.
POLYLINE Yes POLYGON mark, FillColor Property is not null.

 

See Also