Converting DICOM Annotation Objects to LEAD Annotation Objects Example for C#
private void DicomAnnToLEADAnn(ref LTDICLib.LEADDicomDS objPresStateDS)
{
LTANNLib.LEADRasterAnnotation objRasterAnn = new LTANNLib.LEADRasterAnnotation();
// Describe a DICOM graphic annotation object and then
convert it to
// a LEAD annotation object
objPresStateDS.GraphicObjectAttributes.Type
= LTDICLib.DicomGraphicObjectTypes.DICOM_GRAPHIC_OBJECT_TYPE_POLYLINE;
objPresStateDS.GraphicObjectAttributes.Filled = false;
objPresStateDS.GraphicObjectAttributes.PointCount = 5;
objPresStateDS.GraphicObjectAttributes.set_PointsX(0, 90.7F);
objPresStateDS.GraphicObjectAttributes.set_PointsY(0, 156.9F);
objPresStateDS.GraphicObjectAttributes.set_PointsX(1, 195.9F);
objPresStateDS.GraphicObjectAttributes.set_PointsY(1, 156.9F);
objPresStateDS.GraphicObjectAttributes.set_PointsX(2, 195.9F);
objPresStateDS.GraphicObjectAttributes.set_PointsY(2, 342.5F);
objPresStateDS.GraphicObjectAttributes.set_PointsX(3, 90.7F);
objPresStateDS.GraphicObjectAttributes.set_PointsY(3, 342.5F);
objPresStateDS.GraphicObjectAttributes.set_PointsX(4, 90.7F);
objPresStateDS.GraphicObjectAttributes.set_PointsY(4, 156.9F);
if (objPresStateDS.ConvertDicomAnnObjToLEADAnnObj(true)
== (short)LTDicomKernelLib.DicomErrorCodes.DICOM_SUCCESS)
{
MessageBox.Show("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);
}
// Describe a DICOM text annotation object and then convert
it to a
// LEAD annotation object
objPresStateDS.TextObjectAttributes.BoundingBoxUsed
= true;
objPresStateDS.TextObjectAttributes.AnchorPointUsed
= false;
objPresStateDS.TextObjectAttributes.TextValue = "Text
annotation";
objPresStateDS.TextObjectAttributes.BoundingBoxTLHCornerX
= 290.5F;
objPresStateDS.TextObjectAttributes.BoundingBoxTLHCornerY
= 158.1F;
objPresStateDS.TextObjectAttributes.BoundingBoxBRHCornerX
= 424.1F;
objPresStateDS.TextObjectAttributes.BoundingBoxBRHCornerY
= 176.1F;
objPresStateDS.TextObjectAttributes.BoundingBoxTextJustification
= LTDICLib.DicomTextJustificationTypes.DICOM_TEXT_JUSTIFICATION_LEFT;
if (objPresStateDS.ConvertDicomAnnObjToLEADAnnObj(false)
== (short)LTDicomKernelLib.DicomErrorCodes.DICOM_SUCCESS)
{
MessageBox.Show("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);
}
}