@niivue/niivue 0.44.2 → 0.45.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@niivue/niivue",
3
- "version": "0.44.2",
3
+ "version": "0.45.0",
4
4
  "description": "minimal webgl2 nifti image viewer",
5
5
  "types": "./build/index.d.ts",
6
6
  "main": "./build/index.js",
Binary file
Binary file
package/src/index.html CHANGED
@@ -58,7 +58,30 @@
58
58
  class="slider"
59
59
  id="fiberCalMin"
60
60
  />
61
- <button id="about">About</button>
61
+ <label for="layoutSelect">Layout</label>
62
+ <select id="layoutSelect">
63
+ <option value="0" selected>Auto</option>
64
+ <option value="1">Column</option>
65
+ <option value="2">Grid</option>
66
+ <option value="3">Row</option>
67
+ </select>
68
+ <label for="renderingSelect">MultiplanarRendering</label>
69
+ <select id="renderingSelect">
70
+ <option value="0">Never</option>
71
+ <option value="1">Always</option>
72
+ <option value="2" selected>Auto</option>
73
+ </select>
74
+ <select id="sliceType">
75
+ <option value="0">Axial</option>
76
+ <option value="1">Coronal</option>
77
+ <option value="2">Sagittal</option>
78
+ <option value="4">Render</option>
79
+ <option value="3" selected>Multiplanar</option>
80
+ </select>
81
+ <label for="equalCheck">EqualSize</label>
82
+ <input type="checkbox" id="equalCheck" checked />
83
+ <label for="cornerCheck">CornerText</label>
84
+ <input type="checkbox" id="cornerCheck" unchecked />
62
85
  </header>
63
86
  <main id="canvas-container">
64
87
  <canvas id="gl1"></canvas>
@@ -107,16 +130,31 @@
107
130
  nv1.meshes[0].dpv[0].cal_min = this.value * 1; //*1 converts string to number
108
131
  nv1.setMeshProperty(nv1.meshes[0].id, "colormap", fiberColormap.value);
109
132
  };
110
- about.onclick = function () {
111
- window.alert(
112
- "The `Per Vertex` colors visualize a tsf format overlay created with tcksample",
113
- );
114
- };
133
+ layoutSelect.onchange = function () {
134
+ nv1.setMultiplanarLayout(Number(this.value));
135
+ }
136
+ renderingSelect.onchange = function () {
137
+ nv1.opts.multiplanarShowRender = Number(this.value);
138
+ nv1.drawScene();
139
+ }
140
+ equalCheck.onchange = function () {
141
+ nv1.opts.multiplanarEqualSize = this.checked
142
+ nv1.drawScene()
143
+ }
144
+ cornerCheck.onchange = function () {
145
+ //nv1.opts.isCornerOrientationText = this.checked\
146
+ nv1.setCornerOrientationText(this.checked)
147
+ }
148
+ sliceType.onchange = function () {
149
+ let st = parseInt(document.getElementById("sliceType").value);
150
+ nv1.setSliceType(st)
151
+ }
115
152
  var volumeList1 = [{ url: "../demos/images/mni152.nii.gz" }];
116
153
  let defaults = {
117
154
  backColor: [0, 0, 0, 1],
118
155
  show3Dcrosshair: true,
119
- loglevel: 'debug'
156
+ loglevel: 'debug',
157
+ isRuler: true
120
158
  };
121
159
  var nv1 = new Niivue(defaults);
122
160
  nv1.attachToCanvas(gl1);
@@ -152,6 +190,7 @@
152
190
  };
153
191
  cmapEl.appendChild(btn);
154
192
  }
193
+ equalCheck.onchange()
155
194
  </script>
156
195
  </body>
157
- </html>
196
+ </html>