nirspipe.qc.figures.subject.glm_figures#
GLM visualisation figures.
activation_condition_figures(): per-condition brain surface projections, rendered off-screen. activation_flat_figure(): the betas on the optode flat map, for optodes no reading placed.
Module Contents#
Functions#
One brain render per condition, a row per chromophore the results hold, as |
|
Betas on the optode flat map, a head per condition and a row per chromophore on the scale |
|
design matrix: stacked time-series rows, one per condition + sum row. |
|
Every column the model fitted, nuisance regressors included, as nilearn draws it. |
|
Each condition regressor’s strongest frequency, read off its periodogram. |
|
The whitened residual’s spectrum against white, then each channel’s lag-1 autocorrelation. |
Data#
API#
- nirspipe.qc.figures.subject.glm_figures.logger = 'get_logger(...)'#
- nirspipe.qc.figures.subject.glm_figures.activation_condition_figures(raw_haemo: mne.io.Raw, results_dict: dict[str, pd.DataFrame], clim: dict | None = None, size: tuple[int, int] = (800, 700), failed: list[tuple[str, str]] | None = None, quantity: str = 'beta') list[tuple[str, str]]#
One brain render per condition, a row per chromophore the results hold, as
[(label, png_b64), ...].activation_condition_figures(haemo, {“rest”: df1, “task”: df2}) -> [(“rest”, “iVBOR…”), (“task”, “iVBOR…”)]
The report shows these behind one switch rather than stacked, so a condition can be looked at on its own. Each chromophore’s colour scale is shared by every condition, see
_shared_clim().A condition whose render failed is left out rather than kept as a blank panel, so the switcher never offers a label with nothing behind it;
failedcollects(label, reason)for each one, for the caller to report.
- nirspipe.qc.figures.subject.glm_figures.activation_flat_figure(raw_haemo: mne.io.Raw, results_dict: dict[str, pd.DataFrame], sep_bands=None, quantity: str = 'beta') plotly.graph_objects.Figure | None#
Betas on the optode flat map, a head per condition and a row per chromophore on the scale
activation_condition_figures()shares: its stand-in when the optodes could not be placed.
- nirspipe.qc.figures.subject.glm_figures.design_matrix_static_figure(design_matrix: pandas.DataFrame, conditions: list[str], segments: dict[str, list[tuple[float, float]]] | None = None, title: str = 'Design Matrix') str#
design matrix: stacked time-series rows, one per condition + sum row.
Returns base64-encoded PNG. segments,
{description: [(onset, duration)]}, are shaded by kind:BAD_unselectedgrey, every otherBAD_span red.
- nirspipe.qc.figures.subject.glm_figures.design_matrix_heatmap(design_matrix: pandas.DataFrame) str#
Every column the model fitted, nuisance regressors included, as nilearn draws it.
- nirspipe.qc.figures.subject.glm_figures.design_peak_frequencies(design_matrix: pandas.DataFrame, conditions: list[str]) dict#
Each condition regressor’s strongest frequency, read off its periodogram.
{"tap": <15 s on, 30 s off>}->{"tap": 0.0222}, one cycle per 45 s.
- nirspipe.qc.figures.subject.glm_figures.whitening_figure(spectrum: pandas.DataFrame, channels: pandas.DataFrame, design_freqs: dict, lowband: tuple[float, float]) plotly.graph_objects.Figure | None#
The whitened residual’s spectrum against white, then each channel’s lag-1 autocorrelation.