def get_slope_and_intercept_from_pdcm(dcmdata):
    """
    Get scale and intercept from pydicom file object.
    :param dcmdata:
    :return:
    """

    if hasattr(dcmdata, "RescaleSlope") and hasattr(dcmdata, "RescaleIntercept"):
        rescale_slope = dcmdata.RescaleSlope
        rescale_intercept = dcmdata.RescaleIntercept
        slope, inter = get_slope_and_intercept_from_strings(rescale_slope, rescale_intercept)
    else:
        slope = 1
        inter = 0

    return slope, inter