<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr"><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 style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Dear Eric,</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);">
Thank you for your email. Yes, I have checked the coregistration and MEG-MRI coregistration seems fine given the overlay figure, and the dSPM for the evoked response of sound onsets (although it looks like the PT activity is spreading toward posterior STS;
 is this something common in MEG recon? Or does it mean the coreg is actually poor?).</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 regards,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
-SG</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> mne_analysis-bounces@nmr.mgh.harvard.edu &lt;mne_analysis-bounces@nmr.mgh.harvard.edu&gt; on behalf of Eric Larson &lt;larson.eric.d@gmail.com&gt;<br>
<b>Sent:</b> Friday, February 14, 2020 9:46 AM<br>
<b>To:</b> Discussion and support forum for the users of MNE Software &lt;mne_analysis@nmr.mgh.harvard.edu&gt;<br>
<b>Subject:</b> Re: [Mne_analysis] DICS beamformer</font>
<div>&nbsp;</div>
</div>
<div>
<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'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="x_gmail_quote">
<div dir="ltr" class="x_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="x_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)">&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 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&#43;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)">'/mnt/data/MEG_pitch/data/fs&#43;mne/' </span>&#43; subj &#43; <span style="color:rgb(140,206,53)">'/meg/'<br></span>epochs = mne.read_epochs(dname_meg &#43; <span style="color:rgb(140,206,53)">'all_tsss_hp0.5Hz_notch50sHz_cor_epo.fif'</span>)<br>fname_fwd = <span style="color:rgb(140,206,53)">&quot;/mnt/data/MEG_pitch/data/fs&#43;mne/&quot; </span>&#43; subj &#43; <span style="color:rgb(140,206,53)">&quot;/bem/&quot; </span>&#43; subj &#43; <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)">'CT20RNR'<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)">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</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="https://urldefense.proofpoint.com/v2/url?u=http-3A__epochs.info&amp;d=DwMGaQ&amp;c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&amp;r=Oo6kXvV9N4AHFS-wWXXAKKDl4dUe6z92y4XtIzLkZJY&amp;m=03nUvJsvDMigS5h-APMr-YTrVTN8dzxfUVgR1MXBUkU&amp;s=3YrE589SYu_GBEuvYVeamwSDpiNWdMNLZSRsyH4Nrvs&amp;e=" target="_blank"><font color="red"><b>MailScanner has detected a possible fraud attempt from "urldefense.proofpoint.com" claiming to be</b></font> 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)">'max-power'</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)">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </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)">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</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)">&nbsp; &nbsp; &nbsp; &nbsp; </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)">'mayavi'</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)">'lat'</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).&nbsp;</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),&nbsp;<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),&nbsp;</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%" data-outlook-trace="F:1|T:1" 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%" data-outlook-trace="F:1|T:1" 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://urldefense.proofpoint.com/v2/url?u=https-3A__mne.tools_dev_auto-5Fexamples_inverse_plot-5Fdics-5Fsource-5Fpower.html&amp;d=DwMGaQ&amp;c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&amp;r=Oo6kXvV9N4AHFS-wWXXAKKDl4dUe6z92y4XtIzLkZJY&amp;m=03nUvJsvDMigS5h-APMr-YTrVTN8dzxfUVgR1MXBUkU&amp;s=UJEk1ej1vp7FarL5-twGTh9sv8H0P3YAAbTbokjGRHw&amp;e=" id="x_gmail-m_-2099193686266710740LPlnk867471" target="_blank" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt"><font color="red"><b>MailScanner has detected a possible fraud attempt from "urldefense.proofpoint.com" claiming to be</b></font> 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="x_gmail-m_-2099193686266710740LPBorder_GTaHR0cHM6Ly9tbmUudG9vbHMvZGV2L2F1dG9fZXhhbXBsZXMvaW52ZXJzZS9wbG90X2RpY3Nfc291cmNlX3Bvd2VyLmh0bWw." style="width:100%; margin-top:16px; margin-bottom:16px; max-width:800px; min-width:424px">
<table id="x_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="x_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="x_gmail-m_-2099193686266710740LPUrlAnchor158293" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__mne.tools_dev_auto-5Fexamples_inverse_plot-5Fdics-5Fsource-5Fpower.html&amp;d=DwMGaQ&amp;c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&amp;r=Oo6kXvV9N4AHFS-wWXXAKKDl4dUe6z92y4XtIzLkZJY&amp;m=03nUvJsvDMigS5h-APMr-YTrVTN8dzxfUVgR1MXBUkU&amp;s=UJEk1ej1vp7FarL5-twGTh9sv8H0P3YAAbTbokjGRHw&amp;e=" target="_blank" style="text-decoration:none">Compute
 source power using DICS beamfomer — MNE 0.20.dev0 documentation</a></div>
<div id="x_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="x_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://urldefense.proofpoint.com/v2/url?u=https-3A__mail.nmr.mgh.harvard.edu_mailman_listinfo_mne-5Fanalysis&amp;d=DwMGaQ&amp;c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&amp;r=Oo6kXvV9N4AHFS-wWXXAKKDl4dUe6z92y4XtIzLkZJY&amp;m=03nUvJsvDMigS5h-APMr-YTrVTN8dzxfUVgR1MXBUkU&amp;s=r8ifHkkMe6YvBsKZ3EaN3AORFhcQYILVcbJSw891kxU&amp;e=" rel="noreferrer" target="_blank"><font color="red"><b>MailScanner has detected a possible fraud attempt from "urldefense.proofpoint.com" claiming to be</b></font> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a></blockquote>
</div>
</div>
</body>
</html>