Installation

MEGAP has been evaluated on Windows 10 (Intel i7-1156G7 CPU, 24GB RAM) and macOS (M1 chip, 16GB RAM). Although GPU acceleration is not required, sufficient storage is crucial: for a dataset size of N MB per subject, ensure at least N×7 storage for MEGIN systems or N×5 for CTF/BTI systems to accommodate BIDS-compliant outputs. The pipeline has been tested with Python 3.10 and supports integration with MATLAB 2023b/2024a for modules such as ZapLine-plus. To install MEGAP, follow these steps:

1

Clone the Repository

git clone https://github.com/BNARGroup/MEGAP.git
cd MEGAP
2

Install Required Packages

Install necessary packages, including MNE, MNE-BIDS, TensorFlow, MATLAB Engine, and any other dependencies:

pip install -r requirements.txt
3

Copy Required Repositories

Clone the following repositories into the /config folder of MEGAP:

4

Add Data to MEGAP

Place MEG data organized in the MEG-BIDS structure into the result/raw folder of MEGAP. Additionally, include the fine calibration file and a cross-talk compensation file in the result/config folder for MEGIN systems. Also see BIDS Format for completing configuration file.

5

Execute the MEGAP Script

You can now run MEGAP using the MEGAP.py script and let it pre-process all of your data without any manual intervention.

MEGAP will automatically verify all necessary folders and notify you if anything is missing.

+--------------------------------------------+--------+
|               Required Item                | Status |
+--------------------------------------------+--------+
|               Config Folder                | ✔️ OK  |
|                 Raw Folder                 | ✔️ OK  |
|           CFG Configuration File           | ✔️ OK  |
|      SSS Calibration File (MEGIN only)     | ✔️ OK  |
|          Cross-talk File (MEGIN only)      | ✔️ OK  |
| Zapline-plus-main folder from their github | ✔️ OK  |
|  eeglab-develop folder from their github   | ✔️ OK  |
| mne-matlab-master folder from their github | ✔️ OK  |
|  CNN Model folder from MegNET_2020 github  | ✔️ OK  |
+--------------------------------------------+--------+
*** All necessary folders exist for running MEGAP ***
6

Outputs

Upon completion of the pipeline, the output power spectra plots can be found in the ‘PSD’ folder, and the output text files will be saved in the ‘verbose’ folder. Any warnings generated during processing are stored in the ‘warning’ folder, while the final pre-processed data, is located in the ‘ICA’ folder.

Last updated