import NiiVue from '@niivue/niivue'
const webgpuCheck = document.getElementById('webgpuCheck')
webgpuCheck.onclick = function () {
nv1.reinitializeView({ backend: this.checked ? 'webgpu' : 'webgl2' })
thumbnail: '/volumes/thumbnail.png',
nv1.addEventListener('locationChange', (e) => {
document.getElementById('location').innerHTML =
` ${e.detail.string}`
await nv1.attachToCanvas(document.getElementById('gl1'))
await nv1.loadVolumes([{ url: '/volumes/mpld_asl.nii.gz' }])
document.getElementById('toggleBtn').onclick = () => {
nv1.isThumbnailVisible = !nv1.isThumbnailVisible