Working with DICOM Annotations

LEADTOOLS DICOM COM provides two levels of annotation support. There is basic support which lets you load, count, obtain information about and save annotation files. In addition, LEADTOOLS provides advanced support for working with the "Graphic Annotation Module" and the the "Grayscale Softcopy Presentation State" IOD, which let you display and manipulate graphic and text annotations.

Basic

The toolkit also gives the user the ability to store LEADTOOLS annotation files as private data elements inside a DICOM dataset. You can store up to 256 single page or multi-page annotation files, either in the LEAD native format or a binary encoded format.

For working with the annotation files, LEAD provides the following:

image\sqrblit.gif To load an annotation file from a DICOM data set, use the AnnLoad method. This method updates the AnnContainer property with the root container of the loaded annotations.

image\sqrblit.gif The AnnCount method retrieves information about the annotation files stored in a DICOM data set. This method provides information on which, of the 256 positions within the DICOM data set, contain annotation files and, if desired, the appropriate private creator tag. This property updates the AnnEntries property and the AnnPrivateCreatorTag property.

image\sqrblit.gif The AnnDelete method can be used to delete a page from an annotation file, delete an entire annotation file, or delete all annotation files stored in a DICOM data set.

image\sqrblit.gif To save annotations as private data within a DICOM data set, use the AnnSave method. This method saves the annotations referenced by the container object in the AnnContainer property. If a private creator tag has been set in the AnnPrivateCreatorTag property, AnnSave will use this tag when saving the annotations.

Advanced

The DICOM standard defines the "Graphic Annotation Module" which describes the attributes of vector graphics and text annotations that shall be made available by a display device to be applied to an image. LEADTOOLS provides functionality to manipulate DICOM graphic and text annotations and the related attributes which are part of the "Grayscale Softcopy Presentation State" IOD.

The GetPresStateAttributes method and the SetPresStateAttributes method (along with the PresStateAttributes property) can be used to retrieve and update the values of the elements that describe the "Presentation State Module". When setting the attributes of the "Presentation State Module", the properties of the PresStateAttributes property should be set to the desired values before calling the SetPresStateAttributes method. The PresStateAttributes property returns a reference to the DicomPresStateAttributes object. This object exposes the IDicomPresStateAttributes interface which defines properties for the attributes that describe the "Presentation State Module". For more information regarding the properties available through this interface, refer to Working With The DicomPresStateAttributes Object.

The following methods can be used to manage the set of referenced images under the "Referenced Series Sequence" (0008,1115) in the "Presentation State Module".

AddPresStateImageRef method

RemovePresStateImageRef method

RemoveAllPresStateImageRefs method

GetPresStateImageRefInstanceUID method

GetPresStateImageRefCount method

FindFirstPresStateRefSeriesItem method

MoveNextPresStateRefSeriesItem method

FindPresStateRefImageItem method

LEADTOOLS also offers an extensive set of methods and properties to manipulate the "Graphic Layer Module". This Module defines the characteristics of the layers in which graphic annotations, text annotations, curves and overlays can be rendered. A new layer can be created by calling the CreateLayer method. Before calling this method, the properties of the LayerAttributes property should be set to the desired values. The LayerAttributes property returns a reference to the DicomLayerAttributes object. This object exposes the IDicomLayerAttributes interface which defines properties to describe a DICOM graphic layer. For more information regarding the properties available through this interface, refer to Working With The DicomLayerAttributes Object.

Once a layer is created, you can call the GetLayerAttributes method and the SetLayerAttributes method to retrieve and update the values of the elements that describe the layer attributes. A layer can be removed by calling the RemoveLayer method. The RemoveAllLayers method will remove all layers in the Data Set. Some of the other methods and properties, which can be used to maintain layers, are:

NewLayerIndex property

LayerCount property

GetLayerIndex method

FindLayerItem method

FindFirstGraphicAnnItem method

MoveNextGraphicAnnItem method

GetLayerName method

SetLayerName method

CreateGraphicAnnItem method

GetLayerGraphicObjectCount method

RemoveLayerGraphicObjects method

GetLayerTextObjectCount method

RemoveLayerTextObjects method

A new graphic annotation object can be created by calling the CreateGraphicObject method. Before calling this method, the properties of the GraphicObjectAttributes property should be set to the desired values.

The GraphicObjectAttributes property returns a reference to the DicomGraphicObjectAttributes object. This object exposes the IDicomGraphicObjectAttributes interface which defines properties to describe a DICOM graphic layer. For more information regarding the properties available through this interface, refer to Working With The DicomGraphicObjectAttributes Object.

Once a graphic object is created, you can call the GetGraphicObjectAttributes method and the SetGraphicObjectAttributes method to retrieve and update the values of the elements that describe the object attributes. Some of the other methods and properties, which can be used to manipulate graphic objects, are:

RemoveGraphicObject method

GetGraphicObjectCount method

RemoveAllGraphicObjects method

FindGraphicObjectItem method

A new text annotation object can be created by calling the CreateTextObject method. Before calling this method, the properties of the TextObjectAttributes property should be set to the desired values. The TextObjectAttributes property returns a reference to the DicomTextObjectAttributes object. This object exposes the IDicomTextObjectAttributes interface which defines properties that describe a text annotation object. For more information regarding the properties available through this interface, refer to Working With The DicomTextObjectAttributes Object.

Once a text object is created, you can call the GetTextObjectAttributes method and the SetTextObjectAttributes method to retrieve and update the values of the elements that describe the object attributes. Some of the other methods and properties, which can be used to manipulate text objects, are:

RemoveTextObject method

GetTextObjectCount method

RemoveAllTextObjects method

FindTextObjectItem method

The "Referenced Image Sequence" (0008,1140) under the "Graphic Annotation Module" is used to define the set of Image SOP Instances to which a group of graphic and text annotations applies. LEADTOOLS offers the following methods to manipulate the Items under that Sequence:

AddLayerImageRef method

GetLayerImageRefCount method

GetLayerImageRefInstanceUID method

RemoveLayerImageRef method

RemoveAllLayerImageRefs method

RemoveAllLayersImageRefs method

FindLayerRefImageItem method

To bring the DICOM annotation world into the LEADTOOLS annotation world, the toolkit provides functionality to convert DICOM annotations into LEADTOOLS annotations and vice versa. The ConvertLEADAnnObjToDicomAnnObjs method can be used to convert a LEADTOOLS annotation object into one or more DICOM annotation objects, and (optionally) to add the new DICOM annotation objects into the Data Set. The OnConvertLEADAnnObjToDicomAnnObj event will be fired for each resulting DICOM annotation object. During the event handling, the conversion process can be terminated by calling the EndConversion method. To go from DICOM graphic or text annotations into LEADTOOLS annotations use the ConvertDicomAnnObjToLEADAnnObj method and the LEADAnnObject property.