nirspipe.qc.hyper.group_hyper_writer#

Cohort-level hyperscanning QC: every dyad in a tree on one page.

Assembled from what the dyads already wrote, never from anything held in memory, so the page can be rebuilt for a tree produced weeks ago and a dyad the run skipped is simply absent rather than stale. Each dyad contributes its quality record (group-*/nirs/<label>_desc-sqm_qc.json) and, where the run wrote one, its usable-time table (the dyad’s desc-usable_qc.tsv).

What it reports is what a dyad has and a subject cannot:

  • the shared usable time, a channel pair being usable only while it is passing in both members at once, split into the asymmetric loss and the shared one

  • where that time went, per channel pair and per condition

Deliberately not here: SCI, PSP, CV, retention and motion distributions across the cohort. Those are the subject cohort page’s, measured per subject, and a second copy of them here would be the same numbers under a heading that implies they are about the dyad.

Nor synchrony. Whether a dyad is coupled is nirspipe-hyper’s question, asked of the preprocessed signal against its nulls; a raw-stage coherence would mostly measure the shared physiology and drift that preprocessing removes.

Module Contents#

Functions#

condition_rows

One row per condition of a dyad, from its usable-time table; the whole run is not one.

collect_rows

One row per dyad-task under output_dir, for the panels and the table.

build_group_hyper_report

Render desc-groups_report.html over every dyad in a derivatives tree.

Data#

API#

nirspipe.qc.hyper.group_hyper_writer.logger = 'get_logger(...)'#
nirspipe.qc.hyper.group_hyper_writer.SMALL_COHORT_N = 5#
nirspipe.qc.hyper.group_hyper_writer.GROUPS_QC_COLUMNS = None#
nirspipe.qc.hyper.group_hyper_writer.GROUP_CONDITIONS_COLUMNS = None#
nirspipe.qc.hyper.group_hyper_writer.condition_rows(label: str, table: pandas.DataFrame | None) → list[dict]#

One row per condition of a dyad, from its usable-time table; the whole run is not one.

nirspipe.qc.hyper.group_hyper_writer.collect_rows(output_dir: pathlib.Path) → list[dict]#

One row per dyad-task under output_dir, for the panels and the table.

The label a row carries is the BIDS stem of its record, so a dyad recorded on two tasks is two rows and neither is silently the other.

nirspipe.qc.hyper.group_hyper_writer.build_group_hyper_report(output_dir: pathlib.Path) → Path | None#

Render desc-groups_report.html over every dyad in a derivatives tree.

Returns the path, or None when the tree holds no dyad record, which is what a tree that has only seen the per-subject pipeline looks like.