nirspipe.qc.figures.common._brain_utils#

Shared brain-rendering helpers for brain_views and glm_figures.

Module Contents#

Functions#

space_of_run

The template a run’s optodes were placed on; fsaverage without a run.

load_brain_meshes

The template’s pial surface, left and right, as pyvista meshes in mm (fsaverage at fsaverage5).

to_template

Optode coordinates (m) on the run’s template surface RAS (mm), by the run’s placement.

to_head

Optode coordinates (m) in the head frame (m) of the run’s template, for MNE routines that take its head->MRI.

Data#

API#

nirspipe.qc.figures.common._brain_utils.CAMERAS = [((0.0, 2.0, 0.5), (0, 0, 1)), ((), (0, 0, 1)), ((0.0, 0.3, 2.0), (0, 1, 0))]#
nirspipe.qc.figures.common._brain_utils.VIEW_LABELS = ['Frontal', 'Left Lateral', 'Superior']#
nirspipe.qc.figures.common._brain_utils.RENDER_LOCK = 'Lock(...)'#
nirspipe.qc.figures.common._brain_utils.space_of_run(raw: mne.io.Raw | None) → str#

The template a run’s optodes were placed on; fsaverage without a run.

nirspipe.qc.figures.common._brain_utils.load_brain_meshes(space: str = FSAVERAGE) → list#

The template’s pial surface, left and right, as pyvista meshes in mm (fsaverage at fsaverage5).

nirspipe.qc.figures.common._brain_utils.to_template(coords: numpy.ndarray, raw: mne.io.Raw | None = None) → numpy.ndarray#

Optode coordinates (m) on the run’s template surface RAS (mm), by the run’s placement.

Without raw the coordinates are taken to be in fsaverage’s head space.

nirspipe.qc.figures.common._brain_utils.to_head(coords: numpy.ndarray, raw: mne.io.Raw) → numpy.ndarray#

Optode coordinates (m) in the head frame (m) of the run’s template, for MNE routines that take its head->MRI.