Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
Working With Annotations

The image viewer provides support for using the annotation objects on the cells. To add an annotation action to the container, call the MedicalViewer.AddAction method. Next, assign an annotation object to a mouse button by calling MedicalViewer.SetAction 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 be also updated according to the new value set when the ruler is calibrated. This tag dan be displayed by calling the MedicalViewerCell.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 SaveAnnotations method. To load an annotation that has been saved, use the LoadAnnotations method.

Rotate the annotation by using the RotateAnnotationContainer method. To flip the annotation, use the FlipAnnotationContainer method. To reverse the annotation, use the ReverseAnnotationContainer method.

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

Convert mouse coordinates to bitmap coordinate using the 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:

When changing the active sub-cell index by either clicking on a different sub-cell or scrolling the frames scroll (the cell scroll) up or down, the ActiveSubCellChanged event will be raised.