ImageGear Professional DLL v17.1 for Windows Accusoft
MED_display_contrast_auto
Send Feedback  
ImageGear Professional DLL v17.1 for Windows > API Reference Guide > MD Component API Reference > MD Component Functions Reference > Display Functions > MED_display_contrast_auto

Glossary Item Box

This function automatically fills the 16x8 LUT of a 16-bit image loaded into ImageGear in order to optimize its displaying.

Declaration:

  Copy Code
AT_ERRCOUNT ACCUAPI MED_display_contrast_auto(        const HIGEAR hIGear, 
        const LPAT_RECT lpRect, 
        const DOUBLE rescale_slope, 
        const DOUBLE rescale_intercept, 
        const LONG lReserved_option, 
        LPLONG lpWindow_center, 
        LPLONG lpWindow_width);

Arguments:

hIGear The HIGEAR handle to the image to convert.
lpRect Use this AT_RECT structure to specify the rectangular portion of the image for which to optimize the contrast on; set to NULL for the whole image. Please see the ImageGear User's Manual if you are unfamiliar with this structure.
rescale_slope Set to the value of the Data Element, Rescale Slope (0028,1053). You can use MED_DCM_DS_Rescale_get() to obtain this value. If this Data Element is not present in the Data Set, please set this value to 1.0.
rescale_intercept Set to the value of the Data Element, Rescale Intercept (0028,1054). You can useMED_DCM_DS_Rescale_get() to obtain this value. If this Data Element is not present in the Data Set, please set this value to 0.0.
lReserved_option Reserved for future use; please set to 0 for now
lpWindow_center A far pointer that returns a LONG for the Window Center ; set to NULL if you don't need this information.
lpWindow_width A far pointer that returns a LONG for the Window Width ; set to NULL if you don't need this information.
lpSigned A far pointer that returns a BOOL value indicating whether the value is signed or not.

Return Value:

Returns the number of ImageGear errors that occurred during the function call.

Supported Raster Image Formats:

Grayscale – 8…32 bpp.

Example:

  Copy Code
HIGEAR hIGear;
DOUBLE          fRescaleSlope = 1.0;
DOUBLE          fRescaleIntercept = 1.0;
DOUBLE          fGama = 1.0;
LONG            WindowWidth;
LONG            WindowCenter;
MED_display_contrast_auto(hIGear, NULL, fRescaleSlope, 
                        fRescaleIntercept, fGamma, 0, &WindowCenter,  
                                                    &WindowWidth);

Remarks:

The rectangular portion of the image that you specify (or the whole image) is scanned and the maximum and minimum pixel values are determined; the Window Center and Width are calculated from these.

If the Rescale Slope and Intercept of the image are known, you should provide them. If they are not known, pass in a 1.0 and 0.0, respectively.

The Window Center and Width that this function computes are passed back to you in lpWindow_center and lpWindow_width, unless you set these arguments to NULL.

This function does not cause the image to be displayed or repainted. It only fills the 16x8 LUT. To display the results of this function, use IG_dspl_image_draw().

See also MED_display_contrast().

Since this function must scan the pixels for the minimum and maximum values, it takes more time to run than IG_display_contrast().
©2012. Accusoft Corporation. All Rights Reserved.