[Mne_analysis] [python read_inverse_operator()] Can not find parent MRI location

Will Foran willforan+mne at gmail.com
Tue May 1 17:50:02 EDT 2012
Search archives:

With help and a new mne_volume_source_space binary from Junpeng Zhang,
run_meg_volume_tutorial.sh finishes and produces the desired files, namely *
sample_audvis-meg-vol-7-meg-inv.fif*.

Now plot_compute_mne_inverse_volume.py<http://www.martinos.org/mne/auto_examples/inverse/plot_compute_mne_inverse_volume.html>
fails
with  "Can not find parent MRI location."  This error is raised by
read_inverse_operator() reading sample_audvis-meg-vol-7-meg-inv.fif .


I haven't had much success diving into the code, but from what I gather the
fiff file(?) as explored by fiff/tree.py and fiff/tag.py does not include
the tag for the parent MRI (FIFFB_MNE_PARENT_MRI_FILE=353).


Is there a way to confirm this?
Can a fiff file be easily modified to include it or is there a way to get
python to look in a default location
(environ['SUBJECT_DIR']/environ['SUBJECT']/MRI/
)?


Thanks!
Will
*
*
*------------------------------------------*
*
*
*
*
*
*
*>>> fname_inv*
*'../MNE-sample-data/MEG/sample/sample_audvis-meg-vol-7-meg-inv.fif'*
*
*
*>>> inverse_operator = read_inverse_operator(fname_inv)*
*
*
Reading inverse operator decomposition from
../MNE-sample-data/MEG/sample/sample_audvis-meg-vol-7-meg-inv.fif...
    Reading inverse operator info... [done]
    Reading inverse operator decomposition... [done]
    305 x 305 full covariance (kind = 1) found.
    Read a total of 4 projection items:
        PCA-v1 (1 x 102) active
        PCA-v2 (1 x 102) active
        PCA-v3 (1 x 102) active
        Average EEG reference (1 x 60) active
    Noise covariance matrix read.
    11271 x 11271 diagonal covariance (kind = 2) found.
    Source covariance matrix read.
Did not find the desired covariance matrix
    11271 x 11271 diagonal covariance (kind = 5) found.
    Depth priors read.
Did not find the desired covariance matrix

<open file
'../MNE-sample-data/MEG/sample/sample_audvis-meg-vol-7-meg-inv.fif', mode
'rb' at 0x9bbfc80>
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/home/foranw/src/MNE-sample-data/<ipython-input-15-2bc8ebaf3112> in
<module>()
----> 1 inverse_operator = read_inverse_operator(fname_inv)

/usr/lib/python2.7/site-packages/mne/minimum_norm/inverse.pyc in
read_inverse_operator(fname)
    187     #

    188
*--> 189     inv['src'] = read_source_spaces_from_tree(fid, tree,
add_geom=False)*
    190
    191     for s in inv['src']:

/usr/lib/python2.7/site-packages/mne/source_space.py in
read_source_spaces_from_tree(fid, tree, add_geom)
     81     for s in spaces:
     82         print '    Reading a source space...',
*---> 83         this = _read_one_source_space(fid, s)*
     84         print '[done]'
     85         if add_geom:

/usr/lib/python2.7/site-packages/mne/source_space.py in
_read_one_source_space(fid, this)
    153         parent_mri = dir_tree_find(this,
FIFF.FIFFB_MNE_PARENT_MRI_FILE)
    154         if len(parent_mri) == 0:
*--> 155             raise ValueError('Can not find parent MRI location')*
    156
    157         mri = parent_mri[0]

*ValueError: Can not find parent MRI location*

############

$ grep -Ri 'FIFFB_MNE_PARENT_MRI_FILE.*='
/usr/lib/python2.7/site-packages/mne
/usr/lib/python2.7/site-packages/mne/fiff/constants.py:FIFF.FIFFB_MNE_PARENT_MRI_FILE
   = 353
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20120501/62c1cbb5/attachment.html 


More information about the Mne_analysis mailing list