<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>不一定。</div><div>我想把成对的功能连接值重回大脑显示,这个老美的讨论是否给你提示呢,所以,转给你了<br><br>发自我的 iPad</div><div><br>在 2016年4月29日,6:21,JR KING &lt;<a href="mailto:jeanremi.king@gmail.com">jeanremi.king@gmail.com</a>&gt; 写道:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div><div><div><div>Dear Peng,<br><br></div>You shouldn't save your covariance in a text file. Covariance object contains headers/metadata<br><br></div>You should do:<br></div><br>import mne<br>epochs = mne.read_epochs(epochs_path) <br></div><div><br># compute covariance<br></div><div>cov = mne.compute_covariance(epochs, tmax=0.)<br><br></div><div># save covariance object<br></div><div>cov.save('my_file-cov.fif')<br><br></div># read covariance object<div>cov = mne.read_cov(fname_cov)<br><br><br></div><div>Try following the website tutorials first:<br><a href="http://martinos.org/mne/dev/auto_examples/io/plot_read_noise_covariance_matrix.html#sphx-glr-auto-examples-io-plot-read-noise-covariance-matrix-py">http://martinos.org/mne/dev/auto_examples/io/plot_read_noise_covariance_matrix.html#sphx-glr-auto-examples-io-plot-read-noise-covariance-matrix-py</a><br><a href="http://martinos.org/mne/dev/faq.html#how-should-i-regularize-the-covariance-matrix">http://martinos.org/mne/dev/faq.html#how-should-i-regularize-the-covariance-matrix</a><br><br></div><div>Best,<br><br></div><div>Jean-Rémi<br></div><div><div><pre><br></pre><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 28 April 2016 at 17:17, Peng Zan <span dir="ltr">&lt;<a href="mailto:zanpeng.pz@gmail.com" target="_blank">zanpeng.pz@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear mne expert,<div><br></div><div>I wanted to write a covariance matrix into a *-cov.fif file using python command 'mne.write_cov' but failed. I saved the covariance matrix into a txt file 'R2262.txt' and then read it via python to cov_matrix. The error occurred in the step of 'write_cov'. In tutorial, only file name and the matrix are needed. Everything should be correct but it said 'str' had no attribute 'save'. The detail is as follows.</div><div><br></div><div>







<p><span>&gt;&gt;&gt; cov = open('/Users/Peng/Documents/MNE/MNE_analysis/MNE_TRFs/MEG/R2262_S0807/R2262cov.txt'); cov_matrix = cov.read()</span></p>
<p><span>&gt;&gt;&gt; mne.write_cov('/Users/Peng/Documents/MNE/MNE_analysis/MNE_TRFs/MEG/R2262_S0807/R2262_trf-cp-cov.fif',cov_matrix)</span></p>
<p><span>Traceback (most recent call last):</span></p>
<p><span>&nbsp; File "&lt;stdin&gt;", line 1, in &lt;module&gt;</span></p>
<p><span>&nbsp; File "/Users/Peng/Library/Python/2.7/lib/python/site-packages/mne-0.12.dev0-py2.7.egg/mne/cov.py", line 1181, in write_cov</span></p>
<p><span>&nbsp; &nbsp; cov.save(fname)</span></p>
<p><span>AttributeError: 'str' object has no attribute 'save'</span></p><p><span><br></span></p><p>Do you have any idea how should this work?</p><p>Thank you very much!</p><p>Sincerely,</p><p>Peng</p></div></div>
<br>_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<br>
<br></blockquote></div><br></div>

</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Mne_analysis mailing list</span><br><span><a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.edu</a></span><br><span><a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a></span><br><span></span><br><span></span><br><span>The information in this e-mail is intended only for the person to whom it is</span><br><span>addressed. If you believe this e-mail was sent to you in error and the e-mail</span><br><span>contains patient information, please contact the Partners Compliance HelpLine at</span><br><span><a href="http://www.partners.org/complianceline">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error</span><br><span>but does not contain patient information, please contact the sender and properly</span><br><span>dispose of the e-mail.</span><br><span></span><br></div></blockquote></body></html>