Hi Alex,<div><br></div><div><div>The sample data has transforms for both MRI (surface RAS) -&gt; head and MRI (surface RAS) -&gt; RAS (non-zero origin); my file had only MRI (surface RAS) -&gt; head.  Re-running the MRI processing steps using 2.7.4 (from mne_setup_source_space onward) added this tranformation, and a slightly-modified version of the sample code gives me reasonable output in volume source space.  Thanks!</div>

<div><br></div><div>Jon</div><div> </div><br><div class="gmail_quote">On Fri, May 11, 2012 at 11:14 AM, Alexandre Gramfort <span dir="ltr">&lt;<a href="mailto:gramfort@nmr.mgh.harvard.edu" target="_blank">gramfort@nmr.mgh.harvard.edu</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hi Jon,<br>
<br>
that&#39;s weird. I don&#39;t really have a clue.<br>
<br>
to inspect the content of the generated forward operator you can do<br>
something like this:<br>
<br>
mne_show_fiff --in sample_audvis-meg-vol-7-fwd.fif --verbose<br>
<br>
to only search for the coordinate transformation:<br>
<br>
mne_show_fiff --in sample_audvis-meg-vol-7-fwd.fif --verbose --tag 222<br>
<br>
you can then check the difference between the sample subject and yours<br>
and see if the transform is present or not in the fif file.<br>
<br>
Alex<br>
<div class="HOEnZb"><div class="h5"><br>
On Fri, May 11, 2012 at 3:08 PM, Jon Houck &lt;<a href="mailto:jhouck@unm.edu">jhouck@unm.edu</a>&gt; wrote:<br>
&gt; I had the same problem using 2.7.3-3268 and mne-python v 0.3-1 with my data,<br>
&gt; although it worked fine with the sample dataset.<br>
&gt;<br>
&gt; After switching to 2.7.4-3357, the sample dataset still works, but with my<br>
&gt; own data now I get an error about the MRI RAS transformation matrix:<br>
&gt; File<br>
&gt; &quot;/na/homes/jhouck/.local/lib/python2.6/site-packages/mne-0.3-py2.6.egg/mne/source_estimate.py&quot;,<br>
&gt; line 799, in save_stc_as_volume<br>
&gt;     affine = np.dot(src[0][&#39;mri_ras_t&#39;][&#39;trans&#39;], affine)<br>
&gt; KeyError: &#39;mri_ras_t&#39;<br>
&gt;<br>
&gt; I checked with mne_collect_transforms and this transform was present in all<br>
&gt; of the MRI sets for my subject, as well as in talairach.xfm, but not in<br>
&gt; T1.mgz. I applied it to that file using mri_add_xform_to_header but still<br>
&gt; see the same error.  Does that transfomation matrix need to exist in T1.mgz<br>
&gt; before the source space and inverse solution are made?<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; Jon<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Wed, May 2, 2012 at 6:10 AM, Alexandre Gramfort<br>
&gt; &lt;<a href="mailto:gramfort@nmr.mgh.harvard.edu">gramfort@nmr.mgh.harvard.edu</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; hi Will,<br>
&gt;&gt;<br>
&gt;&gt; I am not sure of what goes wrong on your side.<br>
&gt;&gt;<br>
&gt;&gt; Can try the python script on the data available at:<br>
&gt;&gt;<br>
&gt;&gt; <a href="ftp://surfer.nmr.mgh.harvard.edu/pub/data/MNE-sample-data-processed.tar.gz" target="_blank">ftp://surfer.nmr.mgh.harvard.edu/pub/data/MNE-sample-data-processed.tar.gz</a><br>
&gt;&gt;<br>
&gt;&gt; it contains the processed dataset as obtained with the shell scripts<br>
&gt;&gt; available on line and<br>
&gt;&gt; the nightly build of MNE.<br>
&gt;&gt;<br>
&gt;&gt; you can explore the content of a fif file with something like:<br>
&gt;&gt;<br>
&gt;&gt; mne_show_fiff --in sample_audvis-meg-vol-7-meg-inv.fif<br>
&gt;&gt;<br>
&gt;&gt; if the python script works with these files I suspect you have an<br>
&gt;&gt; outdated version of MNE commands.<br>
&gt;&gt;<br>
&gt;&gt; hope this helps,<br>
&gt;&gt; Alex<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Tue, May 1, 2012 at 11:50 PM, Will Foran &lt;<a href="mailto:willforan%2Bmne@gmail.com">willforan+mne@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; With help and a new mne_volume_source_space binary from Junpeng Zhang,<br>
&gt;&gt; &gt;  run_meg_volume_tutorial.sh finishes and produces the desired files,<br>
&gt;&gt; &gt; namely sample_audvis-meg-vol-7-meg-inv.fif.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Now plot_compute_mne_inverse_volume.py fails with  &quot;Can not find parent<br>
&gt;&gt; &gt; MRI<br>
&gt;&gt; &gt; location.&quot;  This error is raised by read_inverse_operator()<br>
&gt;&gt; &gt; reading sample_audvis-meg-vol-7-meg-inv.fif .<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I haven&#39;t had much success diving into the code, but from what I gather<br>
&gt;&gt; &gt; the<br>
&gt;&gt; &gt; fiff file(?) as explored by fiff/tree.py and fiff/tag.py does not<br>
&gt;&gt; &gt; include<br>
&gt;&gt; &gt; the tag for the parent MRI (FIFFB_MNE_PARENT_MRI_FILE=353).<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Is there a way to confirm this?<br>
&gt;&gt; &gt; Can a fiff file be easily modified to include it or is there a way to<br>
&gt;&gt; &gt; get<br>
&gt;&gt; &gt; python to look in a default location (<br>
&gt;&gt; &gt; environ[&#39;SUBJECT_DIR&#39;]/environ[&#39;SUBJECT&#39;]/MRI/ )?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thanks!<br>
&gt;&gt; &gt; Will<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ------------------------------------------<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt;&gt; fname_inv<br>
&gt;&gt; &gt; &#39;../MNE-sample-data/MEG/sample/sample_audvis-meg-vol-7-meg-inv.fif&#39;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;&gt;&gt; inverse_operator = read_inverse_operator(fname_inv)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Reading inverse operator decomposition from<br>
&gt;&gt; &gt; ../MNE-sample-data/MEG/sample/sample_audvis-meg-vol-7-meg-inv.fif...<br>
&gt;&gt; &gt;     Reading inverse operator info... [done]<br>
&gt;&gt; &gt;     Reading inverse operator decomposition... [done]<br>
&gt;&gt; &gt;     305 x 305 full covariance (kind = 1) found.<br>
&gt;&gt; &gt;     Read a total of 4 projection items:<br>
&gt;&gt; &gt;         PCA-v1 (1 x 102) active<br>
&gt;&gt; &gt;         PCA-v2 (1 x 102) active<br>
&gt;&gt; &gt;         PCA-v3 (1 x 102) active<br>
&gt;&gt; &gt;         Average EEG reference (1 x 60) active<br>
&gt;&gt; &gt;     Noise covariance matrix read.<br>
&gt;&gt; &gt;     11271 x 11271 diagonal covariance (kind = 2) found.<br>
&gt;&gt; &gt;     Source covariance matrix read.<br>
&gt;&gt; &gt; Did not find the desired covariance matrix<br>
&gt;&gt; &gt;     11271 x 11271 diagonal covariance (kind = 5) found.<br>
&gt;&gt; &gt;     Depth priors read.<br>
&gt;&gt; &gt; Did not find the desired covariance matrix<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; &lt;open file<br>
&gt;&gt; &gt; &#39;../MNE-sample-data/MEG/sample/sample_audvis-meg-vol-7-meg-inv.fif&#39;,<br>
&gt;&gt; &gt; mode<br>
&gt;&gt; &gt; &#39;rb&#39; at 0x9bbfc80&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ---------------------------------------------------------------------------<br>
&gt;&gt; &gt; ValueError                                Traceback (most recent call<br>
&gt;&gt; &gt; last)<br>
&gt;&gt; &gt; /home/foranw/src/MNE-sample-data/&lt;ipython-input-15-2bc8ebaf3112&gt; in<br>
&gt;&gt; &gt; &lt;module&gt;()<br>
&gt;&gt; &gt; ----&gt; 1 inverse_operator = read_inverse_operator(fname_inv)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; /usr/lib/python2.7/site-packages/mne/minimum_norm/inverse.pyc in<br>
&gt;&gt; &gt; read_inverse_operator(fname)<br>
&gt;&gt; &gt;     187     #<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     188<br>
&gt;&gt; &gt; --&gt; 189     inv[&#39;src&#39;] = read_source_spaces_from_tree(fid, tree,<br>
&gt;&gt; &gt; add_geom=False)<br>
&gt;&gt; &gt;     190<br>
&gt;&gt; &gt;     191     for s in inv[&#39;src&#39;]:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; /usr/lib/python2.7/site-packages/mne/source_space.py in<br>
&gt;&gt; &gt; read_source_spaces_from_tree(fid, tree, add_geom)<br>
&gt;&gt; &gt;      81     for s in spaces:<br>
&gt;&gt; &gt;      82         print &#39;    Reading a source space...&#39;,<br>
&gt;&gt; &gt; ---&gt; 83         this = _read_one_source_space(fid, s)<br>
&gt;&gt; &gt;      84         print &#39;[done]&#39;<br>
&gt;&gt; &gt;      85         if add_geom:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; /usr/lib/python2.7/site-packages/mne/source_space.py in<br>
&gt;&gt; &gt; _read_one_source_space(fid, this)<br>
&gt;&gt; &gt;     153         parent_mri = dir_tree_find(this,<br>
&gt;&gt; &gt; FIFF.FIFFB_MNE_PARENT_MRI_FILE)<br>
&gt;&gt; &gt;     154         if len(parent_mri) == 0:<br>
&gt;&gt; &gt; --&gt; 155             raise ValueError(&#39;Can not find parent MRI location&#39;)<br>
&gt;&gt; &gt;     156<br>
&gt;&gt; &gt;     157         mri = parent_mri[0]<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ValueError: Can not find parent MRI location<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ############<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; $ grep -Ri &#39;FIFFB_MNE_PARENT_MRI_FILE.*=&#39;<br>
&gt;&gt; &gt; /usr/lib/python2.7/site-packages/mne<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; /usr/lib/python2.7/site-packages/mne/fiff/constants.py:FIFF.FIFFB_MNE_PARENT_MRI_FILE<br>
&gt;&gt; &gt;    = 353<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt; &gt; Mne_analysis mailing list<br>
&gt;&gt; &gt; <a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.edu</a><br>
&gt;&gt; &gt; <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; The information in this e-mail is intended only for the person to whom<br>
&gt;&gt; &gt; it is<br>
&gt;&gt; &gt; addressed. If you believe this e-mail was sent to you in error and the<br>
&gt;&gt; &gt; e-mail<br>
&gt;&gt; &gt; contains patient information, please contact the Partners Compliance<br>
&gt;&gt; &gt; HelpLine at<br>
&gt;&gt; &gt; <a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you<br>
&gt;&gt; &gt; in<br>
&gt;&gt; &gt; error<br>
&gt;&gt; &gt; but does not contain patient information, please contact the sender and<br>
&gt;&gt; &gt; properly<br>
&gt;&gt; &gt; dispose of the e-mail.<br>
&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Mne_analysis mailing list<br>
&gt;&gt; <a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.edu</a><br>
&gt;&gt; <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Mne_analysis mailing list<br>
&gt; <a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.edu</a><br>
&gt; <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
&gt;<br>
&gt;<br>
&gt; The information in this e-mail is intended only for the person to whom it is<br>
&gt; addressed. If you believe this e-mail was sent to you in error and the<br>
&gt; e-mail<br>
&gt; contains patient information, please contact the Partners Compliance<br>
&gt; HelpLine at<br>
&gt; <a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in<br>
&gt; error<br>
&gt; but does not contain patient information, please contact the sender and<br>
&gt; properly<br>
&gt; dispose of the e-mail.<br>
&gt;<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div><br>
</div>