Created
August 23, 2013 23:26
-
-
Save wronk/6324957 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Generate an inverse solution via python | |
import mne | |
import os | |
fwdName = "fwd.fif" | |
rawName = "raw.fif" | |
covName = "noiseCov.fif" | |
fSaveInv = os.path.join(os.getcwd(), "invPython.fif") | |
### Read in raw data ### | |
raw = mne.fiff.Raw(rawName, preload=True) | |
### Read in forward solution ### | |
fwd = mne.read_forward_solution(fname=fwdName, surf_ori=True) | |
### Read in noise covariance ##### | |
cov = mne.read_cov(covName) | |
###### Compute/save inverse solution ###### | |
inv = mne.minimum_norm.make_inverse_operator(info=raw.info, | |
forward=fwd, | |
noise_cov=cov, | |
fixed=True) | |
mne.minimum_norm.write_inverse_operator(fname=fSaveInv, inv=inv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -f | |
#generate inverse via command line | |
mne_inverse_operator --fixed --senscov noiseCov.fif --fwd fwd.fif --meg --eeg --inv invCmdLine.fif | |
#generate inverse via python | |
python genPythonInv.py | |
#Now attempt to execute "mne_read_inverse_operator" on each inverse file | |
#Cmd line version should succeed while python version should fail |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment