<div dir="ltr">Thank you very much, Sheraz, you are very kind to do so.<div>So is there at the moment no way to do this in Matlab as per the Matlab set of functions provided by MNE?</div><div>Ade</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 24 January 2018 at 05:35, Sheraz Khan, PhD <span dir="ltr"><<a href="mailto:sheraz@nmr.mgh.harvard.edu" target="_blank">sheraz@nmr.mgh.harvard.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Adela,<br>
<br>
You can do the same in Matlab, Tomorrow, I will create a small matlab gist<br>
for you, in which, you input raw and inv file, and it outputs source<br>
estimates, like apply_inverse_raw in mne-python.<br>
<br>
Best<br>
<span class="HOEnZb"><font color="#888888"><br>
Sheraz<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> Thanks again, Sheraz.<br>
><br>
> I am confused because my original question was how to compute the source<br>
> data (in Matlab) if I already have the inverse solution. You mentioned I<br>
> could use mne_read_inverse_operator.m but I should assemble it and<br>
> referred<br>
> me to the function mne_ex_compute_inverse.m. But this function asks for<br>
> the<br>
> _ave-fif file, which I don't have, and seems to me that it is rather to<br>
> compute the inverse solution, which I already have ("% An example on how<br>
> to<br>
> compute a L2-norm inverse solution, and not to create the source<br>
> estimates.<br>
><br>
> I had a look at how the source data is computed in Python and it just uses<br>
> "read_inverse_operator" to read the inv solution, and "apply_inverse_raw"<br>
> for the source estimation (which is what I aim to do in Matlab), which<br>
> doesn't need the _ave.fif file.<br>
><br>
> Maybe I am misunderstanding something?<br>
> Thank you,<br>
> Ade<br>
><br>
><br>
> On 18 January 2018 at 17:05, Sheraz Khan, PhD <<a href="mailto:sheraz@nmr.mgh.harvard.edu">sheraz@nmr.mgh.harvard.edu</a>><br>
> wrote:<br>
><br>
>> On the mne-python side you need to convert your data into Evoked object,<br>
>> using mne python class<br>
>> <a href="https://martinos.org/mne/dev/generated/mne.Evoked.html" rel="noreferrer" target="_blank">https://martinos.org/mne/dev/<wbr>generated/mne.Evoked.html</a><br>
>> And then you can use .save function exposed by Evoked object to save it<br>
>> into -ave.fif file.<br>
>><br>
>> Please open issue on GitHub and share your pipeline with some sample<br>
>> data<br>
>><br>
>> Sheraz<br>
>> > Thank you. I still got the error that the number of arguments was<br>
>> wrong.<br>
>> > It<br>
>> > seem to run adding just '1' for the argument "dSPM"). However, I get<br>
>> the<br>
>> > following error:<br>
>> ><br>
>> > Error using fiff_read_evoked (line 83)<br>
>> ><br>
>> > Could not find processed data<br>
>> ><br>
>> ><br>
>> ><br>
>> > Error in mne_ex_compute_inverse (line 53)<br>
>> ><br>
>> > data = fiff_read_evoked(fname_data,<wbr>setno);<br>
>> ><br>
>> ><br>
>> > I noticed I have no -ave.fif file in the set of files computed with<br>
>> MNE<br>
>> > python.<br>
>> ><br>
>> > Maybe that is the source of the issue?<br>
>> ><br>
>> ><br>
>> > Ade<br>
>> ><br>
>> > On 18 January 2018 at 15:23, Sheraz Khan, PhD <<br>
>> <a href="mailto:sheraz@nmr.mgh.harvard.edu">sheraz@nmr.mgh.harvard.edu</a>><br>
>> > wrote:<br>
>> ><br>
>> >> Some default values<br>
>> >><br>
>> >> setno = 1; %(Event code that you put in your stimulus program)<br>
>> >> nave = -1; %(Number of averages, -1 will read it from -ave.fif file)<br>
>> >> dSPM = true; % (Convert the inverse map to Statistical score wrt to<br>
>> >> baseline noise covirance)<br>
>> >> lambda2 = 1/9 %(Default regularization parameter)<br>
>> >><br>
>> >> HTH<br>
>> >><br>
>> >> Sheraz<br>
>> >><br>
>> >><br>
>> >> > Thank you, Sheraz.<br>
>> >> ><br>
>> >> > To assemble the inv operator I had a look at mne_ex_compute_inverse<br>
>> >> and<br>
>> >> > there are a number of arguments (e.g., setno [data set number],<br>
>> >> lambda2,<br>
>> >> > sDPM, sLORETA), that complicate things since I don't know where to<br>
>> get<br>
>> >> > these values from or how to find them.<br>
>> >> ><br>
>> >> > Ade<br>
>> >> ><br>
>> >> > On 18 January 2018 at 14:20, Sheraz Khan, PhD <<br>
>> >> <a href="mailto:sheraz@nmr.mgh.harvard.edu">sheraz@nmr.mgh.harvard.edu</a>><br>
>> >> > wrote:<br>
>> >> ><br>
>> >> >> Hi Ade,<br>
>> >> >><br>
>> >> >> > 1- Is the MNE Matlab toolbox a limited version of the python<br>
>> one? I<br>
>> >> >> wonder<br>
>> >> >> > if I can perform the whole pipeline (compute fwd and inv<br>
>> solutions)<br>
>> >> >> with<br>
>> >> >> > the Matlab version.<br>
>> >> >><br>
>> >> >> MNE Matlab toolbox is mostly for IO, and was designed to<br>
>> complement<br>
>> >> >> MNE-C<br>
>> >> >> toolbox. It can not compute fwd and inv solutions.<br>
>> >> >><br>
>> >> >><br>
>> >> >> > 2- If this is not possible, how to import in Matlab an already<br>
>> >> >> computed<br>
>> >> >> > inverse solution (oct-6-meg-inv.fif) into Matlab so I have the<br>
>> data<br>
>> >> >> ready<br>
>> >> >> > for further analysis in Matlab?<br>
>> >> >><br>
>> >> >> You can use mne_read_inverse_operator.m function to read inv<br>
>> operator<br>
>> >> >> into<br>
>> >> >> Matlab, but you need to assemble it. Please see<br>
>> >> mne_ex_compute_inverse.m<br>
>> >> >> for example.<br>
>> >> >><br>
>> >> >> HTH<br>
>> >> >><br>
>> >> >> Best<br>
>> >> >><br>
>> >> >> Sheraz<br>
>> >> >><br>
>> >> >><br>
>> >> >> > Hi everyone,<br>
>> >> >> ><br>
>> >> >> > Two questions:<br>
>> >> >> ><br>
>> >> >> > 1- Is the MNE Matlab toolbox a limited version of the python<br>
>> one? I<br>
>> >> >> wonder<br>
>> >> >> > if I can perform the whole pipeline (compute fwd and inv<br>
>> solutions)<br>
>> >> >> with<br>
>> >> >> > the Matlab version.<br>
>> >> >> > 2- If this is not possible, how to import in Matlab an already<br>
>> >> >> computed<br>
>> >> >> > inverse solution (oct-6-meg-inv.fif) into Matlab so I have the<br>
>> data<br>
>> >> >> ready<br>
>> >> >> > for further analysis in Matlab?<br>
>> >> >> ><br>
>> >> >> > Thank you,<br>
>> >> >> > Ade<br>
>> >> >> > ______________________________<wbr>_________________<br>
>> >> >> > Mne_analysis mailing list<br>
>> >> >> > <a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.<wbr>edu</a><br>
>> >> >> > <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.<wbr>edu/mailman/listinfo/mne_<wbr>analysis</a><br>
>> >> >><br>
>> >> >><br>
>> >> >> -------------------------<br>
>> >> >> Sheraz Khan, M.Eng, Ph.D.<br>
>> >> >> Instructor in Neurology<br>
>> >> >><br>
>> >> >> Athinoula A. Martinos Center for Biomedical Imaging<br>
>> >> >> Massachusetts General Hospital<br>
>> >> >> Harvard Medical School<br>
>> >> >><br>
>> >> >> McGovern Institute for Brain Research<br>
>> >> >> Massachusetts Institute of Technology<br>
>> >> >><br>
>> >> >> Tel: <a href="tel:%2B1%20617-643-5634" value="+16176435634">+1 617-643-5634</a><br>
>> >> >> Fax: <a href="tel:%2B1%20617-948-5966" value="+16179485966">+1 617-948-5966</a><br>
>> >> >> Email: <a href="mailto:sheraz@nmr.mgh.harvard.edu">sheraz@nmr.mgh.harvard.edu</a><br>
>> >> >> <a href="mailto:sheraz@mit.edu">sheraz@mit.edu</a><br>
>> >> >> Web: <a href="http://sheraz.mit.edu" rel="noreferrer" target="_blank">http://sheraz.mit.edu</a><br>
>> >> >> ______________________________<wbr>_________________<br>
>> >> >> Mne_analysis mailing list<br>
>> >> >> <a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.<wbr>edu</a><br>
>> >> >> <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.<wbr>edu/mailman/listinfo/mne_<wbr>analysis</a><br>
>> >> >><br>
>> >> >><br>
>> >> >> The information in this e-mail is intended only for the person to<br>
>> >> whom<br>
>> >> >> it<br>
>> >> >> is<br>
>> >> >> addressed. If you believe this e-mail was sent to you in error and<br>
>> >> the<br>
>> >> >> e-mail<br>
>> >> >> contains patient information, please contact the Partners<br>
>> Compliance<br>
>> >> >> HelpLine at<br>
>> >> >> <a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank">http://www.partners.org/<wbr>complianceline</a> . If the e-mail was sent to<br>
>> >> you<br>
>> >> >> in<br>
>> >> >> error<br>
>> >> >> but does not contain patient information, please contact the<br>
>> sender<br>
>> >> and<br>
>> >> >> properly<br>
>> >> >> dispose of the e-mail.<br>
>> >> >><br>
>> >> >><br>
>> >> ><br>
>> >><br>
>> >><br>
>> >> -------------------------<br>
>> >> Sheraz Khan, M.Eng, Ph.D.<br>
>> >> Instructor in Neurology<br>
>> >><br>
>> >> Athinoula A. Martinos Center for Biomedical Imaging<br>
>> >> Massachusetts General Hospital<br>
>> >> Harvard Medical School<br>
>> >><br>
>> >> McGovern Institute for Brain Research<br>
>> >> Massachusetts Institute of Technology<br>
>> >><br>
>> >> Tel: <a href="tel:%2B1%20617-643-5634" value="+16176435634">+1 617-643-5634</a><br>
>> >> Fax: <a href="tel:%2B1%20617-948-5966" value="+16179485966">+1 617-948-5966</a><br>
>> >> Email: <a href="mailto:sheraz@nmr.mgh.harvard.edu">sheraz@nmr.mgh.harvard.edu</a><br>
>> >> <a href="mailto:sheraz@mit.edu">sheraz@mit.edu</a><br>
>> >> Web: <a href="http://sheraz.mit.edu" rel="noreferrer" target="_blank">http://sheraz.mit.edu</a><br>
>> >><br>
>> ><br>
>><br>
>><br>
>> -------------------------<br>
>> Sheraz Khan, M.Eng, Ph.D.<br>
>> Instructor in Neurology<br>
>><br>
>> Athinoula A. Martinos Center for Biomedical Imaging<br>
>> Massachusetts General Hospital<br>
>> Harvard Medical School<br>
>><br>
>> McGovern Institute for Brain Research<br>
>> Massachusetts Institute of Technology<br>
>><br>
>> Tel: <a href="tel:%2B1%20617-643-5634" value="+16176435634">+1 617-643-5634</a><br>
>> Fax: <a href="tel:%2B1%20617-948-5966" value="+16179485966">+1 617-948-5966</a><br>
>> Email: <a href="mailto:sheraz@nmr.mgh.harvard.edu">sheraz@nmr.mgh.harvard.edu</a><br>
>> <a href="mailto:sheraz@mit.edu">sheraz@mit.edu</a><br>
>> Web: <a href="http://sheraz.mit.edu" rel="noreferrer" target="_blank">http://sheraz.mit.edu</a><br>
>><br>
><br>
<br>
<br>
-------------------------<br>
Sheraz Khan, M.Eng, Ph.D.<br>
Instructor in Neurology<br>
<br>
Athinoula A. Martinos Center for Biomedical Imaging<br>
Massachusetts General Hospital<br>
Harvard Medical School<br>
<br>
McGovern Institute for Brain Research<br>
Massachusetts Institute of Technology<br>
<br>
Tel: <a href="tel:%2B1%20617-643-5634" value="+16176435634">+1 617-643-5634</a><br>
Fax: <a href="tel:%2B1%20617-948-5966" value="+16179485966">+1 617-948-5966</a><br>
Email: <a href="mailto:sheraz@nmr.mgh.harvard.edu">sheraz@nmr.mgh.harvard.edu</a><br>
<a href="mailto:sheraz@mit.edu">sheraz@mit.edu</a><br>
Web: <a href="http://sheraz.mit.edu" rel="noreferrer" target="_blank">http://sheraz.mit.edu</a><br>
</div></div></blockquote></div><br></div>