Converting DICOM Annotation Objects to LEAD Annotation Objects Example for Visual Basic
Private Sub DicomAnnToLEADAnn(objPresStateDS As LEADDicomDS)
Dim objRasterAnn As New LEADRasterAnnotation
' Describe a DICOM graphic annotation object and then convert it to
' a LEAD annotation object
With objPresStateDS.GraphicObjectAttributes
.Type = DICOM_GRAPHIC_OBJECT_TYPE_POLYLINE
.Filled = False
.PointCount = 5
.PointsX (0) = 90.7
.PointsY (0) = 156.9
.PointsX (1) = 195.9
.PointsY (1) = 156.9
.PointsX (2) = 195.9
.PointsY (2) = 342.5
.PointsX (3) = 90.7
.PointsY (3) = 342.5
.PointsX (4) = 90.7
.PointsY (4) = 156.9
End With
If objPresStateDS.ConvertDicomAnnObjToLEADAnnObj (True) = DICOM_SUCCESS Then
MsgBox "The DICOM graphic annotation object was converted successfully."
' The handle to the resulted LEAD annotation object is available from the
' LEADAnnObject property. You can now use the functionality of a LEAD Raster
' Annotation object to manipulate the object.
' Once done from the object, don't forget to destroy it
objRasterAnn.AnnDestroy objPresStateDS.LEADAnnObject, 0
End If
' Describe a DICOM text annotation object and then convert it to a
' LEAD annotation object
With objPresStateDS.TextObjectAttributes
.BoundingBoxUsed = True
.AnchorPointUsed = False
.TextValue = "Text annotation"
.BoundingBoxTLHCornerX = 290.5
.BoundingBoxTLHCornerY = 158.1
.BoundingBoxBRHCornerX = 424.1
.BoundingBoxBRHCornerY = 176.1
.BoundingBoxTextJustification = DICOM_TEXT_JUSTIFICATION_LEFT
End With
If objPresStateDS.ConvertDicomAnnObjToLEADAnnObj (False) = DICOM_SUCCESS Then
MsgBox "The DICOM text annotation object was converted successfully."
' The handle to the resulted LEAD annotation object is available from the
' LEADAnnObject property. You can now use the functionality of a LEAD Raster
' Annotation object to manipulate the object.
' Once done from the object, don't forget to destroy it
objRasterAnn.AnnDestroy objPresStateDS.LEADAnnObject, 0
End If
End Sub