nirspipe.qc.metrics.haemo#

Metrics on haemoglobin, i.e. everything past Beer-Lambert.

HbO-HbR anticorrelation, CNR against the stimulus, band powers, gcor and drift. This is the far side of the line the package docstring draws: these aggregates exclude rejected channels, because by this stage the channel is out of the analysis rather than part of the archival record.

Module Contents#

Functions#

haemo_quality_metrics

HbO-HbR correlation per source-detector pair (genuine responses anti-correlate).

gcor_metrics

Data#

API#

nirspipe.qc.metrics.haemo.CNR_BASELINE_S = ()#
nirspipe.qc.metrics.haemo.CNR_RESPONSE_S = (5.0, 15.0)#
nirspipe.qc.metrics.haemo.DRIFT_ORDER_PER_S = 150.0#
nirspipe.qc.metrics.haemo.DRIFT_ORDER_MAX = 30#
nirspipe.qc.metrics.haemo.haemo_quality_metrics(raw_haemo: mne.io.Raw) → dict[str, Any]#

HbO-HbR correlation per source-detector pair (genuine responses anti-correlate).

Each HbO channel is paired with the HbR channel of the same source-detector pair, and their Pearson correlation is taken:

\[\rho = \operatorname{corr}(\text{HbO}, \text{HbR}), \qquad \rho \in [-1, 1].\]

A real haemodynamic response drives HbO up and HbR down, so a strongly negative correlation (near -1) is expected; values near 0 or positive indicate a shared artifact (motion, systemic scalp signal) rather than brain activity.

Parameters:

raw_haemo (mne.io.Raw) -- Haemoglobin recording (HbO/HbR).

Returns:

hbo_hbr_corr_mean and hbo_hbr_corr_per_channel (keyed by source-detector pair).

Return type:

dict

Notes

The HbO-HbR anti-correlation is well-established physiology; using it as a QC metric is a reasonable heuristic rather than a standardized threshold.

nirspipe.qc.metrics.haemo.gcor_metrics(raw_haemo: mne.io.Raw) → dict[str, Any]#