ImageData::regulate_wl

bool ImageData::regulate_wl(float& window, float& level, bool regulate_to_positive) {
    // CT should apply slope and intercept
    // MR has always slope(1) and intercept(0)
    if (_slope < DOUBLE_EPSILON) {
        return false;
    }

    if (regulate_to_positive && (_data_type == DT_SHORT || _data_type == DT_CHAR)) {
        const float min_gray = get_min_scalar();
        level = (level - _intercept - min_gray) / _slope;
    }
    else {
        level = (level - _intercept) / _slope;
    }

    window = window / _slope;

    return true;
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章