Standalone Functions (autoclean.functions)#
This section covers the standalone functions that provide modular EEG data processing capabilities in AutoClean. These functions can be used independently without the Task/Mixin framework, making them ideal for custom workflows, scripting, and integration with other EEG analysis pipelines.
Standalone functions are designed to be stateless and operate directly on MNE data objects:
from autoclean.functions import filter_data, detect_bad_channels, fit_ica
# Direct function usage - no task object required
filtered_raw = filter_data(raw, l_freq=1.0, h_freq=40.0)
bad_channels = detect_bad_channels(filtered_raw)
ica = fit_ica(filtered_raw)
Note: Standalone functions return processed data objects and do not modify the input data in-place. They provide a functional programming approach as an alternative to the object-oriented Task/Mixin pattern.
Available Function Categories#
Preprocessing Functions#
Filter EEG data using highpass, lowpass, and/or notch filtering. |
|
Apply referencing scheme to EEG data. |
|
Resample EEG data to a new sampling frequency. |
|
Crop EEG data to a specific time range. |
|
Drop channels from EEG data. |
Artifact Detection Functions#
Detect bad channels using multiple statistical methods. |
|
Interpolate bad channels using spherical spline interpolation. |
Epoching Functions#
Create regular fixed-length epochs from continuous EEG data. |
|
Create statistical learning epochs based on syllable event patterns. |
|
Create epochs based on specific event IDs from continuous EEG data. |
|
Detect and mark outlier epochs based on statistical measures. |
|
Clean epochs based on Global Field Power (GFP) outlier detection. |
ICA Functions#
Fit Independent Component Analysis (ICA) to EEG data. |
|
Classify ICA components using automated algorithms. |
|
Apply ICA to remove specified components from EEG data. |
Segment Rejection Functions#
Identify and annotate noisy segments in continuous EEG data. |
|
Identify and annotate segments with poor channel-neighbor correlations. |
|
Detect smaller, dense oscillatory multichannel artifacts. |
Advanced Processing Functions#
Apply AutoReject for automatic epoch cleaning and channel interpolation. |
Visualization Functions#
Plot raw data comparison showing original vs cleaned data overlay. |
|
Plot ICA component topographies and properties. |
|
Plot power spectral density topographical maps for frequency bands. |
|
Generate a comprehensive HTML processing report. |
|
Create a JSON summary of processing steps. |