Available in LEADTOOLS Medical Imaging toolkits. |
Working with DICOM Annotations
LEADTOOLS DICOM C++ Class Library provides basic annotation support for users who just want to load, count, obtain information about and save annotation files. In addition, LEADTOOLS provides more advanced support for users who want to work with the "Graphic Annotation Module" and the "Grayscale Softcopy Presentation State" IOD, which let you display and manipulate graphic and text annotations.
Please note that the MEDICAL capabilities must be unlocked in order to work with DICOM annotations. For more information on unlocking these capabilities, refer to LSettings::UnlockSupport.
Basic
The toolkit 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:
To load an annotation file from a DICOM data set, use the LDicomDS::AnnLoad function.
The LDicomDS::AnnCount retrieves information about the annotation files stored in a DICOM data set. This function provides information on which of the 256 positions within the DICOM data set contain annotation files and, if desired, the appropriate private creator tag.
The LDicomDS::AnnDelete function 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.
To save annotations as private data within a DICOM data set, use the LDicomDS::AnnSave function.
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 offers a number of functions to manipulate DICOM graphic and text annotations and the related attributes which are part of the "Grayscale Softcopy Presentation State" IOD.
LDicomDS::GetPresStateInfo and LDicomDS::SetPresStateInfo can be used to retrieve and update the values of the elements that describe the "Presentation State Module" respectively. The following functions can be used to mange the set of referenced images under the "Referenced Series Sequence" (0008,1115) in the "Presentation State Module":
LDicomDS::AddPresStateImageRefByFileName
LDicomDS::AddPresStateImageRefByDS
LDicomDS::RemovePresStateImageRefBySOPInstance
LDicomDS::RemoveAllPresStateImageRefs
LDicomDS::GetPresStateImageRefSOPInstance
LDicomDS::GetPresStateImageRefCount
LDicomDS::FindFirstPresStateRefSeriesItem
LDicomDS::FindNextPresStateRefSeriesItem
LDicomDS::GetPresStateImageRefBySOPInstance
LEADTOOLS also offers an extensive set of functions 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 LDicomDS::CreateLayer, and named by calling LDicomDS::SetLayerName. . Once a layer has been created, you can call LDicomDS::GetLayerInfo and LDicomDS::SetLayerInfo to retrieve and update the values of the elements that describe the layer attributes respectively. A layer can be removed by calling either LDicomDS::RemoveLayerByIndex or LDicomDS::RemoveLayerByName, LDicomDS::RemoveAllLayers will remove all layers in the dataset. Some of the other functions which can be used to maintain layers are:
LDicomDS::GetLayerGraphicObjectCount
LDicomDS::RemoveLayerGraphicObjects
LDicomDS::GetLayerTextObjectCount
LDicomDS::RemoveLayerTextObjects
LDicomDS::GetLayerElementByIndex
LDicomDS::GetLayerElementByName
A new graphic annotation object can be created by calling LDicomDS::CreateGraphicObject. Once a graphic object has been created, you can call LDicomDS::GetGraphicObjectInfo and LDicomDS::SetGraphicObjectInfo to retrieve and update the values of the elements that describe the object attributes respectively. Some of the other functions which can be used to manipulate graphic objects are:
LDicomDS::GetGraphicObjectCount
LDicomDS::RemoveAllGraphicObjects
LDicomDS::GetGraphicObjPointCount
LDicomDS::GetGraphicObjElement
A new text annotation object can be created by calling LDicomDS::CreateTextObject. Once a text object has been created, you can call LDicomDS::GetTextObjectInfo and LDicomDS::SetTextObjectInfo to retrieve and update the values of the elements that describe the object attributes respectively. Some of the other functions which can be used to manipulate text objects are:
LDicomDS::RemoveAllTextObjects
The "Referenced Image Sequence" (0008,1140) under the "Graphic Annotation Module" is used to define the set of images (SOP instances) to which a group of graphic and text annotations applies. LEADTOOLS offers the following functions to manipulate the items under that sequence:
LDicomDS::GetLayerImageRefCount
LDicomDS::GetLayerImageRefSOPInstance
LDicomDS::RemoveImageRefFromLayer
LDicomDS::RemoveAllImageRefsFromLayer
LDicomDS::RemoveAllImageRefFromAllLayers
LDicomDS::GetLayerImageRefElement
The items in the "Graphic Annotation Sequence" (0070,0001) under the "Graphic Annotation Module" can be manipulated with the following LEADTOOLS functions:
LDicomDS::CreateGraphicAnnSQItem
LDicomDS::FindFirstGraphicAnnSQItem
LDicomDS::FindNextGraphicAnnSQItem
To bring the DICOM annotation world into the LEADTOOLS annotation world, the toolkit offers a number of functions to convert from DICOM annotations into LEADTOOLS annotations and vise versa. LDicomDS::ConvertLEADAnnObjToDicomAnnObjs can be used to convert a LEADTOOLS annotation object into one or more DICOM annotation objects, and (optionally) add the new DICOM annotation object(s) into the dataset. For each resulting DICOM annotation object the LDicomDS::OnConvertLEADAnnObjToDicomAnnObj function will be called by the toolkit.
To convert from DICOM graphic or text annotations into LEADTOOLS annotations use LDicomDS::ConvertDicomAnnObjToLEADAnnObj.