ImageGear for C and C++ on Linux v18.10 - Updated
MED_IP_contrast_double
API Reference Guide > MD Component API Reference > MD Component Functions Reference > Image Processing Functions > MED_IP_contrast_double

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

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI MED_IP_contrast_double(
        HIGEAR hIGear, 
        const DOUBLE rescale_slope, 
        const DOUBLE rescale_intercept, 
        const DOUBLE window_center, 
        const DOUBLE 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 DOUBLE Set to the desired value for Window Center (0028,1050). Call MED_DCM_DS_Window_Level_get_double() to obtain this value.
window_width const DOUBLE Set to the desired value for Window Width (0028,1051). Call MED_DCM_DS_Window_Level_get_double() 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_double() is that this function permanently alters the pixel values.

See also MED_display_contrast_double().

The functionality of MED_IP_window_level() has been incorporated into the new function MED_IP_contrast_double(), which also takes settings for Rescale Slope, Rescale Intercept, and gamma correction.