From 401fc3365ee162c8434a8184b7a7398a3284d9f1 Mon Sep 17 00:00:00 2001 From: Eduardo Pinho Date: Tue, 15 Feb 2022 13:53:21 +0000 Subject: [PATCH 1/2] Fix undeclared variables - pixelValue_* in parser.js - r,g,b in dicomUtils.js --- core/dicomUtils.js | 2 ++ io/parser.js | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/dicomUtils.js b/core/dicomUtils.js index e5b0dd694..09a599896 100644 --- a/core/dicomUtils.js +++ b/core/dicomUtils.js @@ -161,6 +161,8 @@ X.dicomUtils.initColorTableFromLUT = function (img, colorTable, lut) { offset = Math.pow(2, img.pixelPaddingValue != null ? img.bits : (rs == 1.0 && ri == 0.0 && img.pixelPaddingValue == null) ? img.bits : img.bitsStored) / 2; } + var r, g, b; + // console.time('CALCULATE PIXELS'); switch (img.photometricInterpretation) { case X.dicomUtils.PhotometricInterpretation.MONOCHROME1: diff --git a/io/parser.js b/io/parser.js index 27b42b97d..906a598b5 100644 --- a/io/parser.js +++ b/io/parser.js @@ -902,19 +902,20 @@ X.parser.reslice2 = function(_sliceOrigin, _sliceXYSpacing, _sliceNormal, _color // map to 0 if necessary var pixval = _IJKVolume[_k][_j][_i]; + var pixelValue_r, pixelValue_g, pixelValue_b, pixelValue_a; if (colorTable) { // color table! var lookupValue = colorTable.get(pixval); // check for out of range and use the last label value in this case - var pixelValue_r = pixelValue_g = pixelValue_b = lookupValue[1] || 0; - var pixelValue_a = lookupValue[4]; + pixelValue_r = pixelValue_g = pixelValue_b = lookupValue[1] || 0; + pixelValue_a = lookupValue[4]; } else { // normalization should not happen here, only in the shaders/canvas?? - var pixelValue_r = pixelValue_g = pixelValue_b = 255 * ((pixval - object._min )/ (object._max - object._min)); - var pixelValue_a = 255; + pixelValue_r = pixelValue_g = pixelValue_b = 255 * ((pixval - object._min )/ (object._max - object._min)); + pixelValue_a = 255; } textureForCurrentSlice[textureStartIndex] = pixelValue_r; From 7fd258eb003a444f456703c0410654750b0c6b7a Mon Sep 17 00:00:00 2001 From: Eduardo Pinho Date: Tue, 15 Feb 2022 13:53:40 +0000 Subject: [PATCH 2/2] Build in compiled output mode --- utils/_core/_builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/_core/_builder.py b/utils/_core/_builder.py index af364fd7b..abc232e4a 100644 --- a/utils/_core/_builder.py +++ b/utils/_core/_builder.py @@ -44,7 +44,7 @@ def run( self, options=None ): arguments.extend( ['--root', config.SOFTWARE_PATH] ) # set the output mode to compiled - arguments.extend( ['-o', 'script'] ) + arguments.extend( ['-o', 'compiled'] ) # configure the compiler path arguments.extend( ['-c', config.CLOSURECOMPILER_PATH] )