1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
.. _command_line_tutorial:
=====================================
Getting started with MNE command line
=====================================
The quick start guide shows how to run a standard processing of the
sample data set provided with MNE. XXX add link to data set download
First define your subject::
export SUBJECT=sample
Build your source space::
# MRI (this is not really needed for anything)
mne_setup_mri --overwrite
# Source space
mne_setup_source_space --ico -6 --overwrite
Prepare for forward computation::
# For homogeneous volume conductor
mne_setup_forward_model --homog --surf --ico 4
# or for XXX
mne_setup_forward_model --surf --ico 4
List your bad channels in a file. Example sample_bads.bad contains::
MEG 2443
EEG 053
Mark bad channels::
mne_mark_bad_channels --bad sample_bads.bad sample_audvis_raw.fif
Compute averaging::
mne_process_raw --raw sample_audvis_raw.fif --lowpass 40 --projoff \
--saveavetag -ave --ave audvis.ave
Compute the noise covariance matrix::
mne_process_raw --raw sample_audvis_raw.fif --lowpass 40 --projoff \
--savecovtag -cov --cov audvis.cov
Compute forward solution a.k.a. lead field::
# for MEG only
mne_do_forward_solution --mindist 5 --spacing oct-6 \
--meas sample_audvis_raw.fif --bem sample-5120 --megonly --overwrite \
--fwd sample_audvis-meg-oct-6-fwd.fif
# for EEG only
mne_do_forward_solution --mindist 5 --spacing oct-6 \
--meas sample_audvis_raw.fif --bem sample-5120-5120-5120 --eegonly \
--fwd sample_audvis-eeg-oct-6-fwd.fif
# for both EEG and MEG
mne_do_forward_solution --mindist 5 --spacing oct-6 \
--meas sample_audvis_raw.fif --bem sample-5120-5120-5120 \
--fwd sample_audvis-meg-eeg-oct-6-fwd.fif
Compute MNE inverse operators::
# Note: The MEG/EEG forward solution could be used for all
mne_do_inverse_operator --fwd sample_audvis-meg-oct-6-fwd.fif \
--depth --loose 0.2 --meg
mne_do_inverse_operator --fwd sample_audvis-eeg-oct-6-fwd.fif \
--depth --loose 0.2 --eeg
mne_do_inverse_operator --fwd sample_audvis-meg-eeg-oct-6-fwd.fif \
--depth --loose 0.2 --eeg --meg
Produce stc files (activation files)::
# for MEG
mne_make_movie --inv sample_audvis-meg-oct-6-${mod}-inv.fif \
--meas sample_audvis-ave.fif \
--tmin 0 --tmax 250 --tstep 10 --spm \
--smooth 5 --bmin -100 --bmax 0 --stc sample_audvis-meg
# for EEG
mne_make_movie --inv sample_audvis-eeg-oct-6-${mod}-inv.fif \
--meas sample_audvis-ave.fif \
--tmin 0 --tmax 250 --tstep 10 --spm \
--smooth 5 --bmin -100 --bmax 0 --stc sample_audvis-eeg
# for MEG and EEG combined
mne_make_movie --inv sample_audvis-meg-eeg-oct-6-${mod}-inv.fif \
--meas sample_audvis-ave.fif \
--tmin 0 --tmax 250 --tstep 10 --spm \
--smooth 5 --bmin -100 --bmax 0 --stc sample_audvis-meg-eeg
And, we're done!
You can now get started with the Python :ref:`examples-index`
|