API#

This section documents the functions offered by FiNNPy.

Feature/Signal processing#

FiNNpy offers a wide range of tools for general signal processing.

The Basic package#

This package implements basic signal processing functionality.

Common average Re-reference data via the Common Average Re-Referencing module.
Modify data’s sampling frequency via the Downsampling module.

The Cleansing package#

This package implements several tools to identify and remove bad samples.

Identify bad (e.g. oversaturated) channels graphically via the Bad Channel Identification module.
Recover lost channels by averaging neighboring channels in the Channel restoration module.
Automatically filter outlier and harmonize samples via the Outlier removal module.

The Features package#

FiNNpy offers methods for spectral power analysis,

Measure spectral power via Welch’s method in the Spectral power module.

cross frequency connectivity (cfc) via multiple metrics,

Measure cfc as Direct Modulation Index (DMI).
Measure cfc as Modulation Index (MI).
Measure cfc as Mean Vector Length (MVL).
Measure cfc as Phase Lock Value (PLV).

and same frequency connectivity (sfc),

Measure sfc as Directional absolute coherence (DAC).
Measure sfc as Phase slope index (PSI).
Measure sfc as Weighted phase lag index (wPLI).
Measure sfc as Imaginary coherence (IC).
Measure sfc as Magnitude squared coherence (MSC).
Measure sfc as Complex coherency module measures coupling as the complex coherency, a precursor to several sfc metrics.

The Filters package#

This package implements several frequency domain filters.

Employ a highly configure FIR filter via the FIR filter module.
Employ a configurable Butterworth filter via the Butterwort filter module.

The Source Reconstruction#

Data may be projected from sensor to source space via FiNNpy’s Source Reconstruction package.

Initial steps#

Compute a sensor covariance matrix via the Sensor covariance module.
Coregister M/EEG and anatomical spaces in the Coregistration, MEG to MRI module.
Call FreeSurfer from within Python in the Freesurfer methods module.

Pipeline proper#

Compute a BEM model in the Boundary element model (BEM) module.
Load highly accurate cortical data via the Cortical model module.
Calculate a forward (source -> sensor space) model in the Forward model module.
Inverse the forward model (sensor -> source space) via the Inverse model module.

Optional steps#

To process source reconstructed data on a group level, the data needs to be projected from individual subject into a group space (fs-average space). This can be done via the Subject to fs-avg module.
Localize cortical regions as per the Desikan-Killiany Atlas in the Source space region clustering module.

Supplementary#

Compute spheres for the source reconstruction via the Sphere models module.
Several supplementary tools used internally in the source reconstruction are bundled in the Utility functions module.

Feature analysis#

FiNNpy offers advanced feature analysis tools.

The Statistics package#

This package implements methods for the statistical analysis of data.

Linear mixed models may be configured and deployed via the Generalized linear mixed model module.

Presentation#

FiNNpy offers In-Python and Blender based visualization tools in the visualization package.

Topoplots#

Plot 2D topoplots (sensor space) via the Topoplot module.
Plot 3D topoplots (source space) via the Plot Source Reconstructions module.

Other#

Plot volumetric data/pointcloids using the Volumetric Plotting module.
Convert nifti files to *.obj files for use in visualizations in the Atlas Conversion module.

Quality of life#

FiNNpy offers a wide range of quality-of-life tools.

The File IO package#

This package enables reading/saving variables from/to the harddrive.

Load/Save any data structure using the Data manager module. Even large data sets may be safely stored/loaded as these can be split into multiple auto-assembling subsets.
Load BrainVision data using the Load brainvision data module.

The Misc package#

This package provides a wide range of tools.

Employ a highly configurable multiprocessing loop to perform multiple computations in parallel via the Timed Pool module. The loop is designed to minimize the memory footprint, enabling a maximum of concurrent evaluations.