nirspipe.pipeline.hyper.hyper_post#
The analysis behind nirspipe-hyper: the WTC and ISC runs, and the tables they write.
Nothing here draws. The transform covers every pairing at once and a figure is of one
pairing, so the two are separated; nirspipe.qc.hyper.hyper_report draws the
HyperPostResult this returns, and skips the transform when handed one.
Module Contents#
Classes#
Every |
|
What one dyad’s post run produced: the transforms, the numbers, and where they went. |
Functions#
Write the matrix the ISC panel is drawn from, so the numbers can leave the report. |
|
Run the coherence and the correlation for one dyad, and write every table they make. |
Data#
API#
- nirspipe.pipeline.hyper.hyper_post.logger = 'get_logger(...)'#
- class nirspipe.pipeline.hyper.hyper_post.HyperPostConfig#
Every
--wtc-*option ofnirspipe-hyper, with the derived values resolved once.Field names are the CLI’s.
band_fmin,band_fmax,chromaandcond_pad_sare the resolved forms, in one place so the tables and the figures cannot fall back differently.
- class nirspipe.pipeline.hyper.hyper_post.HyperPostResult#
What one dyad’s post run produced: the transforms, the numbers, and where they went.
passesis keyed by chromophore, each holding the whole-runWTCResultunderresult, its band means underchanandroichan, and the windows undercond_wtc/cond_bandspositionally overcond_windows-- positional so the chromophores line up even where a guard failed on one.iscis{pairing: {label or None: {chromophore: (matrix, channel names)}}}, andisc_roithe same shape over the ROI means of those matrices.chan_axisandroi_labelsare the axes every panel and matrix is indexed by; they ride here so a panel cannot be drawn on a different axis than the table beside it.
- nirspipe.pipeline.hyper.hyper_post.write_isc_matrix(tsv_path: pathlib.Path, isc_mat, ch_names: list[str], ch_type: str, sources: list[str], subject_ids: list[str], align: dict | None = None, step: str = 'hyper_isc', index_label: str = 'channel', **params) None#
Write the matrix the ISC panel is drawn from, so the numbers can leave the report.
Both axes carry the montage’s channel labels, which is how
compute_isc_pairs()pairs the two brains: cell (i, j) is the first subject’s channel i against the other’s channel j. Rejected channels are blank rather than absent, so the file’s shape is the montage’s however many channels a given dyad lost.stepandindex_labelare what let this serve the ROI means of those matrices too, which are the same square shape over regions instead of channels.alignis whatalignment_params()returned, so the file says which alignment it got.A failure here costs the file and not the panel: the report is still readable without it.
- nirspipe.pipeline.hyper.hyper_post.run_hyper_post(group_id: str, task: str, aligned_raws: dict, output_dir: pathlib.Path, config: nirspipe.pipeline.hyper.hyper_post.HyperPostConfig, *, subject_ids: list[str], pairings: list, align_info: dict, cond_windows: list[tuple[str, float, float]] | None = None, cond_margins: dict[str, tuple[float, float]] | None = None, errors: list | None = None, notes: list | None = None, scope: str = '', session: str | None = None) nirspipe.pipeline.hyper.hyper_post.HyperPostResult#
Run the coherence and the correlation for one dyad, and write every table they make.
cond_windowssupplies the per-condition windows instead of resolving them here: the caller passes the same list to the phase-scrambled null, and the two tables are only subtractable row by row if they describe the same windows.cond_marginsis, per window cut out of a condition, the seconds from it back to its condition’s start and on to its end, sowtc_cond_conelays the cone at the condition’s edges and not the window’s. A window absent from it is a condition itself.errorsandnotesare the report’s own lists, so a guard that fails here reaches the footer of the page this result is drawn on and not only the run log.