Viewing bundles#
mpat.view returns an ipyniivue widget for Jupyter
(JupyterLab, Notebook 7, VS Code, Voila). It shows a 3-D render and three slices. Each
bundle’s density is drawn on a log scale from 1e-3 of its peak (in the 3-D render, ray-marched
by NiiVue’s volume renderer), and its core as a tube:
import mpat
mpat.view(f"{output_dir}/mpat", t1=t1_masked, bundles=["LeftArcuate", "LeftCorticospinal"])
Visitation-ODF glyphs#
With glyphs=True (or a list of bundle names), the viewer also draws the visitation ODFs as
glyphs, like fODF glyphs. Where the fODF has a crossing, the glyph shows only the lobe the
bundle uses (Figure 13). Glyphs follow the slices: every voxel at or above
glyph_floor (1e-2 of the peak) on the three slices through the crosshair gets one, redrawn
as you click or scroll. The slices start at the core’s midpoint.
option |
|
|---|---|
|
an SH image on the same grid (pyAFQ’s |
|
start the slices elsewhere (mm); |
|
size glyphs by visits instead of normalising each one |
|
|
|
the faintest density shown, as a fraction of each bundle’s peak |
|
how the density’s opacity drops off: 0 at |
|
NiiVue colour map of every density, e.g. |
|
display settings |
A standalone web page#
mpat.save_html("bundles.html", folder, glyphs=True)
writes the same scene as a standalone web page, to open in any browser or share. The page has controls for:
the layout
each bundle’s density, core and glyphs
the opacities
whether scrolling moves the slices or zooms
The data are embedded, and the page meshes the glyphs itself. NiiVue loads from a CDN; pass
niivue_js= a local niivue.umd.js (npm @niivue/niivue, dist/) to embed it and work
offline.