<div dir="ltr">Hello Isaiah,<br><div class="gmail_extra"><br><br><div class="gmail_quote">2014-08-29 0:07 GMT+02:00 Isaiah C. Smith <span dir="ltr">&lt;<a href="mailto:Isaiah.C.Smith.17@dartmouth.edu" target="_blank">Isaiah.C.Smith.17@dartmouth.edu</a>&gt;</span>:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">



<div style="word-wrap:break-word">
Hello Denis,
<div><br>
</div>
<div>I am trying to use the python that you posted to Github, and I have a few questions concerning the parameters. Am I correct in my assumptions below? And where do I place the file strings to be read?</div>
<div>
<pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;margin-top:0px;margin-bottom:0px;width:748px;color:rgb(51,51,51);line-height:16.7999992370605px"><div><span></span></div></pre></div></div>

</blockquote><div><br></div><div>you mean how to read the matfiles?</div><div><br></div><div>import <a href="http://scipy.io">scipy.io</a></div><div><br></div><div>mat = io.loadmat(&#39;mymatfile.mat&#39;)</div><div> </div>

<div>but be careful, matfiles are often very nested. It can take while to access everything that&#39;s in there.</div><div>It&#39;s usually represented as python dictionary and numpy structured array, just to give you some buzz words you can google.</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;margin-top:0px;margin-bottom:0px;width:748px;color:rgb(51,51,51);line-height:16.7999992370605px">

<div><span>sfreq</span> <span style="font-weight:bold">=</span> <span style="color:rgb(0,153,153)">1e3   % sampling rate</span></div><div><br></div></pre></div></div></blockquote><div><br></div><div>yes</div><div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;margin-top:0px;margin-bottom:0px;width:748px;color:rgb(51,51,51);line-height:16.7999992370605px"><div>

</div><div><span>ch_types</span> <span style="font-weight:bold">=</span> <span>[</span><span style="color:rgb(221,17,68)">&#39;misc&#39;</span><span>]</span> <span style="font-weight:bold">*</span> <span style="color:rgb(0,153,153)">248    % &quot;248&quot; to “64” channels and ‘misc’ to ‘eeg&#39;</span></div>


<div> </div></pre></div></div></blockquote><div>yes, put &#39;eeg&#39; here and your channel number.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div style="word-wrap:break-word"><div><pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;margin-top:0px;margin-bottom:0px;width:748px;color:rgb(51,51,51);line-height:16.7999992370605px"><div>

<span>ch_names</span> <span style="font-weight:bold">=</span> <span>[</span><span style="color:rgb(221,17,68)">&#39;MISC {:03d}&#39;</span><span style="font-weight:bold">.</span><span>format</span><span>(</span><span>i</span> <span style="font-weight:bold">+</span> <span style="color:rgb(0,153,153)">1</span><span>)</span> <span style="font-weight:bold">for</span> <span>i</span> <span style="font-weight:bold">in</span> <span style="color:rgb(0,134,179)">range</span><span>(</span><span style="color:rgb(0,134,179)">len</span><span>(</span><span>ch_type</span><span>))]   % This one I think you can directly copy </span></div>

</pre></div></div></blockquote><div><br></div><div>yes</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div style="word-wrap:break-word"><div><pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;margin-top:0px;margin-bottom:0px;width:748px;color:rgb(51,51,51);line-height:16.7999992370605px"><div>

 </div><div><span>info</span> <span style="font-weight:bold">=</span> <span>mne</span><span style="font-weight:bold">.</span><span>create_info</span><span>(</span><span>ch_names</span><span style="font-weight:bold">=</span><span>ch_names</span><span>,</span> <span>sfreq</span><span style="font-weight:bold">=</span><span>sfreq</span><span>,</span> <span>ch_types</span><span style="font-weight:bold">=</span><span>ch_types</span><span>)   % Directly copy</span></div>

</pre></div></div></blockquote><div><br></div><div>yes </div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div style="word-wrap:break-word"><div><pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;margin-top:0px;margin-bottom:0px;width:748px;color:rgb(51,51,51);line-height:16.7999992370605px"><div>

 </div><div><span>raw</span> <span style="font-weight:bold">=</span> <span>mne</span><span style="font-weight:bold">.</span><span>io</span><span style="font-weight:bold">.</span><span>RawArray</span><span>(</span><span>data</span><span>,</span> <span>info</span><span>)   % data is the a N*M matrix (N is the number of channel, M is the number of timepoints</span></div>

</pre></div></div></blockquote><div><br></div><div>exactly</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div style="word-wrap:break-word"><div><pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;margin-top:0px;margin-bottom:0px;width:748px;color:rgb(51,51,51);line-height:16.7999992370605px"><div>

<span style="line-height:16.7999992370605px"><br></span></div><div><span style="line-height:16.7999992370605px">raw</span><span style="line-height:16.7999992370605px;font-weight:bold">.</span><span style="line-height:16.7999992370605px">save</span><span style="line-height:16.7999992370605px">(</span><span style="line-height:16.7999992370605px;color:rgb(221,17,68)">&#39;misc.fif&#39;</span><span style="line-height:16.7999992370605px">)   % directly copy</span></div>

<div><span style="line-height:16.7999992370605px"><br></span></div></pre></div></div></blockquote><div><br></div><div>yes, chose an approrpiate name, e.g. &#39;subject-1-raw.fif&#39;</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div style="word-wrap:break-word"><div><pre style="font-family:Consolas,&#39;Liberation Mono&#39;,Menlo,Courier,monospace;margin-top:0px;margin-bottom:0px;width:748px;color:rgb(51,51,51);line-height:16.7999992370605px"><div>

<span style="line-height:16.7999992370605px"></span></div><div><br></div></pre>
<div></div>
</div>
<div>&lt;cfg.mat&gt;</div>
<div>
<div></div>
</div>
<div>&lt;data.mat&gt;</div>
<div>
<div></div>
</div>
<div>&lt;elec.mat&gt;</div>
<div>
<div><a href="https://drive.google.com/file/d/0B2VQnrnlkkKETl9jUDVtb3JyNlk/edit?usp=sharing" target="_blank">https://drive.google.com/file/d/0B2VQnrnlkkKETl9jUDVtb3JyNlk/edit?usp=sharing</a></div>
<div><a href="https://drive.google.com/file/d/0B2VQnrnlkkKEWEJGT1JpaHd3SW8/edit?usp=sharing" target="_blank">https://drive.google.com/file/d/0B2VQnrnlkkKEWEJGT1JpaHd3SW8/edit?usp=sharing</a></div>
<div><a href="https://drive.google.com/file/d/0B2VQnrnlkkKEWms0S0ozdTgxLTg/edit?usp=sharing" target="_blank">https://drive.google.com/file/d/0B2VQnrnlkkKEWms0S0ozdTgxLTg/edit?usp=sharing</a></div>
<div><br>
</div>
</div>
<div>
<div></div>
</div>
<div>These are the data set that I am working with. Do they correspond? </div>
<div><br></div></div></blockquote><div><br></div><div>what do you mean by &#39;correspond&#39;? </div><div><br></div><div>basically anything goes as long as you know how to access the actual data arrays.</div><div> </div>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>
</div>
<div>Sorry, I have been trying to do this for while. Once the data is changed, I can get the forward model and the gain matrix since I already have the bems?</div>
<div><br></div></div></blockquote><div><br></div><div>yes. sounds like it. but you also need to add a montage / the channel positions you might have measured using a polhemus device.</div><div><br></div><div>here&#39;s a pull request on that which I abandond. Will be back on this around October.</div>

<div><br></div><div><a href="https://github.com/mne-tools/mne-python/pull/1390">https://github.com/mne-tools/mne-python/pull/1390</a><br></div><div><br></div><div>This code hopefully gives you an idea about what&#39;s to do for adding channel posiitons.</div>

<div><br></div><div><a href="https://github.com/dengemann/mne-python/blob/montage/mne/montages/montage.py#L148">https://github.com/dengemann/mne-python/blob/montage/mne/montages/montage.py#L148</a><br></div><div><br></div>

<div><br></div><div>HTH,</div><div>Denis </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div style="word-wrap:break-word"><div>
</div>
<div><br>
</div>
<div>Thanks, </div><span class=""><font color="#888888">
<div>Isaiah  </div></font></span><div><div class="h5">
<div>
<div>On Aug 25, 2014, at 3:52 PM, Isaiah C. Smith &lt;<a href="mailto:Isaiah.C.Smith.17@dartmouth.edu" target="_blank">Isaiah.C.Smith.17@dartmouth.edu</a>&gt; wrote:</div>
<br>
<blockquote type="cite">
<div style="word-wrap:break-word">
Thanks Denis,
<div><br>
</div>
<div>I will tell you how it goes.</div>
<div><br>
</div>
<div>Isaiah<br>
<div>
<div>On Aug 25, 2014, at 3:47 PM, Denis-Alexander Engemann &lt;<a href="mailto:denis.engemann@gmail.com" target="_blank">denis.engemann@gmail.com</a>&gt; wrote:</div>
<br>
<blockquote type="cite">
<div dir="ltr">Dear Isaiah,
<div><br>
</div>
<div>Here&#39;s an example of how to do it:</div>
<div><br>
</div>
<div><a href="https://gist.github.com/dengemann/e9b45f2ff3e3380907d3" target="_blank">https://gist.github.com/dengemann/e9b45f2ff3e3380907d3</a><br>
</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">I hope this helps.</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">-Denis<br>
<br>
<div class="gmail_quote">2014-08-26 0:10 GMT+02:00 Denis A. Engemann <span dir="ltr">
&lt;<a href="mailto:denis.engemann@gmail.com" target="_blank">denis.engemann@gmail.com</a>&gt;</span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Hi Isaiah,<br>
<br>
yes this is correct.<br>
Take look at the documentation string to get an idea how to use it,<br>
basically you pass the data matrix, the sampling rate, a list of channel types, like [&#39;eeg&#39;] * 128 for 128 EEG channels and that&#39;s it for constructing a Raw object whose .save method you can then use to create a fiff file.<br>


<br>
Please let me know how it goes.<br>
<br>
HTH,<br>
Denis<br>
<div>
<div><br>
<br>
<br>
&gt; On 25 Aug 2014, at 23:53, &quot;Isaiah C. Smith&quot; &lt;<a href="mailto:Isaiah.C.Smith.17@dartmouth.edu" target="_blank">Isaiah.C.Smith.17@dartmouth.edu</a>&gt; wrote:<br>
&gt;<br>
&gt; Thanks Denis for the response,<br>
&gt;<br>
&gt; Do you mean that we can use Evoked Array to Convert the data into the .fiff? We are able to extract the EEG data &amp; electrode location data information using matlab. Also, we know the sampling rate information. So can we use some tools (e.g. mne.io.RawArray,
 mne.EpochsArray and mne) to convert into fiff format?<br>
&gt;<br>
&gt; Isaiah<br>
&gt;<br>
&gt;&gt; On Aug 25, 2014, at 12:19 PM, Denis A. Engemann &lt;<a href="mailto:denis.engemann@gmail.com" target="_blank">denis.engemann@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; We have mne.io.RawArray, mne.EpochsArray and mne. EvokedArray for such cases.<br>
&gt;&gt; Once you can extract the data and some info on sampling rate it&#39;s trivial to construct fiff compatible data-structures..<br>
&gt;&gt; Unfortunately we still don&#39;t have an example for that in MNE-Python ...<br>
&gt;&gt;<br>
&gt;&gt; --Denis<br>
&gt;&gt;<br>
&gt;&gt;&gt; On 25 Aug 2014, at 20:25, <a href="mailto:dgwakeman@gmail.com" target="_blank">dgwakeman@gmail.com</a> wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Hi Isaiah,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; You provided the suffixes of the files not the name of the file types. The first thin I would try to do is look for a file converter or reader. If you cannot find a converter for whatever file types these are, but you are able to read the files with some
 toolbox: you could read in those data files and replace all of the fields in the raw sample data set with your data. This is something I only recommend for advanced users as there are a lot of details you need to keep track of.<br>


&gt;&gt;&gt;<br>
&gt;&gt;&gt; HTH<br>
&gt;&gt;&gt; D<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Sent from my phone<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Aug 25, 2014, at 14:23, &quot;Isaiah C. Smith&quot; &lt;<a href="mailto:Isaiah.C.Smith.17@dartmouth.edu" target="_blank">Isaiah.C.Smith.17@dartmouth.edu</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Hello Experts,<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I need to get the gain matrix using MNE. I have made my bem models, but I need help with the EEG conversion data. Could someone help me through this process so that I can view the matrix?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; These are the formats of the electrode location files that I have.<br>
&gt;&gt;&gt;&gt; &lt;Screen Shot 2014-08-24 at 12.33.11 PM.png&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; And these are the formats of the EEG data that I have.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; &lt;Screen Shot 2014-08-24 at 12.33.27 PM.png&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Thank you,<br>
&gt;&gt;&gt;&gt; Isaiah Smith<br>
&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt;&gt; Mne_analysis mailing list<br>
&gt;&gt;&gt;&gt; <a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
&gt;&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;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; The information in this e-mail is intended only for the person to whom it is<br>
&gt;&gt;&gt;&gt; addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
&gt;&gt;&gt;&gt; contains patient information, please contact the Partners Compliance HelpLine at<br>
&gt;&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 in error<br>
&gt;&gt;&gt;&gt; but does not contain patient information, please contact the sender and properly<br>
&gt;&gt;&gt;&gt; dispose of the e-mail.<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" target="_blank">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;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Mne_analysis mailing list<br>
&gt;&gt; <a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">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; Mne_analysis mailing list<br>
&gt; <a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">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>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<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>
<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" 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>
</blockquote>
</div>
<br>
</div>
</div>
_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<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>
<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" 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>
</blockquote>
</div>
<br>
</div></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" 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" 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>