LT-319: Fix window width bug in RGB and UInt16 shaders

This commit is contained in:
Erik Ziegler committed 2016-11-15 08:25:09 +01:00
1 parent 8631c70e4f
commit 57b0d50c28
1 file changed
+3 -3
@@ -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