Available in LEADTOOLS Medical Imaging toolkits. |
LImageViewerCell::CalibrateCell
#include "ltwrappr.h"
L_INT LImageViewerCell::CalibrateCell(nSubCellIndex, dLength, uUnit, dTargetLength, uTargetUnit, uFlags)
L_INT nSubCellIndex; |
/* index into the image list attached to the cell */ |
L_DOUBLE dLength; |
/* length assigned to the virtual ruler */ |
L_UINT uUnit; |
/* units of the length */ |
L_DOUBLE dTargetLength; |
/* new length assigned to the virtual ruler */ |
L_UINT uTargetUnit; |
/* units of the length */ |
L_UINT uFlags; |
/* flag */ |
Calibrates the cell or sub-cell without having to use the annotation ruler, to calibrate using annotation ruler use the LImageViewerCell::CalibrateRuler function.
Parameter |
Description |
|
nSubCellIndex |
A zero-based index into the image list attached to the cell. This sub-cell will be calibrated. Pass -1 to apply this effect on all sub-cells. Pass -2 to apply this effect on the selected sub-cell. |
|
dLength |
Value that represents the old length of the virtual ruler. |
|
uUnit |
Value that specifies the unit of measure for the virtual ruler length. Possible values are: |
|
|
Value |
Meaning |
|
CONTAINER_RULERUNIT_INCHES |
[0] Inches. |
|
CONTAINER_RULERUNIT_FEET |
[1] Feet. |
|
CONTAINER_RULERUNIT_MICROMETERS |
[2] Micrometers. |
|
CONTAINER_RULERUNIT_MILLIMETERS |
[3] Millimeters. |
|
CONTAINER_RULERUNIT_CENTIMETERS |
[4] Centimeters. This is the default value. |
|
CONTAINER_RULERUNIT_METERS |
[5] Meters. |
dTargetLength |
Value that represents the length to be assigned to the virtual ruler. The unit of measure for the length is specified by the value of the uTargetUnit parameter. |
|
uTargetUnit |
Value that specifies the unit of measure for the virtual ruler length. Possible values are: |
|
|
Value |
Meaning |
|
CONTAINER_RULERUNIT_INCHES |
[0] Inches. |
|
CONTAINER_RULERUNIT_FEET |
[1] Feet. |
|
CONTAINER_RULERUNIT_MICROMETERS |
[2] Micrometers. |
|
CONTAINER_RULERUNIT_MILLIMETERS |
[3] Millimeters. |
|
CONTAINER_RULERUNIT_CENTIMETERS |
[4] Centimeters. This is the default value. |
|
CONTAINER_RULERUNIT_METERS |
[5] Meters. |
uFlags |
Flags that indicate the direction to which the calibration is applied. Possible values are: |
|
|
Value |
Meaning |
|
CONTAINER_CALIBRATERULER_BOTH |
[0] Calibrate both axes. This is the default value. |
|
CONTAINER_CALIBRATERULER_VERTICAL |
[1] Calibrate only the vertical axis. |
|
CONTAINER_CALIBRATERULER_HORIZONTAL |
[2] Calibrate only the horizontal axis. |
|
The following flags that determine whether to apply the feature on the one cell only, or more than one cell. This value can only be used when the cell is attached to the LImageViewer through the function LImageViewer::InsertCell. Possible values are: |
|
|
Value |
Meaning |
|
CELL_APPLYTOTHIS |
[0x00000000] Apply the feature to this cell only. |
|
CELL_APPLYTOALL |
[0x10000000] Apply the feature to all the cells in the Image Viewer. |
|
CELL_APPLYTOSELECTED |
[0x20000000] Apply the feature to the selected cells in the Image Viewer. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
This function does not require that the annotation ruler to be present in order to calibrate the cell.
The user is expected to send a length along with the unit of measure, and then send a new length with the new unit of measure for the cell being calibrated.
To obtain the unit of measure of the viewer, call the LImageViewerCell::GetRulerUnit function.
To change the unit of measure unit of the viewer, call the LImageViewerCell::SetRulerUnit function.
Required DLLs and Libraries
LTIVW For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
Example
This example calibrates the first frame of the first cell.
#if defined LTV17_CONFIG L_INT LImageViewer_CalibrateCellExample(LImageViewerCell& ImageViewerCell) { L_INT nRet; nRet = ImageViewerCell.CalibrateCell(0, 1, CONTAINER_RULERUNIT_CENTIMETERS, 2, CONTAINER_RULERUNIT_CENTIMETERS, 0); return nRet; } #else L_INT ImageViewer_CalibrateCellExample(LImageViewer& ImageViewer) { L_INT nRet; nRet = ImageViewer.CalibrateCell(0, 0, 1, CONTAINER_RULERUNIT_CENTIMETERS, 2, CONTAINER_RULERUNIT_CENTIMETERS, 0); return nRet; } #endif // LTV17_CONFIG