<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Ugo,<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 1 Apr 2023, at 23:33, Ugo Bruzadin Nunes via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Dear fieldtrip community,<o:p class=""></o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
I’m using some of eeglab’s<span class="Apple-converted-space"> </span><b class="">dipfit</b><span class="Apple-converted-space"> </span>settings to source-localize frequency activity, but this is mainly a fieldtrip issue. I hope anyone can help me and I appreciate
 any advice. I have two issues and one question.<o:p class=""></o:p></div>
<ol start="1" type="1" style="margin-bottom: 0in; margin-top: 0in;" class="">
<li class="MsoListParagraph" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
When I plot the source localization, the orientation is 90 degrees wrong. When using dipfit in eeglab, the activity is correctly localized; but after doing all the dipfit processes – altered to plot frequency instead of component – frontal activity is being
 plot in the right ear. I thought something was wrong, so I artificially increased the activity at channel 12 (the anterior-most channel in my channel model), and the activity is coming from the ear in the eloreta instead. I can’t figure out where the rotation
 is incorrect and how I should approach the solution, since in EEGLAB the channels are correctly plotted.</li></ol>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>You need to check the coregistration between the anatomical image that you use for visualization/source reconstruction, and the electrodes. Also you need to check the coordinate system convention used for the description of the electrodes, volume conduction
 model, source model, anatomical image. There’s abundant information about this on the fieldtrip website, so please check it out there.</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<ol start="1" type="1" style="margin-bottom: 0in; margin-top: 0in;" class="">
<li class="MsoListParagraph" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""></o:p></li><li class="MsoListParagraph" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
For some reason, fieldtrip won’t accept the atlas. The error says my axis are 10mm in diameter, and the atlas is 150mm in each direction. I’m reading the ROI_MNI_V4 atlas in. Do I have to interpolate it?</li></ol>
</div>
</div>
</blockquote>
<br class="">
<div>You don’t mention the error, just the textual feedback you get when you visualize a geometrical object. Also, it’s unclear what is meant with ‘fieldtrip won’t accept the atlas’. The ’some reason’ that you mention in your question/issue is at this point
 underspecified, so I doubt if anybody can say anything sensible about this. Also it is unclear for what reason you think that you need the atlas at this stage of your analysis.</div>
