From 57b0d50c2846c7ffeb902b73d5e84466d5a11f7d Mon Sep 17 00:00:00 2001 From: Erik Ziegler Date: Fri, 11 Nov 2016 11:46:33 +0100 Subject: [PATCH] LT-319: Fix window width bug in RGB and UInt16 shaders --- Packages/ohif-cornerstone/client/cornerstone.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Packages/ohif-cornerstone/client/cornerstone.js b/Packages/ohif-cornerstone/client/cornerstone.js index 0592b267e..d5b370739 100644 --- a/Packages/ohif-cornerstone/client/cornerstone.js +++ b/Packages/ohif-cornerstone/client/cornerstone.js @@ -1,4 +1,4 @@ -/*! cornerstone - v0.9.0 - 2016-02-12 | (c) 2014 Chris Hafey | https://github.com/chafey/cornerstone */ +/*! cornerstone - v0.9.0 - 2016-11-11 | (c) 2014 Chris Hafey | https://github.com/chafey/cornerstone */ if(typeof cornerstone === 'undefined'){ cornerstone = { internal : {}, @@ -2749,7 +2749,7 @@ if(typeof cornerstone === 'undefined'){ // Apply window settings 'float center0 = wc - 0.5 - minPixelValue;'+ - 'float width0 = ww - 1.0;'+ + 'float width0 = max(ww, 1.0);' + 'color = (color - center0) / width0 + 0.5;'+ // RGBA output @@ -2824,7 +2824,7 @@ if(typeof cornerstone === 'undefined'){ // Rescale based on slope and window settings 'intensity = intensity * slope + intercept;'+ 'float center0 = wc - 0.5;'+ - 'float width0 = ww - 1.0;'+ + 'float width0 = max(ww, 1.0);' + 'intensity = (intensity - center0) / width0 + 0.5;'+ // Clamp intensity