nirspipe.qc.figures.common._cortex

nirspipe.qc.figures.common._cortex#

Channel values projected onto the template’s cortex and rendered off-screen, without Qt.

Module Contents#

Functions#

project_to_cortex

(stc, subjects_dir): each column (a row per channel of raw) spread over the run’s template pial surface within 3 cm of the channels, as plot_glm_surface_projection does.

mne_lighting

MNE’s three camera lights in place of the headlight: below, upper left, upper right.

render_cortex

One RGB image per view of stc on its template’s pial surface, as stc.plot draws it.

API#

nirspipe.qc.figures.common._cortex.project_to_cortex(raw: mne.io.Raw, columns: numpy.ndarray) → tuple#

(stc, subjects_dir): each column (a row per channel of raw) spread over the run’s template pial surface within 3 cm of the channels, as plot_glm_surface_projection does.

weighted mode gives each vertex its sensors’ weights summing to one, so a column of ones projects to the share of a vertex the channels cover.

nirspipe.qc.figures.common._cortex.mne_lighting(plotter) → None#

MNE’s three camera lights in place of the headlight: below, upper left, upper right.

nirspipe.qc.figures.common._cortex.render_cortex(stc: mne.SourceEstimate, colour: Callable[[numpy.ndarray, numpy.ndarray], numpy.ndarray], subjects_dir, size: tuple[int, int], view_configs: list[dict]) → list[numpy.ndarray]#

One RGB image per view of stc on its template’s pial surface, as stc.plot draws it.

colour(curvature, smoothed) turns a hemisphere’s curvature and its data, spread from the source vertices over 10 smoothing steps ((n_vertices, n_columns)), into RGBA. A view is {"azimuth", "elevation"} in MNE’s convention.