ImageGear for C and C++ on Windows v19.6 - Updated
MED_display_contrast
API Reference Guide > MD Component API Reference > MD Component Functions Reference > Display Functions > MED_display_contrast
This function has been deprecated and will be removed from the public API in a future release. Use MED_display_contrast_double instead.

This function uses the window/level mapping method to change the contrast of an 9-16-bit image.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI MED_display_contrast(
        HIGEAR hIGear, 
        const DOUBLE rescale_slope, 
        const DOUBLE rescale_intercept, 
        const LONG window_center, 
        const LONG window_width, 
        const DOUBLE gamma
);

Arguments:

Name Type Description
hIGear HIGEAR 16g image having its 16x8 LUT updated.
rescale_slope const DOUBLE Set to the desired value for Rescale Slope (0028,1053). Call MED_DCM_DS_Rescale_get() to obtain this value.
rescale_intercept const DOUBLE Set to the desired value for Rescale Intercept (0028,1054). Call MED_DCM_DS_Rescale_get() to obtain this value.
window_center const LONG Set to the desired value for Window Center (0028,1050). Call MED_DCM_DS_Window_Level_get() to obtain this value.
window_width const LONG Set to the desired value for Window Width (0028,1051). Call MED_DCM_DS_Window_Level_get() to obtain this value.
gamma const DOUBLE Set this to the amount of Gamma correction you would like applied to the image. To turn off Gamma correction, set to 1.0. The valid range of values is any DOUBLE between 0.20-1.80.

Return Value:

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

Supported Raster Image Formats:

Grayscale – 8…32 bpp.

Remarks:

It takes values for Window Center & Width, and Rescale Slope & Intercept, and it also allows you to apply Gamma correction, if you desire.

This function fills the 16x8 LUT with values that will display a 9-16 bit image according to VOI LUT (Window Center/Width) and Modality LUT (Rescale Intercept/Slope) values that you specify. Any values that have been in the 16x8 LUT are overwritten with these new ones.

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.

If you do not have values for Window Center and Window Width, these can be calculated using the minimum and maximum pixel values (if you have them known). Here are the formulas you should use to display all pixel values:

Window Center = (max + min) / 2;

Window Width = (max - min);

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_auto()