@niivue/niivue 0.22.1 → 0.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -38,7 +38,7 @@ We host many NiiVue examples via github pages. These are updated and deployed au
38
38
 
39
39
  ## existing html page
40
40
  ```html
41
- <script src="https://unpkg.com/@niivue/niivue@0.22.1/dist/niivue.umd.js"></script>
41
+ <script src="https://unpkg.com/@niivue/niivue@0.22.2/dist/niivue.umd.js"></script>
42
42
 
43
43
  <canvas id="gl" height=480 width=640></canvas>
44
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@niivue/niivue",
3
- "version": "0.22.1",
3
+ "version": "0.22.2",
4
4
  "description": "minimal webgl2 nifti image viewer",
5
5
  "main": "./src/niivue.js",
6
6
  "unpkg": "./dist/niivue.umd.js",
package/src/niivue.js CHANGED
@@ -462,6 +462,8 @@ Niivue.prototype.calculateNewRange = function (volIdx = 0) {
462
462
  if (this.sliceType === this.sliceTypeRender) {
463
463
  return;
464
464
  }
465
+ if ((this.dragStart[0] === this.dragEnd[0]) && (this.dragStart[1] === this.dragEnd[1]))
466
+ return;
465
467
  // calculate our box
466
468
  let frac = this.canvasPos2frac([this.dragStart[0], this.dragStart[1]]);
467
469
  let startVox = this.frac2vox(frac, volIdx);
@@ -508,7 +510,7 @@ Niivue.prototype.calculateNewRange = function (volIdx = 0) {
508
510
  }
509
511
  }
510
512
  }
511
-
513
+ if (lo >= hi) return; //no variability or outside volume
512
514
  var mnScale = intensityRaw2Scaled(hdr, lo);
513
515
  var mxScale = intensityRaw2Scaled(hdr, hi);
514
516
  this.volumes[volIdx].cal_min = mnScale;
@@ -3006,9 +3008,14 @@ Niivue.prototype.draw3D = function () {
3006
3008
  }
3007
3009
  }
3008
3010
 
3009
- this.drawCrosshairs3D(true, 1.0);
3010
- this.drawCrosshairs3D(false, 0.35);
3011
-
3011
+ if (this.opts.show3Dcrosshair) {
3012
+ this.drawCrosshairs3D(true, 1.0);
3013
+ this.drawCrosshairs3D(false, 0.35);
3014
+ } else {//??? reset standard buffer - to test, try the basic.3d.html (which disables crosshairs and right click) - not sure WHAT is being drawn
3015
+ this.gl.enableVertexAttribArray(0);
3016
+ this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.cuboidVertexBuffer);
3017
+ this.gl.vertexAttribPointer(0, 3, this.gl.FLOAT, false, 0, 0);
3018
+ }
3012
3019
  let posString =
3013
3020
  "azimuth: " +
3014
3021
  this.scene.renderAzimuth.toFixed(0) +