ImageGear for C and C++ on Windows v20.3 - Updated
MED_IP_contrast
API Reference Guide > MD Component API Reference > MD Component Functions Reference > Image Processing Functions > MED_IP_contrast
This function has been deprecated and will be removed from the public API in a future release. Use MED_IP_contrast_double instead.

This function converts a 16-bit grayscale image to an 8-bit grayscale image in the same way as MED_display_contrast().

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI MED_IP_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 that will have 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 – 9…16 bpp.

Remarks:

The difference between this function and MED_display_contrast() is that this function permanently alters the pixel values.

See also MED_display_contrast().

The functionality of MED_IP_window_level() has been incorporated into the new function MED_IP_contrast(), which also takes settings for Rescale Slope, Rescale Intercept, and gamma correction.
Is this page helpful?
Yes No
Thanks for your feedback.