@niivue/niivue 0.24.2 → 0.24.3

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.24.2",
3
+ "version": "0.24.3",
4
4
  "description": "minimal webgl2 nifti image viewer",
5
5
  "main": "./src/niivue.js",
6
6
  "unpkg": "./dist/niivue.umd.js",
@@ -41,7 +41,7 @@ colortables.prototype.colormap = function (lutName = "") {
41
41
  }; // colormap()
42
42
 
43
43
  colortables.prototype.colormapFromKey = function (name) {
44
- let availMaps = luts.colorMaps(); //DoDo let availMaps = this.colorMaps();
44
+ let availMaps = luts.colorMaps(); //ToDo let availMaps = this.colorMaps();
45
45
  for (let i = 0; i < availMaps.length; i++) {
46
46
  let key = availMaps[i];
47
47
  if (name.toLowerCase() === key.toLowerCase()) {
@@ -37,6 +37,7 @@
37
37
  <option value="9">Filled Red</option>
38
38
  <option value="10">Filled Green</option>
39
39
  <option value="11">Filled Blue</option>
40
+ <option value="12">Erase Selected Cluster</option>
40
41
  </select>
41
42
  <button id="left">left</button>
42
43
  <button id="right">right</button>
@@ -79,7 +80,6 @@
79
80
  }
80
81
  document.getElementById("check1").addEventListener("change", doCheckClick);
81
82
  function doCheckClick() {
82
- console.log(this.checked);
83
83
  nv1.drawFillOverwrites = this.checked;
84
84
  }
85
85
  document.getElementById("drawPen").addEventListener("change", doDrawPen);
@@ -88,6 +88,8 @@
88
88
  nv1.setDrawingEnabled(mode >= 0);
89
89
  if (mode >= 0)
90
90
  nv1.setPenValue( (mode & 7), mode > 7);
91
+ if (mode === 12)//erase selected cluster
92
+ nv1.setPenValue(-0);
91
93
  }
92
94
  document.getElementById("left").addEventListener("click", doLeft);
93
95
  function doLeft(){
@@ -178,7 +180,7 @@
178
180
  //nv1.setInterpolation(1);
179
181
  await nv1.loadVolumes(volumeList1)
180
182
  nv1.getDescriptives(0, false);
181
- nv1.loadDrawing("../demos/images/lesion.nii.gz");
183
+ await nv1.loadDrawing("../demos/images/lesion.nii.gz");
182
184
  // example of using the 'location' change event with a callback function
183
185
  nv1.on('location', (data) => {
184
186
  // data is an object with properties: {mm: [N N N], vox: [N N N], frac: [N N N]}