<div><br class="">
</div>
<blockquote type="cite" class="">
<div class="">
<div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<ol start="2" type="1" style="margin-bottom: 0in; margin-top: 0in;" class="">
<li class="MsoListParagraph" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""></o:p></li><li class="MsoListParagraph" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;">
I am not sure the following code is localizing and plotting the correct frequencies. I don’t think it’s working, but I haven’t tested individual frequencies yet since I haven’t fixed the headmodel orientation issue.</li></ol>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>I agree that you should fix any upstream issue before you can move on to the next part.</div>
<div><br class="">
</div>
<div>Good luck studying the online documentation.</div>
<div><br class="">
</div>
<div>Jan-Mathijs</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Below is my code! Any feedback is welcome. Thank you so much in advance,<o:p class=""></o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt;" class="">Ugo<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="" class=""> </span><o:p class=""></o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt; color: rgb(12, 100, 192); border: 1pt none windowtext; padding: 0in;" class="">Ugo Bruzadin Nunes, Ph.D. Candidate (he/him)</span><o:p class=""></o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt; color: rgb(12, 100, 192); border: 1pt none windowtext; padding: 0in;" class="">Visiting Assistant Professor, Psychology</span><o:p class=""></o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt; color: rgb(12, 100, 192); border: 1pt none windowtext; padding: 0in;" class="">Webster University<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt; color: rgb(12, 100, 192); border: 1pt none windowtext; padding: 0in;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Script/Code:<o:p class=""></o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">EEG = pop_dipfit_settings( EEG,<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'hdmfile'</span>,<span style="color: rgb(14, 0, 255);" class="">...</span><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">   <span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'C:\\GitHub\\eeglab\\plugins\\dipfit3.7\\standard_BEM\\standard_vol.mat'</span>,<span style="color: rgb(167, 9, 245);" class="">'coordformat'</span>,<span style="color: rgb(167, 9, 245);" class="">'MNI'</span>,<span style="color: rgb(167, 9, 245);" class="">'mrifile'</span>,<span style="color: rgb(14, 0, 255);" class="">...</span><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">   <span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'C:\\GitHub\\eeglab\\plugins\\dipfit3.7\\standard_BEM\\standard_mri.mat'</span>,<span style="color: rgb(167, 9, 245);" class="">'chanfile'</span>,<span style="color: rgb(14, 0, 255);" class="">...</span><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    [<span style="color: rgb(167, 9, 245);" class="">'C:\\GitHub\\eeglab\\plugins\\dipfit3.7\\standard_BEM\\elec\\standard_1005.elc '<span class="Apple-converted-space"> </span></span>],<span style="color: rgb(14, 0, 255);" class="">...</span><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">   <span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'coord_transform'</span>,<span style="color: rgb(14, 0, 255);" class="">...</span><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    [0.05476 -17.3653 -8.1318 0.075502 0.0031836 -1.5696 11.7138 12.7933 12.213] ,<span style="color: rgb(167, 9, 245);" class="">'chansel'</span>,[1:EEG.nbchan] );<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">atlas = ft_read_atlas(<span style="color: rgb(167, 9, 245);" class="">'ROI_MNI_V4.nii'</span>);<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas; color: rgb(0, 128, 19);" class="">%% compute spectral params (only need to be done once to get the right structures)</span><span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">EEGdata = eeglab2fieldtrip(EEG,<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'preprocessing'</span>,<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'none'</span>);<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">cfg = [];<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">cfg.method    =<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'mtmfft'</span>;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">cfg.output    =<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'powandcsd'</span>;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">cfg.tapsmofrq = 10;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">cfg.foilim    = range;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">cfg.pad =<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'nextpow2'</span>;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">cfg.gpu =<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'yes'</span>;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">fftdata = ft_freqanalysis(cfg, EEGdata);<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas; color: rgb(14, 0, 255);" class="">if<span class="Apple-converted-space"> </span></span><span style="font-size: 10pt; font-family: Consolas;" class="">~isfield(EEG,<span style="color: rgb(167, 9, 245);" class="">'lor'</span>)<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    EEG.lor = struct();<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas; color: rgb(14, 0, 255);" class="">end</span><span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">EEG.fftdata = fftdata;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas; color: rgb(0, 128, 19);" class="">%% read headmodel</span><span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">p = fileparts(which(<span style="color: rgb(167, 9, 245);" class="">'eeglab'</span>));<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas; color: rgb(14, 0, 255);" class="">if<span class="Apple-converted-space"> </span></span><span style="font-size: 10pt; font-family: Consolas;" class="">~isfield(EEG.lor,<span style="color: rgb(167, 9, 245);" class="">'HM'</span>)<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    headmodel = load(<span style="color: rgb(167, 9, 245);" class="">'-mat'</span>, EEG.dipfit.hdmfile);<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    headmodel = headmodel.vol;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    EEG.lor.HM = headmodel;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas; color: rgb(14, 0, 255);" class="">else</span><span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    headmodel  = EEG.lor.HM;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas; color: rgb(14, 0, 255);" class="">end</span><span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg                 = [];<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.elec            = fftdata.elec;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.headmodel       = headmodel;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.reducerank      = 2;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.grid.resolution = 10;  <span class="Apple-converted-space"> </span><span style="color: rgb(0, 128, 19);" class="">% use a 3-D grid with a 1 cm resolution</span><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.grid.unit       =<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'mm'</span>;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.channel         = {<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'all'<span class="Apple-converted-space"> </span></span>};<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.parallel =<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'yes'</span>;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.solver =<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'cg'</span>;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    [grid] = ft_prepare_leadfield(cfg);<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    EEG.lor.grid = grid;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas; color: rgb(0, 128, 19);" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas; color: rgb(0, 128, 19);" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    mri = load(<span style="color: rgb(167, 9, 245);" class="">'-mat'</span>, EEG.dipfit.mrifile);<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    mri = ft_volumereslice([], mri.mri);<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    EEG.lor.mri = mri;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">%% loops per frequency then plots<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">counter = 0;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">numfreq = size(frequencies,2);<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">EEGlor = EEG;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">vol = load(<span style="color: rgb(167, 9, 245);" class="">'-mat'</span>, EEG.dipfit.hdmfile);<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas; color: rgb(14, 0, 255);" class="">for<span class="Apple-converted-space"> </span></span><span style="font-size: 10pt; font-family: Consolas;" class="">i = 1:numfreq<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">   <span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    atlas = ft_read_atlas(<span style="color: rgb(167, 9, 245);" class="">'ROI_MNI_V4.nii'</span>);<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    freq = frequencies(i);<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">   <span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg              = struct(g.ft_sourceanalysis_params{:});<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.frequency    = freq;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.grid         = grid;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.headmodel    = headmodel;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.method       =<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'eloreta'</span>;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.atlas        = atlas;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.roi          = atlas.tissuelabel;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.eloreta.projectnoise =<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'yes'</span>;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.eloreta.lambda   = 5;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.gpu           =<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'yes'</span>;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">   <span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    sourcemodel = ft_sourceanalysis(cfg, fftdata);<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">   <span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    EEGlor.lor.cfg(numfreq) = cfg;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    EEGlor.lor.freq(numfreq) = fftdata;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    EEGlor.lor.source(numfreq) = sourcemodel;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas; color: rgb(0, 128, 19);" class="">%% load MRI and INTERPOLATE</span><span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg                 = [];<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.downsample      = 2;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.parameter       =<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'avg.pow'</span>;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    sourcemodel.oridimord =<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'pos'</span>;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    sourcemodel.momdimord =<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'pos'</span>;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    sourcemodel_int        = ft_sourceinterpolate(cfg2, sourcemodel , mri);<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    EEGlor.lor.source_int(numfreq) = sourcemodel_int;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas; color: rgb(0, 128, 19);" class="">%% plot</span><span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg                 = [];<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.method          =<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'ortho'</span>;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    cfg.funparameter    =<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'pow'</span>;<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    ft_sourceplot(cfg2,sourcemodel_int);<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class="">    textsc(sprintf(<span style="color: rgb(167, 9, 245);" class="">'eLoreta source localization of %d frequency power'</span>,freq),<span class="Apple-converted-space"> </span><span style="color: rgb(167, 9, 245);" class="">'title'</span>);<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas; color: rgb(0, 128, 19);" class="">%   </span><span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 10pt; font-family: Consolas; color: rgb(14, 0, 255);" class="">end</span><span style="font-size: 10pt; font-family: Consolas;" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt;" class="">Ugo<o:p class=""></o:p></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="" class=""> </span><o:p class=""></o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt; color: rgb(12, 100, 192); border: 1pt none windowtext; padding: 0in;" class="">Ugo Bruzadin Nunes, Ph.D. Candidate (he/him)</span><o:p class=""></o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt; color: rgb(12, 100, 192); border: 1pt none windowtext; padding: 0in;" class="">Visiting Professor, Psychology</span><o:p class=""></o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt; color: rgb(12, 100, 192); border: 1pt none windowtext; padding: 0in;" class="">Webster University</span><o:p class=""></o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt; color: rgb(12, 100, 192); border: 1pt none windowtext; padding: 0in;" class="">Office Location: ISB room 316</span><o:p class=""></o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt; color: rgb(12, 100, 192); border: 1pt none windowtext; padding: 0in;" class="">Office Number: (314) 968-7677</span><o:p class=""></o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt; color: rgb(12, 100, 192); border: 1pt none windowtext; padding: 0in;" class=""><a href="mailto:UgoBruzadinNunes@webster.edu" title="mailto:UgoBruzadinNunes@webster.edu" style="color: blue; text-decoration: underline;" class="">Ugo@webster.edu</a></span><o:p class=""></o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div class="">
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt;" class="">Ugo<o:p class=""></o:p></span></div>
</div>
<p class="xmsonormal" style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;">
<span style="" class=""> </span></p>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt; color: rgb(12, 100, 192); border: 1pt none windowtext; padding: 0in;" class="">Ugo Bruzadin Nunes, Ph.D. Candidate (he/him)</span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt; color: rgb(12, 100, 192); border: 1pt none windowtext; padding: 0in;" class="">Visiting Professor, Psychology</span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt; color: rgb(12, 100, 192); border: 1pt none windowtext; padding: 0in;" class="">Webster University</span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt; color: rgb(12, 100, 192); border: 1pt none windowtext; padding: 0in;" class="">Office Location: ISB room 316</span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt; color: rgb(12, 100, 192); border: 1pt none windowtext; padding: 0in;" class="">Office Number: (314) 968-7677</span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif; background-color: white; vertical-align: baseline;" class="">
<span style="font-size: 12pt; color: rgb(12, 100, 192); border: 1pt none windowtext; padding: 0in;" class=""><a href="mailto:UgoBruzadinNunes@webster.edu" title="mailto:UgoBruzadinNunes@webster.edu" style="color: blue; text-decoration: underline;" class="">Ugo@webster.edu</a></span></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
</div>
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">fieldtrip
 mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" style="color: blue; text-decoration: underline; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!9p3MXx66w3sJ3BpeyB3zOOJ2rnhS9e86qfEPRENa5HarQKXxuGy3nqi93XHlcbveDNpFgmz9c-fVLPj_lof-45ijO_TyA5rwvhLYSg$" style="color: blue; text-decoration: underline; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!9p3MXx66w3sJ3BpeyB3zOOJ2rnhS9e86qfEPRENa5HarQKXxuGy3nqi93XHlcbveDNpFgmz9c-fVLPj_lof-45ijO_TyA5rwvhLYSg$</a><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""></span></div>
</blockquote>
</div>
<br class="">
</body>
</html>