nirspipe.pipeline.block_average#

Block average: each condition’s trials averaged per channel over one window, written as a table.

Module Contents#

Functions#

with_table_events

A copy of raw whose markers are the rows of an events table, its BAD_ spans kept.

block_average_table

One row per condition, channel and time: the trials’ mean and standard error, and their count.

write_block_average

<run>_desc-blockavg_timeseries.tsv beside the GLM tables, or None when no trial fits the window.

Data#

API#

nirspipe.pipeline.block_average.logger = 'get_logger(...)'#
nirspipe.pipeline.block_average.with_table_events(raw: mne.io.Raw, events: pandas.DataFrame) → mne.io.Raw#

A copy of raw whose markers are the rows of an events table, its BAD_ spans kept.

nirspipe.pipeline.block_average.block_average_table(raw: mne.io.Raw, tmin: float, tmax: float) → pandas.DataFrame#

One row per condition, channel and time: the trials’ mean and standard error, and their count.

nirspipe.pipeline.block_average.write_block_average(raw: mne.io.Raw, output_dir: pathlib.Path, source_path: str, tmin: float | None = None, tmax: float | None = None, chunk_duration: float | None = None, events: pandas.DataFrame | None = None, inputs: list[Path] = (), chromophores: tuple[str, ...] = DEFAULT_CHROMOPHORES) → Path | None#

<run>_desc-blockavg_timeseries.tsv beside the GLM tables, or None when no trial fits the window.

events is the --events-path table when the design was built from one, so the trials averaged are the ones the model was given.