The image viewer provides support for using annotation objects on Image Viewer Cells.
Convert mouse coordinates into bitmap coordinates using the LImageViewerCell::GetBitmapPixel function.
For more control over the annotation, get the annotation container by calling the LImageViewerCell::GetAnnotationContainer. Then you can apply any function from the annotation toolkit. Then set the modified annotation container by using the LImageViewerCell::SetAnnotationContainer function.
Save an annotation object to an XML file using the LImageViewerCell::SaveAnnotation function. To load the previously saved annotation container use the LImageViewerCell::LoadAnnotation function.
When clicking, double-clicking, moving, etc. the mouse is handled through the LImageViewerCell::MouseCallBack callback function. This callback function is called, if LImageViewerCell::EnableMouseCallBack has been set to TRUE.
Add the annotation action to the container by calling the function LImageViewerCell::AddAction, then assign an annotation object to a mouse button by calling the function LImageViewerCell::SetAction. Specify the value of the nAction parameter with one of the following flags as an annotation object:
CONTAINER_ACTION_ANNOTATION_RULER
CONTAINER_ACTION_ANNOTATION_ANGLE
CONTAINER_ACTION_ANNOTATION_TEXT
CONTAINER_ACTION_ANNOTATION_ARROW
CONTAINER_ACTION_ANNOTATION_RECTANGLE
CONTAINER_ACTION_ANNOTATION_ELLIPSE
CONTAINER_ACTION_ANNOTATION_HILITE
CONTAINER_ACTION_REGION_RECTANGLE
CONTAINER_ACTION_REGION_ELLIPSE
CONTAINER_ACTION_REGION_FREEHAND
CONTAINER_ACTION_REGION_POLYGON
CONTAINER_ACTION_REGION_MAGICWAND
CONTAINER_ACTION_REGION_COLORRANGE
CONTAINER_ACTION_REGION_CIRCLE
CONTAINER_ACTION_REGION_SQUARE
Once the annotation object is assigned to a mouse button, draw the selected annotation object using the assigned mouse button.
Convert a closed-shape annotation object (ellipse, rectangle, highlight) to a region of interest (ROI) by calling the function LImageViewerCell::AnnToRgn. The resulting ROI (region) can be combined with an existing defined region in many ways.
Change the unit of measure for the container by calling LImageViewerCell::SetRulerUnit. Retrieve the current unit of measure by calling LImageViewerCell::GetRulerUnit.
Calibrate (set the unit of measure for) the annotation ruler by calling LImageViewerCell::CalibrateRuler. Whenever a ruler is calibrated, all other existing annotation and cell rulers will be calibrated as well, and the field of view tag will be updated to match the new value set by calibrating the ruler. This tag can be shown by calling LImageViewerCell::SetCellTag with uType parameter set to DISPWIN_TYPE_FIELDOFVIEW.
Annotation actions work like other container actions, using structure DISPANNOTATIONPROPS. Annotation properties can be retrieved by calling LImageViewerCell::GetActionProperties. To change annotation action properties, call LImageViewerCell::SetActionProperties.
Retrieve the attributes of the selected annotation object in the specified sub-cell by calling LImageViewerCell::GetSelectedAnnotationAttributes.
Using the Medical Image Viewer Control
Creating a Bitmap Region Inside the Image Viewer
Working with Annotations
For more information, refer to:
Summary of All Supported Image File Formats