ImageGear for C and C++ on Linux v18.10 - Updated
MED_DCM_DS_Rescale_get
API Reference Guide > MD Component API Reference > MD Component Functions Reference > Data Set Functions > MED_DCM_DS_Rescale_get

This function will search the DICOM Data Set of the HIGEAR image and return the value from Rescale Slope (0028,1053) and Rescale Intercept (0028,1054).

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI MED_DCM_DS_Rescale_get(
        const HIGEAR hIGear, 
        LPDOUBLE lpRescale_Slope, 
        LPDOUBLE lpRescale_Intercept, 
        LPBOOL lpFound
);

Arguments:

Name Type Description
hIGear const HIGEAR Set to the HIGEAR handle of the image from which you would like to retrieve the Rescale values.
lpRescale_Slope LPDOUBLE Returns you the value of the Rescale Slope Data Element as a DOUBLE. The Tag value of this DE is (0028,1053).
lpRescale_Intercept LPDOUBLE Returns you the value of the Rescale Intercept Data Element as a DOUBLE. The Tag value of this DE is (0028,1054).
lpFound LPBOOL Returns whether or not these two Data Elements were found/present in the image's Data Set.

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.

Example:

 
Copy Code
AT_ERRCOUNT nErrcount;
HIGEAR hIGear;
DOUBLE RescaleSlope, RescaleIntercept;
nErrcount = MED_DCM_DS_Rescale_get(hIGear, &RescaleSlope, &RescaleIntercept, NULL);

Remarks:

This function is a short cut 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 of these DEs are found in the Data Set, then lpFound returns TRUE. If one or both are missing then lpFound will return FALSE, lpRescale_slope will return 1.0, and lpRescale_intercept will return 0.0. lpFound can be set to NULL if you do not need to know if they are found or not. The returned slope and interface values returned are always usable even if they are not found in the Data Set.

Both this function and MED_DCM_DS_Window_Level_get() should be called before displaying an image using MED_display_contrast().