nirspipe.pipeline.edit_markers#

Marker editing utilities: export events.tsv and apply edits back to SNIRF.

Module Contents#

Functions#

apply_markers_from_df

Read snirf_path, replace annotations with df, write to derivatives/marker_edited/.

export_markers

Export a run’s events.tsv to out_dir for manual editing.

apply_markers

Apply marker edits and write to derivatives/marker_edited/.

Data#

API#

nirspipe.pipeline.edit_markers.logger = 'get_logger(...)'#
nirspipe.pipeline.edit_markers.apply_markers_from_df(snirf_path: pathlib.Path, derivatives_dir: pathlib.Path, sub: str, ses: str | None, df: pandas.DataFrame) → pathlib.Path#

Read snirf_path, replace annotations with df, write to derivatives/marker_edited/.

What apply_markers runs once the table is settled. Returns the path to the written SNIRF.

nirspipe.pipeline.edit_markers.export_markers(bids_dir: pathlib.Path, sub: str, out_dir: pathlib.Path, ses: str | None = None, task: str | None = None, run: str | None = None, validate: bool = False) → pathlib.Path#

Export a run’s events.tsv to out_dir for manual editing.

Copies the BIDS sidecar if present; otherwise extracts from SNIRF annotations. Returns the path to the exported TSV.

nirspipe.pipeline.edit_markers.apply_markers(bids_dir: pathlib.Path, derivatives_dir: pathlib.Path, sub: str, ses: str | None = None, task: str | None = None, run: str | None = None, *, tsv: pathlib.Path | None = None, shift: float | None = None, set_duration: float | None = None, rename: list[str] | None = None, validate: bool = False) → pathlib.Path#

Apply marker edits and write to derivatives/marker_edited/.

Exactly one of tsv/shift/set_duration/rename must be provided. Returns the path to the written SNIRF.