-
Notifications
You must be signed in to change notification settings - Fork 26
Analyzing MEG data: Example
In the following example, we'll run the full MEG analysis pipeline. The data is task data (MSIT). It was cleaned using nTSSS (native temporal signal space separation). We're planning to load the MEG and MRI data in the near future (morphed to a template brain).
Most files will be read and created in the subject's MEG folder /links/meg/task-name/subject (meg-folder). The files needed for MMVT will be created in the subject's MMVT folder: /links/mmvt/mri-subject-name (mmvt-folder) The first step will be calculating the evoked responses in the sensors level. For that, you need to have two files in the meg-folder:
- Raw data file: meg-subject-name_msit_nTSSS-raw.fif
- Events file: meg-subject-name_msit_nTSSS_interference-eve.txt
Then, run the following command:
python -m src.preproc.meg -s meg-subject-name -m mri-subject-name -a laus250 -f calc_epochs,calc_evokes,read_sensors_layout -t MSIT --contrast interference --t_max 2 --t_min -0.5 --data_per_task True --read_events_from_file True --events_file_name {subject}_msit_nTSSS_interference-eve.txt --cleaning_method nTSSS
There is also an example written for MSIT task:
python -m src.preproc.examples.meg -s meg-subject-name -m mri-subject-name -f calc_msit -r calc_epochs,calc_evokes,read_sensors_layout
As a result, the following files will be created in the meg-folder:
- The raw info data: meg-subject-name_msit_nTSSS_interference-raw-info.pkl
- Epochs file: meg-subject-name_msit_nTSSS_interference-epo.fif
- Evokes file: meg-subject-name_msit_nTSSS_interference-ave.fif
And in the mmvt-folder/meg
- The evoked data in numpy format: meg_sensors_evoked_data.npy
- The evoked meta data (names, conditions and dt): meg_sensors_evoked_data_meta.npz
- The sensors positions (pos and names): meg_sensors_positions.npz
To import the sensors evoked data, call the following command:
python -m src.mmvt_addon.scripts.import_meg_sensors -s mri-subject-name -a laus250