<p><span style="padding: 3px 10px; border-radius: 5px; color: #ffffff; font-weight: bold; display: inline-block; background-color: #ff0000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p><p></p><div dir="ltr">Have you checked some basics? For example, do you have at some points sensor-space patterns that look like bilateral auditory activation? In your source reconstruction do you get a reasonable auditory N100 localization to the stimulus onset? I would check these first (if possible for your paradigm) if you haven&#39;t. Knowing that they are correct rules out things like coregistration or epoching errors and helps narrow it down to being related to the method of source localization (DICS).<div><div><br></div><div>Eric</div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 13, 2020 at 3:17 PM Seung Goo Kim, Ph.D. &lt;<a href="mailto:seunggoo.kim@duke.edu">seunggoo.kim@duke.edu</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr"><p><span style="padding:3px 10px;border-radius:5px;color:rgb(255,255,255);font-weight:bold;display:inline-block;background-color:rgb(255,0,0)">        External Email - Use Caution        </span></p><p></p>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
Dear list,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
I am having difficulties in applying the DICS beamformer on induced responses by an amplitude modulation in auditory signals. The script I used was:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<pre style="font-family:&quot;Ubuntu Mono&quot;;font-size:12pt;background-color:rgb(27,27,27);color:rgb(225,225,225)"><span style="color:rgb(204,120,50)">import </span>mne<span style="color:rgb(204,120,50)">, </span>os<span style="color:rgb(204,120,50)">, </span>pandas <span style="color:rgb(204,120,50)">as </span>pd<span style="color:rgb(204,120,50)">, </span>numpy <span style="color:rgb(204,120,50)">as </span>np<span style="color:rgb(204,120,50)">, </span>matplotlib.pyplot <span style="color:rgb(204,120,50)">as </span>plt<br><span style="color:rgb(204,120,50)">from </span>mne.time_frequency <span style="color:rgb(204,120,50)">import </span>csd_morlet<br><span style="color:rgb(204,120,50)">from </span>mne.beamformer <span style="color:rgb(204,120,50)">import </span>make_dics<span style="color:rgb(204,120,50)">, </span>apply_dics_csd<br>mne.set_config(<span style="color:rgb(140,206,53)">&quot;SUBJECTS_DIR&quot;</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(140,206,53)">&quot;/mnt/data/MEG_pitch/data/fs+mne&quot;</span>)<br>df = pd.read_excel(<br>    <span style="color:rgb(140,206,53)">&quot;/mnt/data/MEG_pitch/data/rawdata/MEGStudy/Subjects.xlsx&quot;</span><span style="color:rgb(204,120,50)">,<br></span><span style="color:rgb(204,120,50)">    </span><span style="color:rgb(203,97,66)">sheet_name</span>=<span style="color:rgb(140,206,53)">&quot;rawdata&quot;</span>)<br>subjects = df.SubjectID[(df.goodmeg_for_tsss * df.goodmri_for_coreg) == <span style="color:rgb(204,120,50)">True</span>]<br><br>subj=subjects[<span style="color:rgb(104,151,187)">1</span>]<br>dname_meg = <span style="color:rgb(140,206,53)">&#39;/mnt/data/MEG_pitch/data/fs+mne/&#39; </span>+ subj + <span style="color:rgb(140,206,53)">&#39;/meg/&#39;<br></span>epochs = mne.read_epochs(dname_meg + <span style="color:rgb(140,206,53)">&#39;all_tsss_hp0.5Hz_notch50sHz_cor_epo.fif&#39;</span>)<br>fname_fwd = <span style="color:rgb(140,206,53)">&quot;/mnt/data/MEG_pitch/data/fs+mne/&quot; </span>+ subj + <span style="color:rgb(140,206,53)">&quot;/bem/&quot; </span>+ subj + <span style="color:rgb(140,206,53)">&quot;-4098-fwd.fif&quot;<br></span>fwd = mne.read_forward_solution(fname_fwd)<br>freq = [<span style="color:rgb(104,151,187)">40</span>]<br>n_cycles = <span style="color:rgb(104,151,187)">4<br></span>cond = <span style="color:rgb(140,206,53)">&#39;CT20RNR&#39;<br></span>epochs_cond = epochs[cond]<br><br><span style="color:rgb(128,128,128)"># compute cross-spectral density over the whole epoch<br></span><pre style="font-family:&quot;Ubuntu Mono&quot;;font-size:12pt;background-color:rgb(27,27,27);color:rgb(225,225,225)">csd = csd_morlet(epochs_cond<span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">tmin</span>=-<span style="color:rgb(104,151,187)">0.5</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">tmax</span>=<span style="color:rgb(104,151,187)">2.3</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">frequencies</span>=freq<span style="color:rgb(204,120,50)">,<br></span><span style="color:rgb(204,120,50)">                 </span><span style="color:rgb(203,97,66)">decim</span>=<span style="color:rgb(104,151,187)">20</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">n_cycles</span>=n_cycles)<br>filters = make_dics(<a href="http://epochs.info" target="_blank">epochs.info</a><span style="color:rgb(204,120,50)">, </span>fwd<span style="color:rgb(204,120,50)">, </span>csd.mean()<span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">pick_ori</span>=<span style="color:rgb(140,206,53)">&#39;max-power&#39;</span>)<br><br>csd_base = csd_morlet(epochs_cond<span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">tmin</span>=-<span style="color:rgb(104,151,187)">0.5</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">tmax</span>=<span style="color:rgb(104,151,187)">0</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">frequencies</span>=freq<span style="color:rgb(204,120,50)">,<br></span><span style="color:rgb(204,120,50)">                      </span><span style="color:rgb(203,97,66)">decim</span>=<span style="color:rgb(104,151,187)">20</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">n_cycles</span>=n_cycles)<br>baseline_power = apply_dics_csd(csd_base.mean()<span style="color:rgb(204,120,50)">, </span>filters)<br>csd_R = csd_morlet(epochs_cond<span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">tmin</span>=<span style="color:rgb(104,151,187)">1.7</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">tmax</span>=<span style="color:rgb(104,151,187)">2.2</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">frequencies</span>=freq<span style="color:rgb(204,120,50)">,<br></span><span style="color:rgb(204,120,50)">                   </span><span style="color:rgb(203,97,66)">decim</span>=<span style="color:rgb(104,151,187)">20</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">n_cycles</span>=n_cycles)<br>R_power = apply_dics_csd(csd_R.mean()<span style="color:rgb(204,120,50)">, </span>filters)<br>stc = R_power[<span style="color:rgb(104,151,187)">0</span>] / baseline_power[<span style="color:rgb(104,151,187)">0</span>]<br></pre><pre style="font-family:&quot;Ubuntu Mono&quot;;font-size:12pt;background-color:rgb(27,27,27);color:rgb(225,225,225)">stc.plot(<span style="color:rgb(203,97,66)">subject</span>=subj<span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">surface</span>=<span style="color:rgb(140,206,53)">&quot;inflated&quot;</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">hemi</span>=<span style="color:rgb(140,206,53)">&quot;both&quot;</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">time_viewer</span>=<span style="color:rgb(204,120,50)">False,<br></span><span style="color:rgb(204,120,50)">        </span><span style="color:rgb(203,97,66)">initial_time</span>=<span style="color:rgb(104,151,187)">0</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">transparent</span>=<span style="color:rgb(204,120,50)">True, </span><span style="color:rgb(203,97,66)">backend</span>=<span style="color:rgb(140,206,53)">&#39;mayavi&#39;</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">views</span>=<span style="color:rgb(140,206,53)">&#39;lat&#39;</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(203,97,66)">size</span>=<span style="color:rgb(104,151,187)">400</span>)</pre><br></pre>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
In the stimulus, only a specific part (from 1.4 sec to 2.3 sec after stimulus onset) has a regular amplitude modulation, so I wanted to compare this part vs. baseline (from -0.5 sec to 0 sec). </div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<br>
</div>
So what I did was (1) computing a common filter for the entire epoch (from -0.5 sec to 2.3 sec after stimulus onset), <span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">(2) computing CSD for the baseline (from -0.5 sec to 0 sec), </span><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">(3)
 computing CSD for the &quot;regular&quot; part (from 1.7 sec to 2.2 sec; same 500 ms as the baseline), and (4) found the ratio of them.</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">Since this was an auditory experiment, I expected this should be localized in the auditory cortices (bilaterally), but the result looks completely unexpected:</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><img size="122489" style="max-width: 100%;" src="cid:17044277e7dcb971f161"><br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><img size="93833" style="max-width: 100%;" src="cid:17044277e7dcb971f162"><br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt"><br>
</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">The code is simply a modification of the tutorial (</span><a href="https://mne.tools/dev/auto_examples/inverse/plot_dics_source_power.html" id="gmail-m_-2099193686266710740LPlnk867471" style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" target="_blank">https://mne.tools/dev/auto_examples/inverse/plot_dics_source_power.html</a><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt">),
 so I am very puzzled.</span><br>
</div>
<div id="gmail-m_-2099193686266710740LPBorder_GTaHR0cHM6Ly9tbmUudG9vbHMvZGV2L2F1dG9fZXhhbXBsZXMvaW52ZXJzZS9wbG90X2RpY3Nfc291cmNlX3Bvd2VyLmh0bWw." style="width:100%;margin-top:16px;margin-bottom:16px;max-width:800px;min-width:424px">
<table id="gmail-m_-2099193686266710740LPContainer158293" style="padding:12px 36px 12px 12px;width:100%;border-width:1px;border-style:solid;border-color:rgb(200,200,200);border-radius:2px">
<tbody>
<tr valign="top" style="border-spacing:0px">
<td style="width:100%">
<div id="gmail-m_-2099193686266710740LPTitle158293" style="font-size:21px;font-weight:300;margin-right:8px;font-family:wf_segoe-ui_light,&quot;Segoe UI Light&quot;,&quot;Segoe WP Light&quot;,&quot;Segoe UI&quot;,&quot;Segoe WP&quot;,Tahoma,Arial,sans-serif;margin-bottom:12px">
<a id="gmail-m_-2099193686266710740LPUrlAnchor158293" href="https://mne.tools/dev/auto_examples/inverse/plot_dics_source_power.html" style="text-decoration:none" target="_blank">Compute source power using DICS beamfomer — MNE 0.20.dev0 documentation</a></div>
<div id="gmail-m_-2099193686266710740LPDescription158293" style="font-size:14px;max-height:100px;font-family:wf_segoe-ui_normal,&quot;Segoe UI&quot;,&quot;Segoe WP&quot;,Tahoma,Arial,sans-serif;margin-bottom:12px;margin-right:8px;overflow:hidden;color:rgb(102,102,102)">
Compute source power using DICS beamfomer¶. Compute a Dynamic Imaging of Coherent Sources (DICS) 1 filter from single-trial activity to estimate source power across a frequency band. This example demonstrates how to source localize the event-related synchronization
 (ERS) of beta band activity in this dataset: Somatosensory</div>
<div id="gmail-m_-2099193686266710740LPMetadata158293" style="font-size:14px;font-weight:400;font-family:wf_segoe-ui_normal,&quot;Segoe UI&quot;,&quot;Segoe WP&quot;,Tahoma,Arial,sans-serif;color:rgb(166,166,166)">
mne.tools</div>
</td>
</tr>
</tbody>
</table>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
Any suggestions on where to look/check would be greatly appreciated!<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
Best,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255)">
Seung-Goo Kim</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" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a></blockquote></div>