From dc98311a6981abbe76c631aca97c69c03dfe3b9a Mon Sep 17 00:00:00 2001 From: neurolabusc Date: Wed, 15 May 2024 18:27:11 -0400 Subject: [PATCH] Save Scene button (almost functional) --- index.html | 6 ++++-- main.js | 5 ++++- package-lock.json | 8 ++++---- package.json | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 3aeba58..3adf240 100644 --- a/index.html +++ b/index.html @@ -22,7 +22,9 @@   - + +   +   @@ -49,7 +51,7 @@   - +   diff --git a/main.js b/main.js index e9de4bc..f3eb0b8 100644 --- a/main.js +++ b/main.js @@ -133,9 +133,12 @@ async function main() { runInference(opts, model, nv1.volumes[0].hdr, nv1.volumes[0].img, callbackImg, callbackUI) } } - saveBtn.onclick = function () { + saveImgBtn.onclick = function () { nv1.volumes[1].saveToDisk('Custom.nii') } + saveSceneBtn.onclick = function () { + nv1.saveDocument("brainchop.nvd"); + } workerCheck.onchange = function () { modelSelect.onchange() } diff --git a/package-lock.json b/package-lock.json index d3d43ad..41e2d4b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "niivue-brainchop", "version": "0.1.0", "dependencies": { - "@niivue/niivue": "^0.43.0", + "@niivue/niivue": "^0.43.2", "@tensorflow/tfjs": "^4.19.0", "gl-matrix": "^3.4.3" }, @@ -404,9 +404,9 @@ } }, "node_modules/@niivue/niivue": { - "version": "0.43.0", - "resolved": "https://registry.npmjs.org/@niivue/niivue/-/niivue-0.43.0.tgz", - "integrity": "sha512-qj2lx+F3xPcYvGHNPwxaI6pd2O3BKOD/r9eE28zjZlFNebFuu6bSODUOkb6sKH1CTp6QtncTkVSmejotgOyiMQ==", + "version": "0.43.2", + "resolved": "https://registry.npmjs.org/@niivue/niivue/-/niivue-0.43.2.tgz", + "integrity": "sha512-Uuz/SZCsyJlwzLiZDOP842rwvmZGCFwJw6LkQctJ0VNr7cRORd8Kbe8BfAo+SfZSqscBhT4G4mv46ZsjAaZthw==", "dependencies": { "@lukeed/uuid": "^2.0.1", "@ungap/structured-clone": "^1.2.0", diff --git a/package.json b/package.json index d8e5e7c..583d5e0 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "preview": "vite preview" }, "dependencies": { - "@niivue/niivue":"^0.43.0", + "@niivue/niivue":"^0.43.2", "@tensorflow/tfjs": "^4.19.0", "gl-matrix": "^3.4.3" },