# HG changeset patch # User Alain Mazy # Date 1586350194 -7200 # Node ID 09f091b6b569a052c0cff163efbfe1d215f02f84 # Parent 38b0f51781aa0c570839f3c8289573a26d9a26f6 /rendered route: fix automatic windowing of files without windowing tags and RescaleSlope != 1 diff -r 38b0f51781aa -r 09f091b6b569 OrthancServer/OrthancRestApi/OrthancRestResources.cpp --- a/OrthancServer/OrthancRestApi/OrthancRestResources.cpp Wed Apr 01 11:08:43 2020 +0200 +++ b/OrthancServer/OrthancRestApi/OrthancRestResources.cpp Wed Apr 08 14:49:54 2020 +0200 @@ -694,8 +694,8 @@ dicom.ParseFloat(rescaleIntercept, Orthanc::DICOM_TAG_RESCALE_INTERCEPT); } - windowWidth = static_cast(1 << info.GetBitsStored()); - windowCenter = windowWidth / 2.0f; + windowWidth = static_cast(1 << info.GetBitsStored()) * rescaleSlope; + windowCenter = windowWidth / 2.0f + rescaleIntercept; if (dicom.HasTag(Orthanc::DICOM_TAG_WINDOW_CENTER) && dicom.HasTag(Orthanc::DICOM_TAG_WINDOW_WIDTH))