ImageGear for C and C++ on Windows v19.2 - Updated
MED_IP_min_max_64
API Reference Guide > MD Component API Reference > MD Component Functions Reference > Image Processing Functions > MED_IP_min_max_64

This function scans an 17-32 bit grayscale image and returns the raw minimum and maximum pixel values and the "is signed" flag.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI MED_IP_min_max_64(
        const HIGEAR hIGear, 
        const LPAT_RECT lpRect, 
        LPAT_INT64 lpMin, 
        LPAT_INT64 lpMax, 
        LPBOOL lpSigned
);

Arguments:

Name Type Description
hIGear const HIGEAR The HIGEAR handle of the image to scan.
lpRect const AT_RECT Use this AT_RECT structure to specify the rectangular portion of the image to scan. Please see the ImageGear User's Manual if you are unfamiliar with this structure.
lpMin LPAT_INT64 A far pointer to a AT_INT64which returns the value of the minimum pixel value in the region that was "scanned".
lpMax LPAT_INT64 A far pointer to a AT_INT64 which returns the value of the maximum pixel value in the region that was "scanned".
lpSigned LPBOOL A far pointer to a BOOL which returns the status of the image sign. TRUE means the image is signed.

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;
AT_ERRCOUNT nErrcount;
AT_RECT rcROI;
AT_INT64 lMin, lMax;
BOOL bSigned;
nErrcount = MED_IP_min_max_64(hIGear, &rcROI, &lMin, &lMax, &bSigned);

Remarks:

If the image is signed, then the returned values are also signed. It is OK to use this function for 8-16 bit images too, but in 32 bit operation systems it can bring to insignificant slowdown of performance.

Note that this function returns the min and max raw pixel values. That is, the returned values are not corrected using the Modality LUT (Rescale Slope/Intercept) values. To apply this correction to the min and max values that you get from MED_IP_min_max_64() call the function MED_DCM_DS_Rescale_get() which will return you the values of Rescale Slope and Rescale Intercept. Then use the following formulas:

min_corrected = (min_raw * rescale_slope) + rescale_intercept;

max_corrected = (max_raw * rescale_slope) + rescale_intercept;

Some modalities of DICOM use signed images. So if you know whether the image is signed or unsigned will help you to interpret the minimum and maximum values.