Skip to content

Commit

Permalink
update niivue to 0.44.2
Browse files Browse the repository at this point in the history
requires a mesh layer loading change
  • Loading branch information
Korbinian Eckstein committed Aug 6, 2024
1 parent 815ae10 commit ed342f1
Show file tree
Hide file tree
Showing 3 changed files with 896 additions and 1,036 deletions.
14 changes: 7 additions & 7 deletions niivue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"watch": "vite build --watch"
},
"dependencies": {
"@niivue/niivue": "0.43.1",
"@niivue/niivue": "0.44.2",
"@preact/signals": "^1.2.2",
"htm": "^3.1.1",
"preact": "^10.19.6",
Expand All @@ -23,21 +23,21 @@
},
"devDependencies": {
"@babel/core": "^7.24.0",
"@playwright/test": "1.43.0",
"@playwright/test": "^1.46.0",
"@preact/preset-vite": "^2.8.2",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/preact": "^3.2.3",
"@types/node": "^20.11.28",
"@vitest/ui": "^1.4.0",
"@types/node": "^22.1.0",
"@vitest/ui": "^2.0.5",
"autoprefixer": "^10.4.18",
"jsdom": "^24.0.0",
"less": "^4.1.3",
"postcss": "^8.4.36",
"tailwindcss": "^3.4.1",
"typescript": "^5.4.2",
"vite": "5.2.8",
"vite-plugin-pwa": "^0.19.4",
"vitest": "^1.4.0",
"vite": "^5.3.5",
"vite-plugin-pwa": "^0.20.1",
"vitest": "^2.0.5",
"workbox-build": "^7.0.0",
"workbox-window": "^7.0.0"
}
Expand Down
8 changes: 7 additions & 1 deletion niivue/src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ async function addMeshOverlay(nv: Niivue, item: any, type: string) {
}
item.data = await response.arrayBuffer()
}
NVMeshLoaders.readLayer(
const newLayer = NVMeshLoaders.readLayer(
item.uri,
item.data,
mesh,
Expand All @@ -157,6 +157,12 @@ async function addMeshOverlay(nv: Niivue, item: any, type: string) {
a.calMax,
)

if (newLayer) {
nv.meshes[0].layers.push(newLayer)
} else {
throw Error('Layer could not be loaded')
}

mesh.updateMesh(nv.gl)
nv.opts.isColorbar = true
nv.updateGLVolume()
Expand Down
Loading

0 comments on commit ed342f1

Please sign in to comment.