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:
<list type="number">
<item><description>Creates a DicomTextObject text object with an anchor</description></item>
<item><description>Creates a converter</description></item>
<item><description>Converts to a LEAD annotation</description></item>
<item><description>Displays the LEAD annotation</description></item>
</list>
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 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
See Also