Reference API¶
List of modules
ffrprep.preproc- Preprocessing functionsffrprep.analysis- FFR analysis functionsffrprep.reports- Report buildersffrprep.group- Group-level aggregationffrprep.datasets- Dataset functionsffrprep.utils- Utility functions
ffrprep.preproc - Preprocessing functions¶
preproc module for ffrprep.
Local imports are used inside functions so that Nipype Function nodes executed in separate processes have the necessary imports available at runtime. Avoid top-level imports for packages that are imported inside functions to prevent redefinition and lint warnings.
|
Identify and load EEG data from a BIDS directory using pybids for querying. |
|
Re-reference the provided EEG data object. |
|
Apply frequency filters to the provided EEG data object. |
|
Epoch the provided EEG data object based on events. |
|
Create evoked responses by averaging epochs. |
|
Average across every event in |
|
Compute |
|
Compute the structured |
|
Save preprocessing outputs to BIDS derivatives structure. |
|
Save analysis outputs to BIDS derivatives structure. |
|
Create nipype workflow for FFR preprocessing. |
|
Build a nipype workflow that averages epochs into evoked responses and saves them to BIDS-derivatives. |
ffrprep.analysis - FFR analysis functions¶
|
Compute the average oscillatory power of a given frequency band. |
|
Compute RMS-based signal-to-noise ratio (SNR) for an Evoked response. |
|
Autocorrelation function and 95% CI for the first channel of evoked. |
|
Compute the pitch (f0) and confidence metrics for an Evoked response. |
|
Plot a smoothed pitch track together with associated confidence measures. |
|
Compute phase consistency from FFR epochs. |
|
Plot phase consistency matrices. |
|
Plot phase consistency with significance masking. |
|
Compute the correlation between stimulus and brain response. |
|
Compute the correlation between two brain responses. |
|
Compute trial-to-trial response consistency from an MNE Epochs object. |
|
Compute the FFT amplitude spectrum for a time-domain signal. |
|
Spectral amplitude of the fundamental and its harmonics in an FFR. |
|
Maximum stimulus-to-response cross-correlation (coefficient form). |
|
Read a WAV file as a float, mono (channel-averaged) waveform. |
|
Polyphase-resample a 1-D signal (no-op if the rates match). |
ffrprep.reports - Report builders¶
This module provides functions for creating, updating, and saving MNE reports.
For FFRPREP BIDS datasets, including support for figures, HTML blocks, and special MNE objects.
|
Build a section descriptor from a Raw object. |
|
Build a section descriptor from an Epochs object. |
|
Build a section descriptor from an Evoked object. |
|
Build a section descriptor summarizing a group-level metrics table. |
|
Build a phase-consistency section from two polarities of Epochs. |
|
Construct a group descriptor consumable by the report builders. |
|
Render a single-file HTML preprocessing report for a subject. |
|
Render a single-file HTML analysis report for a subject. |
|
Render a single-file HTML group-level report. |
|
Generate FFR-specific QA figures for an mne.Evoked object. |
|
Generate QA figures for an mne.Epochs object. |
ffrprep.group - Group-level aggregation¶
group module for ffrprep.
Aggregates already-computed participant-level derivatives
(ffrprep-analysis/sub-*/ and ffrprep-preprocessing/sub-*/eeg/)
into group-level summaries: a grand-average evoked response per (task,
session, run), a per-subject scalar-metrics table, and a group HTML
report. This mirrors the aggregation-only scope other BIDS Apps use for
their “group” level (e.g. MRIQC’s group report): it summarizes what
participant-level ffrprep already computed, it does not run any
group-level statistics.
|
Discover participant-level derivatives to aggregate at the group level. |
|
Load per-subject Evoked files and compute their grand average. |
|
Compute per-subject scalar FFR metrics from saved derivatives. |
|
Flag recordings that fail quality thresholds; never drop rows. |
|
Build a BIDS-style data dictionary for the group metrics TSV. |
|
Left-join subject-level covariate TSVs onto a metrics table. |
|
Save a grand-average Evoked and its provenance sidecar under |
|
Save a per-subject metrics table to a group-level TSV file. |
|
Run the group-level aggregation step (BIDS-App |
ffrprep.datasets - Dataset functions¶
|
Download example EEG data (1 subject) for testing and tutorials. |
|
Download raw EEG data for specified subjects from OSF. |
|
Download epoched EEG data for specified subjects from OSF. |
|
Download FFR stimulus files into a BIDS-compliant |
ffrprep.utils - Utility functions¶
Utility functions for validating BIDS directories and related operations.
|
Validate BIDS directory and structure via the BIDS-validator. |