surface
tit.plotting.nilearn.surface ¶
Render fsaverage surface field/stat maps on the inflated cortex.
The :class:~tit.plotting.nilearn.visualizer.NilearnVisualizer renders MNI
volumes (optionally projected onto a surface). This module is the missing
counterpart: it paints a per-vertex fsaverage array -- a group-mean field, a
t/r map, or a thresholded significant-cluster mask -- directly on the
fsaverage inflated surface (lateral + medial, both hemispheres), the layout
used for cortical group figures.
Inputs are the (n_vertices,) arrays produced by
:func:tit.source.project_fields_to_fsaverage (per-subject field caches) and by
:mod:tit.stats.surface (group surface_maps.npz). The vertex order is
[lh; rh], matching nilearn's left/right hemispheres.
See Also¶
tit.plotting.nilearn.visualizer.NilearnVisualizer : Volume / volume-to-surface.
tit.stats.surface : Produces the surface stats .npz rendered here.
render_fsaverage_map ¶
render_fsaverage_map(values, spacing: int = 5, *, title: str | None = None, threshold: float | None = None, cmap: str = 'cold_hot', symmetric_cbar: bool | str = 'auto', out_path: str | None = None)
Paint a (n_vertices,) fsaverage map on the inflated cortex.
Parameters¶
values : array-like
Per-vertex values in [lh; rh] order, length _FSAVG_NODES[spacing].
spacing : int
fsaverage subdivision factor (5, 6, or 7).
title : str, optional
Figure suptitle.
threshold : float, optional
Hide |value| < threshold (e.g. to show only significant vertices).
cmap : str
Matplotlib/nilearn colormap. cold_hot suits signed t/r maps;
use a sequential map (e.g. "inferno") for magnitude fields.
symmetric_cbar : bool or "auto"
Passed to nilearn; keep signed maps symmetric about zero.
out_path : str, optional
If given, save the figure there and return the path; else return the
Matplotlib figure.
Returns¶
str or matplotlib.figure.Figure The saved path (when out_path is given) or the figure.
Source code in tit/plotting/nilearn/surface.py
render_surface_stats_result ¶
Render a :mod:tit.stats.surface surface_maps.npz to PDFs.
Paints the effect map (signed r if present, else t) and the
thresholded significant-cluster mask onto the inflated cortex. spacing is
inferred from the array length when not given.
Returns¶
list of str Paths of the figures written into out_dir.