ImageGear for C and C++ on Linux v20.0 - Updated
API Reference Guide > MD Component API Reference > MD Component Functions Reference > Data Set Functions > MED_DCM_DS_Window_Level_get
This function has been deprecated and will be removed from the public API in a future release. Use MED_DCM_DS_Window_Level_get_double instead.

This function searches the Data Set of the HIGEAR image for the Window Width and Window Center Data Elements.


Copy Code
        const HIGEAR hIGear,
        LPLONG lpWindow_Width, 
        LPLONG lpWindow_Center, 
        LPBOOL lpFound


Name Type Description
hIGear const HIGEAR HIGEAR handle to the image from which you would like to retrieve the Window Level values.
lpWindow_Width LPLONG Returns the value of the Window Level Width Data Element (0028,1051).
lpWindow_Center LPLONG Returns the value of the Window Level Center Data Element (0028,1050).
lpFound LPBOOL Returns TRUE if both of these DEs are found in the Data Set; returns FALSE if one or the other is missing from the Data Set. Set to NULL if you do not need this information.

Return Value:

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

Supported Raster Image Formats:

This function does not process image pixels.

The image must have a DICOM DataSet attached to it. Use MED_DCM_DS_exists to check whether the image contains a DataSet.


Copy Code
AT_ERRCOUNT              nErrcount;
HIGEAR          hIGear;
LONG            lWindow_min, lWindow_max;
nErrcount = MED_DCM_DS_Window_Level_get(hIGear, &lWindow_min, &lWindow_max,     NULL);


This function is a shortcut that was created because the values of these Data Elements are often sought after. You could perform this same operation, as you would for getting the information from any DE, by using MED_DCM_DS_move_find() and MED_DCM_DS_curr_data_get().

If both are found they are returned and lpFound is set to TRUE. If one or both of these DEs are not found, lpFound is set to FALSE and ImageGear attempts to calculate adequate values for both Width and Center to display all pixels in the image.

For 17-32 bits per pixel images, please use MED_DCM_DS_Window_Level_get_64().

Is this page helpful?
Yes No
Thanks for your feedback.