Add VTK-free HTML surface reports and threemica bridge#168
Draft
zihuaihuai wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Video preview
Watch/download the MP4 preview
The video is committed in this PR at
docs/_static/brainspace_threemica_bridge_preview.mp4and is referenced fromREADME.rst. It was generated withwrite_brainspace_threemica_report(...)from BrainSpace bundled Conte69/fsLR-32k reference surfaces and maps.Summary
This PR adds a display-independent HTML reporting path for BrainSpace surface
maps. The existing VTK plotting backend remains the default, while users in
remote notebooks, containers, CI runners, and headless servers can now export
portable browser reports without initializing a VTK render window.
It also adds an optional adapter for Zhengchen Cai's
threemicapackage.BrainSpace prepares compatible surface/map inputs and delegates report
generation to threemica, preserving threemica's original HTML template,
JavaScript viewer, controls, atlas/query payloads, and output layout.
Reviewer highlights
Video preview added to the README:
docs/_static/brainspace_threemica_bridge_preview.mp4BrainSpace's bundled Conte69/fsLR-32k reference surfaces and maps.
between cortical thickness, functional connectivity gradient 1, and MPC
gradient 1.
Main bridge function used in the README:
Implementation entry point:
brainspace/plotting/threemica_report.pywrite_brainspace_threemica_report(...)derivative tree and then delegates rendering to
threemica.run.Changes
brainspace.plotting.write_surface_reportfor self-contained HTMLreports from left/right surfaces and one or more scalar maps.
plot_hemispheres(..., backend="html", filename=...)as a smallcompatibility path for existing plotting code that wants HTML export.
brainspace.plotting.write_threemica_reportas a thin optionaldependency adapter around
threemica.run.brainspace.plotting.write_brainspace_threemica_reportto exportBrainSpace bundled Conte69 fsLR-32k maps through the original threemica
viewer.
brainspace.plotting.available_threemica_surface_mapsto expose thebuilt-in map tags and metadata.
maps="all"maps="markers"maps="gradients"custom_mapsarrays, including multi-component arrays exportedcolumn-wise
headless plotting guidance.
Conte69/fsLR-32k reference maps through the new threemica bridge.
sub-brainspacerefso the generated preview path is not mistaken forparticipant data.
sphinx-tabsextension can build with newer Sphinx versions that renamed
add_javascripttoadd_js_file.plot_hemispheresHTML export,threemica delegation, built-in/custom map selection, and import hygiene.
Notes
threemicais not vendored into BrainSpace. It remains an optional externaldependency.
plot_hemispheresandexisting plotting workflows.
vtkorbrainspace.plotting.base.generated from BrainSpace package data.
Verification
Result:
Fresh-process import hygiene:
Result:
Browser verification:
maps with the current bridge code.
report page with no console errors.
README/video verification:
Result: