Permalink
Browse files

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

…Ls ending in .RAW or .RZ.
  • Loading branch information...
1 parent a2d2d11 commit 70bd9fa76636c3549ed000b573ac4c093698cf06 @haehn haehn committed Feb 27, 2014
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) {
@@ -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
@@ -16,7 +16,7 @@ goog.addDependency('../../../../injects/thresholdable.js', ['X.thresholdable'],
goog.addDependency('../../../../io/interactor.js', ['X.interactor'], ['X.base', 'X.event', 'X.event.HoverEndEvent', 'X.event.HoverEvent', 'X.event.PanEvent', 'X.event.ResetViewEvent', 'X.event.RotateEvent', 'X.event.ZoomEvent', 'goog.dom', 'goog.events', 'goog.events.BrowserEvent.MouseButton', 'goog.events.EventType', 'goog.events.KeyHandler', 'goog.events.MouseWheelHandler', 'goog.math.Vec3']);
goog.addDependency('../../../../io/interactor2D.js', ['X.interactor2D'], ['X.event.ScrollEvent', 'X.interactor']);
goog.addDependency('../../../../io/interactor3D.js', ['X.interactor3D'], ['X.interactor']);
-goog.addDependency('../../../../io/loader.js', ['X.loader'], ['X.base', 'X.event', 'X.object', 'X.parserCRV', 'X.parserDCM', 'X.parserFSM', 'X.parserIMAGE', 'X.parserLBL', 'X.parserLUT', 'X.parserMGZ', 'X.parserNII', 'X.parserNRRD', 'X.parserOBJ', 'X.parserOFF', 'X.parserSTL', 'X.parserTRK', 'X.parserVTK', 'goog.structs.Map']);
+goog.addDependency('../../../../io/loader.js', ['X.loader'], ['X.base', 'X.event', 'X.object', 'X.parserCRV', 'X.parserDCM', 'X.parserFSM', 'X.parserIMAGE', 'X.parserLBL', 'X.parserLUT', 'X.parserMGZ', 'X.parserNII', 'X.parserNRRD', 'X.parserOBJ', 'X.parserOFF', 'X.parserRAW', 'X.parserSTL', 'X.parserTRK', 'X.parserVTK', 'goog.structs.Map']);
goog.addDependency('../../../../io/parser.js', ['X.parser'], ['X.base', 'X.event', 'X.texture', 'X.triplets', 'goog.vec.Mat4', 'goog.vec.Vec3', 'goog.vec.Vec4']);
goog.addDependency('../../../../io/parserCRV.js', ['X.parserCRV'], ['X.event', 'X.parser', 'X.triplets']);
goog.addDependency('../../../../io/parserDCM.js', ['X.parserDCM'], ['X.event', 'X.object', 'X.parser', 'X.triplets', 'goog.math.Vec3']);
@@ -29,6 +29,7 @@ goog.addDependency('../../../../io/parserNII.js', ['X.parserNII'], ['X.event', '
goog.addDependency('../../../../io/parserNRRD.js', ['X.parserNRRD'], ['X.event', 'X.object', 'X.parser', 'X.triplets', 'Zlib.Gunzip', 'goog.math.Vec3', 'goog.vec.Vec4']);
goog.addDependency('../../../../io/parserOBJ.js', ['X.parserOBJ'], ['X.event', 'X.object', 'X.parser', 'X.triplets']);
goog.addDependency('../../../../io/parserOFF.js', ['X.parserOFF'], ['X.event', 'X.object', 'X.parser', 'X.triplets']);
+goog.addDependency('../../../../io/parserRAW.js', ['X.parserRAW'], ['X.event', 'X.object', 'X.parser', 'X.triplets', 'Zlib.Inflate', 'goog.math.Vec3']);
goog.addDependency('../../../../io/parserSTL.js', ['X.parserSTL'], ['X.event', 'X.parser', 'X.triplets']);
goog.addDependency('../../../../io/parserTRK.js', ['X.parserTRK'], ['X.event', 'X.parser', 'X.triplets', 'goog.math.Vec3']);
goog.addDependency('../../../../io/parserVTK.js', ['X.parserVTK'], ['X.event', 'X.object', 'X.parser', 'X.triplets']);

0 comments on commit 70bd9fa

Please sign in to comment.