nirspipe.qc.figures.subject.carpet_compare

nirspipe.qc.figures.subject.carpet_compare#

Stage-by-stage haemoglobin carpet, on the motion panel’s time axis and its greyscale.

Module Contents#

Functions#

carpet_compare_figure

A carpet per stage in stages, under a shared GVTD row on one time axis.

mark_joined_runs

A joined series’ carpet with each run’s start ruled and named, and its BAD_ spans shaded by kind.

API#

nirspipe.qc.figures.subject.carpet_compare.carpet_compare_figure(stages: list[tuple[str, mne.io.Raw]], chromophore: str | tuple[str, ...] = ('hbo', 'hbr'), roi_map: dict | None = None, raw_gvtd: mne.io.Raw | None = None, raw_gvtd_after: mne.io.Raw | None = None, gvtd_blocks: list | None = None, xlim: tuple[float, float] | None = None, z_threshold: float = CARPET_Z, reference: tuple[str, mne.io.Raw] | None = None) → plotly.graph_objects.Figure | None#

A carpet per stage in stages, under a shared GVTD row on one time axis.

Each carpet is z-scored by its own per-channel mean and SD. reference is a stage that is not drawn and only supplies the SD each title is quoted against. raw_gvtd is intensity or optical density; omitting it drops the motion row. xlim (t0, t1) cuts the columns drawn, not the z-scoring, which stays whole-run so a condition’s carpet is on the run’s greyscale. A cut view also drops the titles’ SD ratio, which is whole-run for the same reason and would otherwise read as the drawn window’s.

chromophore may be one name or several; each gets its own block. Returns None when no channel of any of them survives in every stage.

nirspipe.qc.figures.subject.carpet_compare.mark_joined_runs(fig, runs: list[tuple[str, float]], spans: list[tuple[float, float, str]], row: int = 1) → None#

A joined series’ carpet with each run’s start ruled and named, and its BAD_ spans shaded by kind.

runs is [(label, onset s)] and spans [(start, stop, description)], both on the joined time axis.