# HG changeset patch # User Sebastien Jodogne # Date 1630321201 -7200 # Node ID 73a4bee08bb684698e5e8c7d9fc58d28ef3f26f8 # Parent 4026a458349de986e796453465b49e4b9c32f44d Support detection of windowing and rescale in Philips multiframe images diff -r 4026a458349d -r 73a4bee08bb6 Applications/StoneWebViewer/NEWS --- a/Applications/StoneWebViewer/NEWS Fri Aug 13 17:53:50 2021 +0200 +++ b/Applications/StoneWebViewer/NEWS Mon Aug 30 13:00:01 2021 +0200 @@ -1,6 +1,7 @@ Pending changes in the mainline =============================== +* Support detection of windowing and rescale in Philips multiframe images * Fix values reported in "ww/wc" info panel (windowing width and center) diff -r 4026a458349d -r 73a4bee08bb6 Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp --- a/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp Fri Aug 13 17:53:50 2021 +0200 +++ b/Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp Mon Aug 30 13:00:01 2021 +0200 @@ -1762,6 +1762,17 @@ } else { + if (GetViewport().windowingPresetCenters_.empty()) + { + // New in Stone Web viewer 2.2: Deal with Philips multiframe + // (cf. mail from Tomas Kenda on 2021-08-17) + double windowingCenter, windowingWidth; + message.GetDicom().GetDefaultWindowing(windowingCenter, windowingWidth, frameNumber_); + GetViewport().windowingPresetCenters_.push_back(windowingCenter); + GetViewport().windowingPresetWidths_.push_back(windowingWidth); + GetViewport().SetWindowingPreset(); + } + Apply(GetViewport(), message.GetDicom(), frame.release(), sopInstanceUid_, frameNumber_); if (isPrefetch_) @@ -1800,12 +1811,9 @@ } double rescaleIntercept, rescaleSlope; - if (tags.ParseDouble(rescaleIntercept, Orthanc::DICOM_TAG_RESCALE_INTERCEPT) && - tags.ParseDouble(rescaleSlope, Orthanc::DICOM_TAG_RESCALE_SLOPE)) - { - a *= rescaleSlope; - b = rescaleIntercept; - } + dicom.GetRescale(rescaleIntercept, rescaleSlope, frameNumber); + a *= rescaleSlope; + b = rescaleIntercept; converted.reset(new Orthanc::Image(Orthanc::PixelFormat_Float32, frameProtection->GetWidth(), frameProtection->GetHeight(), false)); Orthanc::ImageProcessing::Convert(*converted, *frameProtection);