Maxfilter script for NatMEG
This is the process describing how to use the maxfilter script for NatMEG. The script is designed to run on a computer with a MaxFilter™ installation. The head position averagers are written in Python and use functions from MNE-Python. The pipeline has been tested to work on Cerberos at NatMEG, but no guarrantee is provided that it will work elsewhere!
You can find the necessary python scripts here
Prerequisits
Ensure you have the following non-default libraries installed in your Python environment: mne
, matplotlib
Process
Install requirements
- Make sure python modules are installed in the environment. If not, install them using the following commands:
conda install mne matplotlib
Run script
Option 1. Run the script by executing the following command:
python maxfilter.py --config=path/to/maxfilter_settings.json
Option 2. Edit config file before running the script:
python maxfilter.py --config=path/to/maxfilter_settings.json --edit
Option 3. Run the script without a config flag
python maxfilter.py # (add --edit to also edit an existing file)
open
: Open an existing config file (default)
- new
: Create a new config file from a default template using the dialog
- cancel
: Cancel the operation
Config file
{
"standard_settings": {
"project_name": "",
"trans_conditions": ["task1", "task2"],
"trans_option": "mne_continous",
"merge_runs": "on",
"empty_room_files": ["empty_room_before.fif", "empty_room_after.fif"],
"sss_files": ["empty_room_before.fif", "empty_room_after.fif"],
"autobad": "on",
"badlimit": 7,
"bad_channels":[""],
"tsss_default": "on",
"correlation": 0.98,
"movecomp_default": "on",
"data_path": "."
},
"advanced_settings": {
"force": "off",
"downsample": "off",
"downsample_factor": 4,
"apply_linefreq": "off",
"linefreq_Hz": 50,
"scripts_path": "/home/natmeg/Scripts",
"cal": "/neuro/databases/sss/sss_cal.dat",
"ctc": "/neuro/databases/ctc/ct_sparse.fif",
"dst_path": "neuro/data/local",
"trans_folder": "headtrans",
"log_folder": "log",
"maxfilter_version": "/neuro/bin/util/mfilter",
"MaxFilter_commands": "",
}
}
Standard_settings:
project_name
: Name of the projecttrans_conditions
: List of conditions to be transformedtrans_option
: Type of transformation (continous or initial)merge_runs
: Estimate head position average over all runs if multipleempty_room_files
: List of empty room filessss_files
: List of SSS filesautobad
: Turn on or off autobadbadlimit
: Bad limitbad_channels
: List of bad channelstsss_default
: Turn on or off tSSScorrelation
: Correlation limitmovecomp_default
: Turn on or off movecompdata_path
: Path to the data
Advanced_settings:
force
: Force maxfilter to rundownsample
: Downsample datadownsample_factor
: Downsample factorapply_linefreq
: Apply line frequency filterlinefreq_Hz
: Line frequency in Hzscripts_path
: Path to the scriptcal
: Path to the calibration filectc
: Path to the crosstalk filedst_path
: Path to the destination folder (not active yet)trans_folder
: Name of the transformation folderlog_folder
: Name of the log foldermaxfilter_version
: Path to the maxfilter versionMaxFilter_commands
: Additional commands for maxfilter (see MaxFilter manual)