Permalink
Browse files

X.parserRAW works with compressed and uncompressed data when using UR…

…Ls ending in .RAW or .RZ.
  • Loading branch information...
haehn committed Feb 27, 2014
1 parent a2d2d11 commit 70bd9fa76636c3549ed000b573ac4c093698cf06
Showing with 10 additions and 8 deletions.
  1. +1 −1 io/parser.js
  2. +5 −5 io/parserRAW.js
  3. +1 −0 lib/zlib.js/inflate.js
  4. +1 −1 lib/zlib.js/zlib.js
  5. +2 −1 xtk-deps.js
View
@@ -920,7 +920,7 @@ X.parser.reslice2 = function(_sliceOrigin, _sliceXYSpacing, _sliceNormal, _color
textureForCurrentSlice[textureStartIndex] = pixelValue_r;
textureForCurrentSlice[++textureStartIndex] = pixelValue_g;
textureForCurrentSlice[++textureStartIndex] = pixelValue_b;
textureForCurrentSlice[++textureStartIndex] = pixelValue_a;
textureForCurrentSlice[++textureStartIndex] = pixelValue_a;
}
else {
View
@@ -33,7 +33,7 @@ goog.require('X.object');
goog.require('X.parser');
goog.require('X.triplets');
goog.require('goog.math.Vec3');
goog.require('Zlib.Gunzip');
goog.require('Zlib.Inflate');
/**
* Create a parser for .RAW files. This means just a byte stream.
*
@@ -64,25 +64,25 @@ X.parserRAW.prototype.parse = function(container, object, data, flag) {
if (b_zipped) {
// we need to decompress the datastream
// here we start the unzipping and get a typed Uint8Array back
var inflate = new Zlib.Gunzip(new Uint8Array(_data));
var inflate = new Zlib.Inflate(new Uint8Array(_data));
_data = inflate.decompress();
// .. and use the underlying array buffer
_data = _data.buffer;
}
var MRI = {};
MRI.data = new Uint8Array(_data);
// grab the min, max intensities
// get the min and max intensities
var min_max = this.arrayMinMax(MRI.data);
var min = min_max[0];
var max = min_max[1];
var _dimensions = object._dimensions;
// attach the scalar range to the volume
object._min = object._windowLow = min;
object._max = object._windowHigh = max;
MRI.min = object._min = object._windowLow = min;
MRI.max = object._max = object._windowHigh = max;
// .. and set the default threshold
// only if the threshold was not already set
if (object._lowerThreshold == -Infinity) {
View
@@ -36,6 +36,7 @@ var ZLIB_INFLATE_EXPORT = false;
goog.require('Zlib');
goog.require('Zlib.Adler32');
goog.require('Zlib.RawInflate');
goog.require('Zlib.Util');
goog.scope(function() {
View
@@ -36,7 +36,7 @@ goog.provide('Zlib');
// -----------------------------------------------------------------------------
goog.require('Zlib.Deflate');
goog.require('Zlib.Inflate');
// goog.require('Zlib.Inflate');
goog.scope(function() {
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 70bd9fa

Please sign in to comment.