With our software, we hope to provide users with an accessible way to preprocess resting-state EEG files, while still including powerful analysis tools. We do this by combining several functions from the MNE (MEG/EEG preprocessing) open-source project. By using an intuitive graphical user interface on top of a Python script, we hope that our software is easy to start using without coding experience, while still allowing more experienced users to adapt the software to their needs by altering the underlying code.
The software is currently able to:
The software is not (yet) able to:
When choosing the settings for the current analysis batch, most windows contain a "more info" button which will take you to an appropriate MNE documentation page.
When no raw EEG files show up in the file selection window, please choose a different file type in the dropdown menu on the right (it might be stuck on only showing .txt files for instance).
For the bad channel selection (for interpolation), you can select bad channels by clicking the channel names on the left side of the plot. The deselected (grey) channels will be interpolated. For ICA, this works the same but then artefact-containing components can be deselected in the graph plot of the ICA. These components will be filtered out of the EEG. For interactive epoch selection, epochs of insufficient quality can be deselected by clicking anywhere on the epoch, which will then turn red. This means the epoch will not be saved.
If the program glitches or stops working, we found that it works best to stop the Python process, for instance by clicking the red stop button or restarting the kernel in Spyder IDE or similar.
There is currently an unresolved problem where removing multiple ICA components and/or interpolating channels can result in a data rank that is too low to caculate the beamforming solution. See here for an explanation of this problem.
When using Spyder IDE to run the program (like we do), Spyder prompts the user that Spyder does not have the spyder-kernels module. Please follow the instructions provided by Spyder.
This guide will walk you through the process of setting up the EEG Preprocessing Tool using Miniconda. Miniconda provides an easy way to create isolated Python environments and manage package dependencies.
First, download and install Miniconda:
Follow the installation instructions provided on the Miniconda website.
If not done already, install Git.
Open a terminal (or Anaconda Prompt on Windows) and run the following commands:
# Create a new conda environment named 'eeg_env' with Python 3.11
conda create -n eeg_env python=3.11
# Activate the new environment
conda activate eeg_env
Clone the EEG Preprocessing Tool repository:
git clone https://github.com/snorben/eeg_preprocessing_umcu.git
cd eeg_preprocessing_umcu
Install the package and its dependencies using pip:
python -m pip install .
To verify that the installation was successful, you can try running the main script (eeg_processing_script.py) in your favorite way (we have used Spyder to run the script during development). For the first use, it is important to select your newly created Miniconda environment in your IDE. In Spyder this is done via: preferences > Python interpreter > use the following interpreter. When opening the script in an IDE like Spyder, you can simply press 'run' to start the script. If everything is set up correctly, the script should run without any import errors.
If you encounter any issues during installation:
conda activate eeg_env
).python -m pip install --upgrade pip
conda install numpy pandas matplotlib scikit-learn
pip install PySimpleGUI mne
For any further issues, please open an issue on the GitHub repository.
When there's an update available on GitHub, follow these steps to update your local installation:
cd path/to/eeg_preprocessing_umcu
conda activate eeg_env
git pull origin main
python -m pip install . --upgrade
This command will update the package and any new or updated dependencies.
Ensure your conda environment is up to date:
conda update --all
If you're still having problems, you can try creating a fresh environment:
conda deactivate
conda remove --name eeg_env --all
conda create -n eeg_env python=3.8
conda activate eeg_env
python -m pip install .
If you want to contribute to the development of eeg_preprocessing_umcu, have a look at the contribution guidelines.
This package was created with Cookiecutter and the NLeSC/python-template.
(Customize these badges with your own links, and check https://shields.io/ or https://badgen.net/ to see which other badges are available.)