LImageViewer::CalibrateRuler
#include "ltwrappr.h"
L_INT LImageViewer::CalibrateRuler(nCellIndex, nSubCellIndex, dLength, uUnit, uFlags)
L_INT nCellIndex; |
/* index of a cell */ |
L_INT nSubCellIndex; |
/* index into the image list attached to the cell */ |
L_DOUBLE dLength; |
/* length assigned to the ruler */ |
L_UINT uUnit; |
/* units of the length */ |
L_UINT uFlags; |
/* reserved for future use */ |
Calibrates the selected ruler inside the specific cell or sub-cell. This function is available only in the Medical Imaging Suite toolkits.
Parameter |
Description |
|
nCellIndex |
A zero-based index of the cell that holds the sub-cell that contains the selected ruler annotation. Pass -1 to apply this effect on all cells. Pass -2 to apply this effect on the selected cells. |
|
nSubCellIndex |
A zero-based index into the image list attached to the cell specified in nCellIndex. This image contains the ruler annotation object that the user chooses to calibrate. 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 length to be assigned to the ruler. The measurement unit of the length is specified by the value of uUnit parameter. |
|
uUnit |
Value that specifies the measurement unit of the 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. |
|
CONTAINER_RULERUNIT_METERS |
[5] Meters. |
uFlags |
Reserved for future use. Pass 0. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
This function works only on the ruler annotation.
To calibrate the ruler it must be selected before calling the function; otherwise, the function will return ERROR_INV_PARAMETER.
If the measurement unit of the selected ruler differs than the measurement unit of the viewer, the value to the uUnit parameter will be ignored and the measurement unit of the viewer will be used instead. (For example: if the user calibrates the ruler to 1 inch, and the viewer measurement unit was centimeter, the ruler length will be 2.54 centimeter).
To obtain the measurement unit of the viewer, call the LImageViewer::GetRulerUnit function.
To change the measurement unit of the viewer, call the LImageViewer::SetRulerUnit function.
Image viewer must be created before calling this function using Create function or an error will be returned.
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
Functions: |
LImageViewer::Create, LImageViewer::Destroy, LImageViewer::SetAction, LImageViewer::AddAction, LImageViewer::GetRulerUnit, LImageViewer::SetRulerUnit, LImageViewer::CalibrateRuler |
Topics: |
|
|
Example
Calibrate the ruler using the Cm.
L_INT LImageViewer_CalibrateRuler(LImageViewer& ImageViewer) { L_UINT uUnit; L_DOUBLE dValue = 2; ImageViewer.GetRulerUnit(&uUnit, 0); if (uUnit != CONTAINER_RULERUNIT_CENTIMETERS) ImageViewer.SetRulerUnit(CONTAINER_RULERUNIT_CENTIMETERS, 0); ImageViewer.CalibrateRuler(0, 0, dValue, CONTAINER_RULERUNIT_CENTIMETERS, 0); return SUCCESS; }