eegprep.eeg_amica#
- eegprep.eeg_amica(EEG, posact='off', sortcomps='off', num_models=1, max_iter=2000, num_mix_comps=3, pcakeep=None, outdir=None, amica_binary=None, max_threads=4, **kwargs)#
Perform ICA decomposition using AMICA (Adaptive Mixture ICA).
AMICA fits one or more ICA models with generalized Gaussian mixture source distributions via an external Fortran binary. Standard ICA fields are populated from model 0. The full multi-model output is stored in EEG[‘etc’][‘amica’].
EEGPrep wheels do not ship AMICA binaries. Provide the executable with the amica_binary argument, the AMICA_BINARY environment variable, or PATH.
Parameters#
- EEGdict
EEGLAB-like data structure.
- posactstr | bool, optional
If ‘on’ or True, normalize component signs so max(abs(activations)) is positive. Default is ‘off’.
- sortcompsstr | bool, optional
If ‘on’ or True, sort components by descending activation variance. Default is ‘off’.
- num_modelsint
Number of ICA models to fit.
- max_iterint
Maximum number of training iterations.
- num_mix_compsint
Number of mixture components per source.
- pcakeepint or None
Number of principal components to retain. Default: nbchan.
- outdirstr or None
Output directory for AMICA. If None, a temporary directory is used.
- amica_binarystr or None
Path to AMICA binary. If None, auto-detected from AMICA_BINARY, a source-tree development binary, EEGLAB’s AMICA plugin, or PATH.
- max_threadsint
Maximum number of threads for the binary.
- kwargsdict
Additional AMICA parameters passed through to the binary.
Returns#
- dict
The updated EEG structure with ICA fields.