Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Xtk for production #3

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions core/dicomUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 5 additions & 4 deletions io/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion utils/_core/_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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] )
Expand Down