LImageViewerCell::GetDefaultWindowLevelValues

#include "ltwrappr.h"

L_INT LImageViewerCell::GetDefaultWindowLevelValues(nSubCellIndex, pnWidth, pnCenter, uFlags)

Gets the window level default values that are set when loading the image.

Parameters

L_INT nSubCellIndex

A zero-based index into the image list attached to the cell. This image contains the default window level values being retrieved. Pass -2 to retrieves the default window level values of the selected sub-cell.

L_INT * pnWidth

Address of the variable to be updated with the default window level width value.

L_INT * pnCenter

Address of the variable to be updated with the default window level center value.

L_UINT uFlags

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

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

Comments

This function will not get the current window level values. To get the current window level values call LImageViewerCell::GetActionProperties. To set the current window level values call LImageViewerCell::SetActionProperties.

This function will not get the current window level values; it will get the default ones. The default values can be set using either by using LImageViewerCell::SetDefaultWindowLevelValues or can be internally calculated when the images are first set in the control using either LImageViewerCell::SetCellBitmapList or LImageViewerCell::SetRequestedImage (when the low memory usage feature is enabled). For more information about the low memory usage feature, refer to the function LImageViewerCell::EnableCellLowMemoryUsage.

To reset the window level values to the default values use the function LImageViewerCell::ResetWindowLevelValues.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This examples changes the default window level value by decrease the width by 100. Then resets the images based on the new value.

L_INT LImageViewer_GetDefaultWindowLevelExample(LImageViewerCell& ImageViewerCell) 
{ 
   L_INT nRet; 
   L_INT nWidth; 
   L_INT nCenter; 
 
   nRet = ImageViewerCell.GetDefaultWindowLevelValues(0, &nWidth, &nCenter, 0); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   nWidth -= 100; 
 
   nRet = ImageViewerCell.SetDefaultWindowLevelValues(0, nWidth, nCenter, 0); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   nRet = ImageViewerCell.ResetWindowLevelValues(0, 0); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 

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

LEADTOOLS Medical Image Viewer C++ Class Library Help