Skip to content

Support NiiVue 1.0 (keeps 0.6 support) - #35

Open
neurolabusc wants to merge 1 commit into
mpsych:mainfrom
rordenlab:niivue-1.0
Open

neurolabusc wants to merge 1 commit into
mpsych:mainfrom
rordenlab:niivue-1.0

Conversation

@neurolabusc

Copy link
Copy Markdown

NiiVue 1.0 changes several APIs that Boostlet relies on (for example, getVolumeData is gone and the viewer is often not on window), so the NiiVue examples stopped working with it. This PR makes Boostlet and every NiiVue example work with both the new 1.0 API and the widely used 0.6 API, and adds four 1.0 screenshot tests. Pages that keep NiiVue inside a module can pass it in with Boostlet.init('niivue', nv). It also cleans up the leftover Segment Anything tests, whose example and model server no longer exist. Gotchas: 1.0 support is tested against the release candidate 1.0.0-rc.237, so the final release may need small updates. Merging deploys straight to boostlet.org, so all bookmarklet users get this immediately. The CI screenshot job currently can't start Chrome yet still reports success, so its green check doesn't cover these tests; they were run locally instead.

NiiVue adapter works with 0.6 and 1.0rc: detection (incl. web components
and Boostlet.init('niivue', nv)), 1.0 getCanvasImage capture with bounded
views, RAS voxel reader replacing the removed getVolumeData, and the
upstream voxel API (get_plane, get_crosshair_vox, get_scaling,
get_display_flip, on_location_change) on both versions. On 1.0, slice
clicks report no axCorSag, so the clicked panel comes from hitTest.

Examples on both versions: sync (incl. 3D camera; also fixes clip plane
read on NiiVue 0.66), numpyBoostlet, brainchop (rebuilt on
@brainchop/mindgrab), trako, meshAR, fibersAR, imageCaptioning (HF
chat-completions vision model, token asked at run time).

Security: exact Dropbox host, https-only and confirmed scene redirects,
OAuth popup origin check.

Tests: NiiVue pages run examples against the local build; 1.0 test page
and ground truths. Dead Segment Anything example removed.
@bronsdonayden

Copy link
Copy Markdown
Contributor

Thanks a lot for the PR Dr. Rorden! I've been meaning to get 1.0 support in for a while but have been busy with the paper and other school work, so thanks for doing my work for me haha

Just sent you an email with my current manuscript attached, would really appreciate any feedback if you get the chance.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants