Working With Annotations

The image viewer provides support for using annotation objects on cells. To add an annotation action to a container, call the MedicalViewer.AddAction method. Next, assign an annotation object to a mouse button by calling the MedicalViewer.SetAction method method, specifying the value of the actionType parameter to be one of the following annotation object flags:

MedicalViewerActionType.AnnotationRuler

MedicalViewerActionType.AnnotationAngle

MedicalViewerActionType.AnnotationText

MedicalViewerActionType.AnnotationArrow

MedicalViewerActionType.AnnotationRectangle

MedicalViewerActionType.AnnotationEllipse

MedicalViewerActionType.AnnotationHilite

After the annotation object is assigned to a mouse button, the selected annotation object can be drawn using the mouse button that was assigned to it.

Convert an annotation object to a ROI by calling the MedicalViewerCell.ConvertAnnotationToRegion method. The resulting Region of Interest (ROI) can be combined in many ways with an existing region, if one is defined. The conversion function works only with closed-shape annotation objects like the ellipse, rectangle, hilite annotation, etc. For more information about creating a bitmap region, refer to Creating a Bitmap Region.

Remove a region from an image by calling RemoveRegion.

Call CalibrateCell to calibrate a cell or sub-cell without having to use the annotation ruler.

Calibrate the annotation ruler by calling the MedicalViewerCell.CalibrateRuler method. If one ruler is calibrated, all the other existing rulers will be calibrated whether they are annotation rulers or cell rulers. The field of view tag will also be updated according to the new value set when the ruler is calibrated. This tag can be displayed by calling the MedicalViewerMultiCell.SetTag method with the type parameter set to MedicalViewerTagType.FieldOfView.

Change the unit of measure for the viewer using the MedicalViewer.MeasurementUnit property.

The annotation actions are like any other container actions. Each annotation type has its own properties class that can be used to set or retrieve its properties. For more information about the available actions and the functions associated with them, refer to Applying Actions.

Retrieve the attributes of a selected annotation object of the specified sub-cell by calling the MedicalViewerCell.GetSelectedAnnotationAttributes method.

Save the annotation object to an XML file by calling the MedicalViewerMultiCell.SaveAnnotations(string, int) method. To load an annotation that has been saved, use the MedicalViewerMultiCell.LoadAnnotations(string, int) method.

Rotate the annotation by using the MedicalViewerCell.RotateAnnotationContainer(double, int) method. To flip the annotation, use the MedicalViewerCell.FlipAnnotationContainer(int) method. To reverse the annotation, use the MedicalViewerMultiCell.ReverseAnnotationContainer(int) method.

For more control over the annotation, get the annotation container using the MedicalViewerBaseCell.GetAnnotationContainer method, at which point you can apply any property or method in the annotation toolkit. Set the modified annotation container using the MedicalViewerBaseCell.SetAnnotationContainer function.

Convert mouse coordinates to bitmap coordinate using the MedicalViewerCell.PointToImage method.

When clicking, double-clicking, dragging, etc. the mouse, a mouse event will be raised depend on your mouse action. The following actions can be raised:

Help Version 23.0.2024.3.4
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Imaging, Medical, and Document

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.