LImageViewerCell::GetDefaultWindowLevelValues

#include "ltwrappr.h"

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

L_INT nSubCellIndex;

index into the image list attached to the cell

L_INT * pnWidth;

pointer to a variable to be updated

L_INT * pnCenter;

pointer to a variable to be updated

L_UINT uFlags;

reserved for future use

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

Parameter Description
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.
pnWidth Address of the variable to be updated with the default window level width value.
pnCenter Address of the variable to be updated with the default window level center value.
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

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

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:

LImageViewerCell::ResetWindowLevelValues, LImageViewerCell::SetDefaultWindowLevelValues, LImageViewerCell::GetActionProperties, LImageViewer::Create, LImageViewer::Destroy, LImageViewerCell::EnableCellLowMemoryUsage, LImageViewer::InsertCell, LImageViewerCell::SetRequestedImage, LImageViewerCell::LowMemoryUsageCallBack, LImageViewerCell::SetCellBitmapList

Topics:

Applying Actions

 

Window Control/Image Viewer Functions: Applying Actions

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 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Medical Image Viewer C++ Class Library Help