#include "ltivw.h"
L_LTIVW_API L_INT L_DispContainerRemoveCobbAngle(hCellWnd, nSubCellIndex, hLine)
Removes the cobb-angle value using one of the two lines that is used to create the cobb angle.
A handle to the window that represents the Medical Viewer Cell.
A zero-based index into the image list attached to the cell specified in nCellIndex. This sub-cell is the one where that the cobb-angle is placed. Pass -2 to refer to the selected sub-cell. If the cell contains 1 frame then the nSubCellIndex should be 0.
Handle to the one of the two annotation lines that creates the cobb angle.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
To create a cobb angle, add two lines to the sub-cell / cell, then pass them to the function L_DispContainerAddCobbAngle.
To get the cobb angle value, please refer to the function L_DispContainerGetCobbAngleValue.
Required DLLs and Libraries
This function removes the cobb-angle attached to the specified line.
L_INT nLineCounter = 0;
L_INT CALLBACK FindLines(HANNOBJECT hObject, L_VOID * pUserData)
{
pHANNOBJECT hLinesObjects = (pHANNOBJECT)pUserData;
L_UINT uType;
L_AnnGetType(hObject, &uType);
if (uType == ANNOBJECT_LINE)
{
hLinesObjects[nLineCounter] = hObject;
nLineCounter++;
}
return SUCCESS;
}
L_DOUBLE L_DispContainerRemoveCobbAngleExample(HWND hCellWnd)
{
L_INT nSubCellIndex;
L_DispContainerGetActiveSubCell(hCellWnd, &nSubCellIndex, 0);
HANNOBJECT hAnnContainer;
L_DispContainerGetAnnotationContainer(hCellWnd, nSubCellIndex, &hAnnContainer, 0);
HANNOBJECT hLinesObjects[256];
memset(hLinesObjects, 0, sizeof(HANNOBJECT) * 256);
nLineCounter = 0;
L_AnnEnumerate(hAnnContainer, FindLines, hLinesObjects, ANNFLAG_RECURSE, NULL);
if (nLineCounter < 2)
{
MessageBox(hCellWnd, TEXT("You have to have two lines on the cell to create the cobb angle"), TEXT("Error"), MB_OK);
return 0.0;
}
L_INT nRet = L_DispContainerAddCobbAngle(hCellWnd, nSubCellIndex, hLinesObjects[nLineCounter - 1], hLinesObjects[nLineCounter - 2]);
L_DOUBLE dAngle;
nRet = L_DispContainerGetCobbAngleValue(hCellWnd, 0, hLinesObjects[nLineCounter - 1], &dAngle);
if (nRet != SUCCESS)
{
MessageBox(hCellWnd, TEXT("The line you sent is not attached to any cobb angle"), TEXT("Error"), MB_OK);
}
return dAngle;
}