Converts a
DicomAnnotationObject to an
AnnObject.
Syntax
Parameters
- dicomAnnotationObject
-
The DICOM annotation object that is being converted.
Return Value
A
AnnObject representation of the DICOM annotation if successful;
null if the
DicomAnnotationObject cannot be converted.
Example
This sample does the following:
- Creates a DicomTextObject text object with an anchor
- Creates a converter
- Converts to a LEAD annotation
- Displays the LEAD annotation
Visual Basic | Copy Code |
---|
Public Function DicomAnnotationsUtilities_ToAnnObject() As AnnObject
Dim dicomAnnotationObject As DicomTextObject = New Leadtools.Dicom.DicomTextObject()
dicomAnnotationObject.TLHCorner = New DicomAnnotationPoint(100, 250)
dicomAnnotationObject.BRHCorner = New DicomAnnotationPoint(200, 350)
dicomAnnotationObject.AnchorPointVisible = True
dicomAnnotationObject.AnchorPointUnits = DicomAnnotationUnitsRelativityType.Pixel
dicomAnnotationObject.AnchorPoint = New DicomAnnotationPoint(300, 300)
dicomAnnotationObject.AnchorPointVisible = True
dicomAnnotationObject.BoundingBoxUnits = DicomAnnotationUnitsRelativityType.Pixel
dicomAnnotationObject.TextJustification = TextAnnotationJustificationType.Right
dicomAnnotationObject.TextValue = "Right justified with blue border"
Dim du As DicomAnnotationsUtilities = New DicomAnnotationsUtilities()
du.Pen = New AnnPen(Color.Blue, New AnnLength(3, AnnUnit.Pixel))
du.Brush = New AnnSolidBrush(Color.Yellow)
du.TextColor = Color.Brown
Dim annObject As AnnObject = du.ToAnnObject(dicomAnnotationObject)
Return annObject
End Function |
C# | Copy Code |
---|
public AnnObject DicomAnnotationsUtilities_ToAnnObject() { // Create a DicomTextAnnotation object -- text object with an anchor DicomTextObject dicomAnnotationObject = new Leadtools.Dicom.DicomTextObject(); dicomAnnotationObject.TLHCorner = new DicomAnnotationPoint(100, 250); dicomAnnotationObject.BRHCorner = new DicomAnnotationPoint(200, 350); dicomAnnotationObject.AnchorPointVisible = true; dicomAnnotationObject.AnchorPointUnits = DicomAnnotationUnitsRelativityType.Pixel; dicomAnnotationObject.AnchorPoint = new DicomAnnotationPoint(300, 300); dicomAnnotationObject.AnchorPointVisible = true; dicomAnnotationObject.BoundingBoxUnits = DicomAnnotationUnitsRelativityType.Pixel; dicomAnnotationObject.TextJustification = TextAnnotationJustificationType.Right; dicomAnnotationObject.TextValue = "Right justified with blue border"; // Create an instance of the converter, and set some properties DicomAnnotationsUtilities du = new DicomAnnotationsUtilities(); du.Pen = new AnnPen(Color.Blue, new AnnLength(3, AnnUnit.Pixel)); du.Brush = new AnnSolidBrush(Color.Yellow); du.TextColor = Color.Brown; // Convert to a LEAD AnnObject AnnObject annObject = du.ToAnnObject(dicomAnnotationObject); return annObject; } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also