API Reference

Core Functions

Main Entry Points

electroMICA_iEEG(output_folder, feature, electrodes=None, micapipe_derivatives=None, hippunfold_derivatives=None)

Project intracranial EEG features onto cortical and hippocampal surfaces.

Parameters:
  • output_folder (str) – Path to electroMICA derivatives folder

  • feature (str) – Path to feature TSV file or feature label

  • electrodes (str) – Path to BIDS iEEG folder or electrodes.tsv file (optional)

  • micapipe_derivatives (str) – Path to micapipe derivatives (optional)

  • hippunfold_derivatives (str) – Path to hippunfold derivatives (optional)

Returns:

None (results saved to output_folder)

electroMICA_ScalpEEG(output_folder, feature, electrodes=None, micapipe_derivatives=None, hippunfold_derivatives=None)

Project scalp EEG features onto cortical and hippocampal surfaces.

Parameters:
  • output_folder (str) – Path to electroMICA derivatives folder

  • feature (str) – Path to feature TSV file or feature label

  • electrodes (str) – Path to BIDS EEG folder or electrodes.tsv file (optional)

  • micapipe_derivatives (str) – Path to micapipe derivatives (optional)

  • hippunfold_derivatives (str) – Path to hippunfold derivatives (optional)

Returns:

None (results saved to output_folder)

Internal Functions (Selected)

These internal functions are documented for reference but are not typically called directly by users.

Mathematical Utilities

Dependencies

Core dependencies:

  • numpy — Numerical computations

  • scipy — Linear algebra and signal processing (sparse matrices, BEM solving)

  • pandas — Feature file I/O and metadata

  • nibabel — Neuroimaging file formats (NIFTI, GIFTI)

  • antspyx — Image registration and transforms

Examples

Example 1: Basic iEEG projection

from electroMICA import electroMICA_iEEG

electroMICA_iEEG(
    output_folder='/data/electroMICA/sub-01/ses-01',
    feature='/data/features/sub-01_ses-01_Spike.tsv',
    electrodes='/data/BIDS_iEEG/iEEG/',
    micapipe_derivatives='/data/micapipe'
)

Example 2: Scalp EEG with hippunfold

from electroMICA import electroMICA_ScalpEEG

electroMICA_ScalpEEG(
    output_folder='/data/electroMICA/sub-02/ses-01',
    feature='/data/features/sub-02_ses-01_AvgSpike.tsv',
    electrodes='/data/BIDS_EEG/EEG/',
    micapipe_derivatives='/data/micapipe',
    hippunfold_derivatives='/data/hippunfold'
)

Example 3: Using precomputed leadfields

If you’ve already run electroMICA once, you can reuse the computed leadfields for faster feature mapping:

from electroMICA import electroMICA_iEEG

# Recompute feature maps without recalculating leadfields
electroMICA_iEEG(
    output_folder='/data/electroMICA/sub-01/ses-01',
    feature='/data/features/sub-01_ses-01_NewFeature.tsv'
    # electrodes and micapipe_derivatives not needed
)

See Also