Working with Annotations

The image viewer provides support for using annotation objects on Image Viewer Cells.

Features of Version 16 and above:

Remove a bitmap region from an image by calling L_DispContainerRemoveBitmapRegion.

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

When clicking on an annotation object, the DISPCONTAINERANNOTATIONCALLBACK callback function will be called if it was previously set by calling the L_DispContainerSetAnnotationCallBack function. To determine the current callback being used to annotation click, call the L_DispContainerGetAnnotationCallBack function.

When creating an annotation object, the DISPCONTAINERANNOTATIONCREATEDCALLBACK callback function will be called if it was previously set by calling the L_DispContainerSetAnnotationCreatedCallBack function. To determine the current callback being used to handle the annotation-created callback, call the L_DispContainerGetAnnotationCreatedCallBack  function.

It is possible to rotate the annotation container by using the L_DispContainerRotateAnnotationContainer function. To flip the annotation container use the L_DispContainerFlipAnnotationContainer function. To reverse the annotation container use the L_DispContainerReverseAnnotationContainer function.

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 DISPCONTAINERACTIVESUBCELLCHANGED callback function will be called if it was previously set by calling the L_DispContainerSetActiveSubCellChangedCallBack function. To determine the current callback being used to handle the active sub-cell change, use the L_DispContainerGetActiveSubCellChangedCallBack function. To obtain the index of the active sub-cell, call L_DispContainerGetActiveSubCell.

Convert mouse coordinates into bitmap coordinates using the L_DispContainerGetBitmapPixel function.

For more control over the annotation, get the annotation container by calling the L_DispContainerGetAnnotationContainer. Then you can apply any function from the annotation toolkit. Then set the modified annotation container by using the L_DispContainerSetAnnotationContainer function.

Save an annotation object to an XML file using the L_DispContainerSaveAnnotation function. To load the previously saved annotation container use the L_DispContainerLoadAnnotation function.

When clicking, double-clicking, moving, etc. the mouse, the DISPCONTAINERMOUSECALLBACK callback function will be called if it was previously set by calling the L_DispContainerSetMouseCallBack function. To determine the current callback being used to handle the mouse actions, use the L_DispContainerGetMouseCallBack function.

Features of Version 15 and above:

Add the annotation action to the container by calling the function L_DispContainerAddAction, then assign an annotation object to a mouse button by calling the function L_DispContainerSetAction. Specify the value of the nAction parameter with  one of the following flags as an annotation object:

Once the annotation object is assigned to a mouse button, draw the selected annotation object using the assigned mouse button.

Regions

Convert a closed-shape annotation object (ellipse, rectangle, highlight) to a region of interest (ROI) by calling the function L_DispContainerAnnToRgn. The resulting ROI (region) can be combined with an existing defined region in many ways.

Remove a bitmap region from an image by calling L_DispContainerRemoveBitmapRegion.

Rulers and Units of Measure

Change the unit of measure for the container by calling L_DispContainerSetRulerUnit. Retrieve the current unit of measure by calling L_DispContainerGetRulerUnit.

Calibrate (set the unit of measure for) the annotation ruler by calling L_DispContainerCalibrateRuler.  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 L_DispContainerSetCellTag with uType parameter set to DISPWIN_TYPE_FIELDOFVIEW.

Actions, Properties, and Attributes

Annotation actions work like other container actions, using structure DISPANNOTATIONPROPS. Annotation properties can be retrieved by calling L_DispContainerGetActionProperties. To change annotation action properties, call L_DispContainerSetActionProperties.

Retrieve the attributes of the selected annotation object in the specified sub-cell by calling L_DispContainerGetSelectedAnnotationAttributes.

When clicking on an annotation object, DISPCONTAINERANNOTATIONCALLBACK will be called if it was previously set by calling L_DispContainerSetAnnotationCallBack. To determine the current callback being used, call L_DispContainerGetAnnotationCallBack.

When creating annotation objects, the DISPCONTAINERANNOTATIONCREATEDCALLBACK callback function will be called if it was previously set by calling L_DispContainerSetAnnotationCreatedCallBack. To determine the current callback being used to handle the annotation created callback, call L_DispContainerGetAnnotationCreatedCallBack.

Creating, Loading, Changing, and Saving the Annotation Container

Save the annotation object as an XML file using L_DispContainerSaveAnnotation. To load the previously saved annotation container, use L_DispContainerLoadAnnotation.

To rotate the annotation container, use L_DispContainerRotateAnnotationContainer. To flip the annotation container, use L_DispContainerFlipAnnotationContainer. To reverse the annotation container, use L_DispContainerReverseAnnotationContainer .

If you need more control over the annotation, get the annotation container using the L_DispContainerGetAnnotationContainer, apply any annotation toolkit function, then set the modified annotation container using L_DispContainerGetAnnotationCreatedCallBack.

Mouse Actions

When applying mouse actions, DISPCONTAINERMOUSECALLBACK will be called if it was previously set by calling L_DispContainerSetMouseCallBack . To determine the current callback being used to handle mouse actions, use the L_DispContainerGetMouseCallBack function.

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, DISPCONTAINERACTIVESUBCELLCHANGED callback will be called if it was previously set by calling L_DispContainerSetActiveSubCellChangedCallBack. To determine the current callback being used to handle the active sub-cell change, use L_DispContainerGetActiveSubCellChangedCallBack. To obtain the index of the active sub-cell, call L_DispContainerGetActiveSubCell.

Working with the LEADTOOLS Medical Image Viewer Control

Using the Medical Image Viewer Control

Image Viewer Cells

Applying Actions

Creating a Bitmap Region Inside the Image Viewer

Implementing Animation

Working with Annotations

Customizeable Title Bar

For more information, refer to:

Introduction

Example Programs

Summary of All Supported Image File Formats

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Medical Image Viewer C API Help