LImageViewerCell::AddCobbAngle

Summary

Creates a cobb-angle, which is a text display the angle between two lines, using the specified annotation lines (hFirstLine, hSecondLine).

Syntax

#include "ltwrappr.h"

L_INT LImageViewerCell::AddCobbAngle(nSubCellIndex, hFirstLine, hSecondLine)

Parameters

L_INT nSubCellIndex

A zero-based index into the image list attached to the cell. This sub-cell contains the image that contains the annotation container. Pass -2 to refer to the selected sub-cell.

HANNOBJECT hFirstLine

Handle of the first annotation line that is used to create the cobb-angle.

HANNOBJECT hSecondLine

Handle to the second annotation line that is used to creat the cobb-angle.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

To retrieve the cobb angle value, use the function LImageViewerCell::GetCobbAngleValue.

To delete a cobb angle, use the function LImageViewerCell::RemoveCobbAngle.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example creates a cobb angle out of the first two annotation lines in the annotation container.

L_INT nCounter; 
 
L_INT CALLBACK FindLine(HANNOBJECT hObject, L_VOID * pUserData) 
{ 
   pHANNOBJECT hLinesObjects = (pHANNOBJECT)pUserData; 
   L_UINT      uType; 
 
   L_AnnGetType(hObject, &uType); 
   if (uType == ANNOBJECT_LINE) 
   { 
      hLinesObjects[nCounter] = hObject; 
      nCounter++; 
   } 
 
   return SUCCESS; 
} 
 
 
L_DOUBLE LImageViewerCell_GetCobbAngleValueExample(LImageViewerCell& ImageViewerCell) 
{ 
   HANNOBJECT hAnnContainer; 
 
   ImageViewerCell.GetAnnotationContainer(-2, &hAnnContainer, 0); 
 
   HANNOBJECT hLinesObjects[256]; 
   memset(hLinesObjects, 0, sizeof(HANNOBJECT) * 256); 
   nCounter = 0; 
 
   L_AnnEnumerate(hAnnContainer, FindLine, hLinesObjects, ANNFLAG_RECURSE, NULL); 
 
   if (nCounter < 2) 
   { 
      MessageBox(NULL, TEXT("You have to have two lines on the cell to create the cobb angle"), TEXT("Error"), MB_OK); 
      return 0; 
   } 
 
   ImageViewerCell.AddCobbAngle(0, hLinesObjects[nCounter - 1], hLinesObjects[nCounter - 2]); 
 
   L_DOUBLE pnAngle; 
 
   ImageViewerCell.GetCobbAngleValue(0, hLinesObjects[nCounter - 1], &pnAngle); 
 
   return pnAngle; 
} 

Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Medical Image Viewer C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.