<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-2022-jp">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Dear Fieldtrip Community,</p>
<p><br>
</p>
<p>I implemented most of the changes you all suggested and some that you didn't, and I am still getting some odd results, but in a different way. At the end of my pipeline I am computing bivariate granger causality over all ROIs in the volumetric AAL atlas
 provided with fieldtrip. ft_sourceparcellate gives me errors when trying to use, so to project sources onto ROIs I interpolate the AAL atlas onto my sourcemodel using ft_sourceinterpolate. I then go through each ROI and create a binary mask of voxels, which
 I then use to average the moms together to get ROI source activity. Before this step I use the svd method to pick a principal component of each voxel. When I plot a heatmap of these results averaged over the beta band(12-30 Hz), most roi pairs have a granger
 value between 0.1-0.3, but there are certain rois that have a very high granger across a ton of regions(>1).  This happened with multiple datasets from different studies. I suspect that the issue(if these is one) in my pipeline is coming from how I am using
 the atlas to group together voxels into ROIs, but I am not sure. I have listed my process below with as much detail as possible, if you need any other information let me know:</p>
<p><br>
</p>
<p>Link to a matlab figure of granger results:<br>
</p>
<p><a href="https://drive.google.com/open?id=1CCaTsw8VO0829GJsggBiB0LMquVRx4Ao" class="OWAAutoLink" id="LPlnk32564" previewremoved="true">https://drive.google.com/open?id=1CCaTsw8VO0829GJsggBiB0LMquVRx4Ao</a></p>
<p><br>
</p>
<p><b><u>Step 1: Importing headmodel and EEG Data</u></b></p>
<p><br>
</p>
<p>My first step is loading in the default bem headmodel that comes shipped with fieldtrip, shown below:</p>
<p>                <br>
</p>
<p><b><i><span style="font-size: 9pt;">headmodel = </span></i><br>
</b></p>
<b></b>
<div><i><b><br>
<span style="font-size: 9pt;">  struct with fields:</span><br>
<br>
<span style="font-size: 9pt;">     bnd: [1$B!_(B3 struct]</span><br>
<span style="font-size: 9pt;">    cond: [0.3300 0.0041 0.3300]</span><br>
<span style="font-size: 9pt;">     mat: [3000$B!_(B3000 double]</span><br>
<span style="font-size: 9pt;">    type: 'dipoli'</span><br>
</b><span style="font-size: 9pt;"><b>    unit: 'mm'</b></span></i></div>
<br>
<p>I then import the EEG data(63 channels, 10-20 electrode layout) and convert the units to mm.
<br>
</p>
<p><br>
</p>
<div><i><span style="font-size: 9pt;">eegData = eeglab2fieldtrip(EEG,'preprocessing','none');</span><br>
</i><span style="font-size: 9pt;"></span><i><br>
<span style="font-size: 9pt;">eegData.elec  = ft_convert_units(header.elec, 'mm');</span></i></div>
<div><i><br>
</i></div>
<div>
<div><i><b><span style="font-size: 9pt;">eegData = </span><br>
<br>
<span style="font-size: 9pt;">  struct with fields:</span><br>
<br>
<span style="font-size: 9pt;">         elec: [1$B!_(B1 struct]</span><br>
<span style="font-size: 9pt;">      fsample: 1000</span><br>
<span style="font-size: 9pt;">        trial: {1$B!_(B113 cell}</span><br>
<span style="font-size: 9pt;">         time: {1$B!_(B113 cell}</span><br>
<span style="font-size: 9pt;">        label: {1$B!_(B63 cell}</span><br>
<span style="font-size: 9pt;">    trialinfo: [113$B!_(B7 table]</span><br>
</b><span style="font-size: 9pt;"><b>          cfg: [1$B!_(B1 struct]</b></span></i></div>
<br>
</div>
I then project the electrodes to the scalp using the code below. Plotting afterwards confirms the electrodes are properly aligned with the headmodel.</div>
<div style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<br>
</div>
<div style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<div><i><span style="font-size: 9pt;">if strcmp(headmodel.type, 'bemcp')</span><br>
<span style="font-size: 9pt;">    scalp_index = 3;</span><br>
<span style="font-size: 9pt;">elseif strcmp(headmodel.type, 'dipoli')</span><br>
<span style="font-size: 9pt;">    scalp_index = 1;</span><br>
<span style="font-size: 9pt;">end</span><br>
<br>
<span style="font-size: 9pt;">cfg = [];</span><br>
<span style="font-size: 9pt;">cfg.method = 'project'; % onto scalp surface</span><br>
<span style="font-size: 9pt;">cfg.headshape = headmodel.bnd(scalp_index); % scalp surface</span><br>
<br>
<span style="font-size: 9pt;">eegData.elec = ft_electroderealign(cfg, eegData.elec);</span></i></div>
<div><i><span style="font-size: 9pt;"><br>
</span></i></div>
<div><i><span style="font-size: 9pt;"><span style="font-size: 12pt;"></span><br>
</span></i></div>
<div><i><span style="font-size: 9pt;"><span style="font-size: 12pt;"></span></span></i><span style="font-size: 9pt;"><span style="font-size: 12pt;"><u><b><i></i></b></u></span></span><span style="font-size: 9pt;"><span style="font-size: 12pt;"></span></span><i><span style="font-size: 9pt;"><br>
</span></i></div>
<div><i><span style="font-size: 9pt;"></span></i><span style="font-size: 12pt;"><u><b>Step 2: Calculate the foward solution:</b></u></span></div>
<div><span style="font-size: 12pt;"><u><b><br>
</b></u></span></div>
<div><span style="font-size: 12pt;">In this step, I calculate the covariance for my data, and create the source model and calculate the leadfield.</span></div>
<div><span style="font-size: 12pt;"><br>
</span></div>
<div><span style="font-size: 12pt;">
<div><i><span style="font-size: 9pt;">cfg = [];</span><br>
<span style="font-size: 9pt;">cfg.covariance = 'yes';</span><br>
<span style="font-size: 9pt;">cfg.covariancewindow = [-inf 0]; </span><br>
<span style="font-size: 9pt;">cfg.keeptrials = 'yes';</span><br>
<span style="font-size: 9pt;">tlckEeg = ft_timelockanalysis(cfg, eegData);</span><br>
<br>
<span style="font-size: 9pt;">cfg             = [];</span><br>
<span style="font-size: 9pt;">cfg.headmodel   = headmodel; </span><br>
<span style="font-size: 9pt;">cfg.resolution  = 10;</span><br>
<span style="font-size: 9pt;">cfg.inwardshift = 5; </span><br>
<br>
<span style="font-size: 9pt;">sourcemodel = ft_prepare_sourcemodel(cfg);</span><br>
<br>
<span style="font-size: 9pt;">cfg = [];</span><br>
<span style="font-size: 9pt;">cfg.sourcemodel = sourcemodel;  </span><br>
<span style="font-size: 9pt;">cfg.headmodel   = headmodel;      </span><br>
<span style="font-size: 9pt;">cfg.elec        = tlckEeg.elec; </span><br>
<br>
<span style="font-size: 9pt;">leadfield = ft_prepare_leadfield(cfg);</span></i><br>
</div>
<div><br>
</div>
<div>
<div><i><b><span style="font-size: 9pt;">sourcemodel = </span><br>
<br>
<span style="font-size: 9pt;">  struct with fields:</span><br>
<br>
<span style="font-size: 9pt;">       dim: [13 18 14]</span><br>
<span style="font-size: 9pt;">       pos: [3276$B!_(B3 double]</span><br>
<span style="font-size: 9pt;">      unit: 'mm'</span><br>
<span style="font-size: 9pt;">    inside: [3276$B!_(B1 logical]</span><br>
<span style="font-size: 9pt;">       cfg: [1$B!_(B1 struct]</span></b></i></div>
<div><i><b><span style="font-size: 9pt;"><br>
</span></b></i></div>
<div><i><b><span style="font-size: 9pt;">
<div>leadfield = <br>
<br>
  struct with fields:<br>
<br>
                dim: [13 18 14]<br>
                pos: [3276$B!_(B3 double]<br>
               unit: 'mm'<br>
             inside: [3276$B!_(B1 logical]<br>
                cfg: [1$B!_(B1 struct]<br>
          leadfield: {1$B!_(B3276 cell}<br>
              label: {63$B!_(B1 cell}<br>
    leadfielddimord: '{pos}_chan_ori'</div>
</span></b></i><span style="font-size: 9pt;">
<div><br>
</div>
<div><span style="font-size: 12pt;"></span><br>
</div>
<br>
</span></div>
<br>
</div>
<u><b>Step 3: Calculate the inverse solution</b></u></span></div>
<div><span style="font-size: 12pt;"><u><b><br>
</b></u></span></div>
<div><span style="font-size: 12pt;"><u><b></b></u>In this step, I calculate the sources using eloretta twice, once with the keepfilter option enabled and once with rawtrial enabled(this second run is used to obtain the correct structure format, the moms calculated
 from rawtrial are replaced with filter calculated moms). I then take the filters from the first run and multiply them with the original dataset to get the trial by trial mom data, which I use to replace the trial moms that were obtained with the rawtrial option.
 Then, for each voxel, I concanate all trial moms and calculate the principal component using svd. Once I have these I recalculate the moms for each trial using only the principal component.
<br>
</span></div>
<div><span style="font-size: 12pt;"><br>
</span></div>
<div><span style="font-size: 12pt;">
<div><i><span style="font-size: 9pt;">cfg               = [];</span><br>
<span style="font-size: 9pt;">cfg.method        = 'eloreta';</span><br>
<span style="font-size: 9pt;">cfg.grid   = leadfield;</span><br>
<span style="font-size: 9pt;">cfg.headmodel     = headmodel;</span><br>
<span style="font-size: 9pt;">cfg.eloreta.lambda = 0.05;</span><br>
<span style="font-size: 9pt;">cfg.keepmom = 'yes';</span><br>
<span style="font-size: 9pt;">cfg.mne.keepmom = 'yes';</span><br>
<span style="font-size: 9pt;">cfg.eloreta.keepfilter = 'yes';</span><br>
<br>
<span style="font-size: 9pt;">sourceEEG          = ft_sourceanalysis(cfg,tlckEeg);</span></i></div>
<div><i><br>
</i></div>
<div><i>
<div><b><span style="font-size: 9pt;">sourceEEG = </span><br>
<br>
<span style="font-size: 9pt;">  struct with fields:</span><br>
<br>
<span style="font-size: 9pt;">      time: [1$B!_(B4000 double]</span><br>
<span style="font-size: 9pt;">       dim: [13 18 14]</span><br>
<span style="font-size: 9pt;">    inside: [3276$B!_(B1 logical]</span><br>
<span style="font-size: 9pt;">       pos: [3276$B!_(B3 double]</span><br>
<span style="font-size: 9pt;">    method: 'average'</span><br>
<span style="font-size: 9pt;">       avg: [1$B!_(B1 struct]</span><br>
<span style="font-size: 9pt;">       cfg: [1$B!_(B1 struct]</span></b></div>
<br>
</i></div>
<div><i><br>
<span style="font-size: 9pt;">cfg               = [];</span><br>
<span style="font-size: 9pt;">cfg.method        = 'eloreta';</span><br>
<span style="font-size: 9pt;">cfg.grid   = leadfield;</span><br>
<span style="font-size: 9pt;">cfg.headmodel     = headmodel;</span><br>
<span style="font-size: 9pt;">cfg.eloreta.lambda = 0.05;</span><br>
<span style="font-size: 9pt;">cfg.mne.projectnoise = 'yes';</span><br>
<span style="font-size: 9pt;">cfg.keepmom = 'yes';</span><br>
<span style="font-size: 9pt;">cfg.rawtrial = 'yes';</span><br>
<span style="font-size: 9pt;"><br>
</span></i></div>
<div><i><span style="font-size: 9pt;">trialSource          = ft_sourceanalysis(cfg,tlckEeg);</span></i></div>
<div><i><br>
</i></div>
<div><i>
<div><br>
<b><span style="font-size: 9pt;">trialSource = </span><br>
<br>
<span style="font-size: 9pt;">  struct with fields:</span><br>
<br>
<span style="font-size: 9pt;">      time: [1$B!_(B4000 double]</span><br>
<span style="font-size: 9pt;">       dim: [13 18 14]</span><br>
<span style="font-size: 9pt;">    inside: [3276$B!_(B1 logical]</span><br>
<span style="font-size: 9pt;">       pos: [3276$B!_(B3 double]</span><br>
<span style="font-size: 9pt;">    method: 'rawtrial'</span><br>
<span style="font-size: 9pt;">     trial: [1$B!_(B113 struct]</span><br>
<span style="font-size: 9pt;">        df: 113</span><br>
<span style="font-size: 9pt;">       cfg: [1$B!_(B1 struct]</span></b></div>
<br>
<br>
<span style="font-size: 9pt;">%%</span> <span style="font-size: 9pt;"><u>Calculating 3 dimensional trial moms</u></span><br>
<span style="font-size: 9pt;">for i = 1:length(sourceEEG.avg.filter)</span><br>
<span style="font-size: 9pt;">    for i2 = 1:length(eegData.trial)</span><br>
<span style="font-size: 9pt;">        </span><br>
<span style="font-size: 9pt;">        if isempty(sourceEEG.avg.filter{i})</span><br>
<span style="font-size: 9pt;">            </span><br>
<span style="font-size: 9pt;">            x = [];</span><br>
<span style="font-size: 9pt;">            </span><br>
<span style="font-size: 9pt;">        else</span><br>
<span style="font-size: 9pt;">            </span><br>
<span style="font-size: 9pt;">            </span><span style="font-size: 9pt;">x = sourceEEG.avg.filter{i} * eegData.trial{i2}(:,:);</span><br>
<span style="font-size: 9pt;">            </span><br>
<span style="font-size: 9pt;">        end</span><br>
<span style="font-size: 9pt;">        </span><br>
<span style="font-size: 9pt;">        trialSource.trial(i2).mom{i} = x;</span><br>
<span style="font-size: 9pt;">        </span><br>
<span style="font-size: 9pt;">    end</span><br>
<span style="font-size: 9pt;">    </span><br>
<span style="font-size: 9pt;">end</span><br>
<br>
<span style="font-size: 9pt;">%%</span> <span style="font-size: 9pt;"><u>Calculating the principal component for each voxel</u></span><br>
<span style="font-size: 9pt;">for i2 = 1:length(trialSource.trial(1).mom)</span><br>
<span style="font-size: 9pt;">    timeseries = [];</span><br>
<span style="font-size: 9pt;">    </span><br>
<span style="font-size: 9pt;">    for i = 1:length(trialSource.trial)</span><br>
<span style="font-size: 9pt;">        timeseries = cat(2,timeseries,trialSource.trial(i).mom{i2});</span><br>
<span style="font-size: 9pt;">    end</span><br>
<span style="font-size: 9pt;">    </span><br>
<span style="font-size: 9pt;">    [u{i2}, s{i2}, v{i2}] = svd(timeseries, 'econ');</span><br>
<span style="font-size: 9pt;">    </span><br>
</i></div>
<div><i><span style="font-size: 9pt;"></span><span style="font-size: 9pt;"></span><span style="font-size: 9pt;">end</span><br>
<span style="font-size: 9pt;"><br>
</span></i></div>
<div><i><span style="font-size: 9pt;">%%</span><span style="font-size: 9pt;"> <u>
Calculating 1dimensional trial moms</u></span><br>
<span style="font-size: 9pt;">for i = 1:length(sourceEEG.avg.filter)</span><br>
<span style="font-size: 9pt;">    for i2 = 1:length(eegData.trial)</span><br>
<span style="font-size: 9pt;">        </span><br>
<span style="font-size: 9pt;">        if isempty(sourceEEG.avg.filter{i})</span><br>
<span style="font-size: 9pt;">            </span><br>
<span style="font-size: 9pt;">            x = [];</span><br>
<span style="font-size: 9pt;">            </span><br>
<span style="font-size: 9pt;">        else</span><br>
<span style="font-size: 9pt;">            </span><br>
</i></div>
<div><i><span style="font-size: 9pt;">           </span><span style="font-size: 9pt;">x = u{i}(:,1)' *sourceEEG.avg.filter{i} * eegData.trial{i2}(:,:);</span><br>
<span style="font-size: 9pt;">            </span><br>
<span style="font-size: 9pt;">        end</span><br>
<span style="font-size: 9pt;">        </span><br>
<span style="font-size: 9pt;">        trialSource.trial(i2).mom{i} = x;</span><br>
<span style="font-size: 9pt;">        </span><br>
<span style="font-size: 9pt;">    end</span><br>
<span style="font-size: 9pt;">    </span><br>
<span style="font-size: 9pt;">end</span></i><br>
</div>
<div><br>
</div>
<div><span style="font-size: 12pt;"><u><b>Step 4: Create ROI masks from AAL atlas</b></u></span></div>
<div><span style="font-size: 12pt;"><u><br>
</u></span></div>
<div><span style="font-size: 12pt;">In this step I load in the default AAL atlas included with fieldtrip. I then interpolate this atlas onto my sourcemodel. At this point I have tried to use ft_sourceparcellate to divide up my source data into ROIs, but I receive
 an error. Both the atlas and my head/source models are volumetric, and because I am using the template headmodel both objects are in MNI space, so I'm not sure how else to troubleshoot this part. Because of this error, I am using the interpolated atlas to
 create binary masks and averaging all moms for voxels in each ROI. </span><br>
<br>
</div>
Code when I try to use ft_sourceparcellate:</span></div>
<div><span style="font-size: 12pt;"><br>
</span></div>
<div><span style="font-size: 12pt;">
<div><i><span style="font-size: 9pt;">atlas = ft_read_atlas(broddmanLoc);</span></i></div>
<div><br>
</div>
<div><span style="font-size: 12pt;">
<div><b><span style="font-size: 9pt;">atlas = </span><br>
<br>
<span style="font-size: 9pt;">  struct with fields:</span><br>
<br>
<span style="font-size: 9pt;">            dim: [91 109 91]</span><br>
<span style="font-size: 9pt;">            hdr: [1$B!_(B1 struct]</span><br>
<span style="font-size: 9pt;">      transform: [4$B!_(B4 double]</span><br>
<span style="font-size: 9pt;">           unit: 'mm'</span><br>
<span style="font-size: 9pt;">         tissue: [91$B!_(B109$B!_(B91 double]</span><br>
<span style="font-size: 9pt;">    tissuelabel: {1$B!_(B116 cell}</span><br>
<span style="font-size: 9pt;">       coordsys: 'mni'</span></b></div>
</span><br>
</div>
<div><i><span style="font-size: 9pt;">cfg = [];</span><br>
<span style="font-size: 9pt;">cfg.method        = 'nearest';</span><br>
<span style="font-size: 9pt;">cfg.parameter = 'tissue';</span><br>
<span style="font-size: 9pt;">atlas2 = ft_sourceinterpolate(cfg,atlas,sourcemodel);</span></i></div>
<div><i><span style="font-size: 9pt;"><br>
</span></i></div>
<div><i><span style="font-size: 9pt;">
<div><b>atlas2 = <br>
<br>
  struct with fields:<br>
<br>
          dim: [13 18 14]<br>
    transform: [4$B!_(B4 double]<br>
         unit: 'mm'<br>
       inside: [13$B!_(B18$B!_(B14 logical]<br>
       tissue: [13$B!_(B18$B!_(B14 double]<br>
          cfg: [1$B!_(B1 struct]</b></div>
<div><b><br>
</b></div>
</span></i><i><span style="font-size: 9pt;">
<div><b><span style="font-size: 12pt;">% Here I try to use the original atlas with ft_sourceparcellate and receive an error</span><br>
</b></div>
<div>cfg = [];<b><br>
</b></div>
<div><b>
<div><span style="font-weight: normal;">cfg.method       = 'eig';<br>
cfg.parcellation = 'tissue';</span></div>
<div><span style="font-weight: normal;">
<div>ft_sourceparcellate(cfg,trialSource,atlas)<br>
<div>Error using ft_sourceparcellate (line 109)<br>
the source positions are not consistent with the parcellation, please use FT_SOURCEINTERPOLATE</div>
</div>
<div><br>
</div>
<div>% <span style="font-size: 12pt;"><b>As you can see above, when I interpolate the atlas onto the source model, tissuelabel is missing in atlas2, so it is not recognized as a parcellation. When I add tissuelabel from atlas to atlas2, another error appears.</b></span></div>
<div><br>
<span style="font-size: 12pt;"><b></b></span></div>
<div>
<div>cfg = [];<br>
cfg.method       = 'eig';<br>
cfg.parcellation = 'tissue';<br>
ft_sourceparcellate(cfg,trialSource,atlas2)<br>
Error using ft_sourceparcellate (line 97)<br>
This function requires parcellation data as input, see ft_datatype_parcellation.</div>
<div><br>
</div>
<div>
<div>atlas2.tissuelabel = atlas.tissuelabel;</div>
<div>cfg = [];<br>
cfg.method       = 'eig';<br>
cfg.parcellation = 'tissue';<br>
ft_sourceparcellate(cfg,trialSource,atlas2)<br>
Error using ft_sourceparcellate (line 97)<br>
each index value should have a corresponding entry in "tissuelabel"</div>
<div><br>
</div>
<div><span style="font-size: 12pt;"><b>% Because of these errors, I instead create my own binary masks for each ROI, using methods from this tutorial:
<br>
</b></span></div>
<div><span style="font-size: 12pt;"><b><a href="http://www.fieldtriptoolbox.org/faq/how_can_i_map_source_locations_between_two_different_representations/" class="OWAAutoLink" id="LPlnk139138" previewremoved="true">http://www.fieldtriptoolbox.org/faq/how_can_i_map_source_locations_between_two_different_representations/</a></b></span></div>
<div><span style="font-size: 12pt;"><b><br>
</b></span></div>
<div><span style="font-size: 12pt;"><b><a href="http://www.fieldtriptoolbox.org/faq/how_can_i_map_source_locations_between_two_different_representations/" class="OWAAutoLink" id="LPlnk139138" previewremoved="true"></a></b></span> <span style="font-weight: normal;"></span><i><span style="font-size: 9pt;"></span></i><span style="font-size: 9pt;">atlas
 = ft_read_atlas(broddmanLoc);</span><br>
<i><span style="font-size: 9pt;"></span></i><span style="font-size: 12pt;">
<div><br>
<span style="font-size: 9pt;">cfg = [];</span><br>
<span style="font-size: 9pt;">cfg.method        = 'nearest';</span><br>
<span style="font-size: 9pt;">cfg.parameter = 'tissue';</span><br>
<span style="font-size: 9pt;">atlas2 = ft_sourceinterpolate(cfg,atlas,sourcemodel);</span><br>
<br>
<span style="font-size: 9pt;">roiData.time = eegData.time;</span><br>
<span style="font-size: 9pt;">roiData.label = atlas.tissuelabel';</span><br>
<span style="font-size: 9pt;">roiData.trial = {};</span><br>
<br>
<span style="font-size: 9pt;">missingLabels = [];</span><br>
<span style="font-size: 9pt;">for i = 1:length(atlas.tissuelabel)</span><br>
<span style="font-size: 9pt;">    </span><br>
<span style="font-size: 9pt;">    indx = find(atlas2.tissue==i);</span><br>
<span style="font-size: 9pt;">    if isempty(indx)</span><br>
<span style="font-size: 9pt;">        missingLabels = [missingLabels i];</span><br>
<span style="font-size: 9pt;">    end</span><br>
<span style="font-size: 9pt;">    </span><br>
<span style="font-size: 9pt;">    for i3 = 1:length(trialSource.trial)</span><br>
<span style="font-size: 9pt;">        timeseries = [];</span><br>
<span style="font-size: 9pt;">        </span><span style="font-size: 9pt;"></span><span style="font-size: 9pt;">for i2 = 1:length(indx)</span><br>
<span style="font-size: 9pt;">            try</span><br>
<span style="font-size: 9pt;">                timeseries = cat(1,timeseries,trialSource.trial(i).mom{indx(i2)});</span><br>
<span style="font-size: 9pt;">            end</span><br>
<span style="font-size: 9pt;">        end</span><br>
<span style="font-size: 9pt;">        </span><br>
<span style="font-size: 9pt;">        if ~isempty(timeseries)</span><br>
<span style="font-size: 9pt;">            for i4 = 1:size(timeseries,2)</span><br>
<span style="font-size: 9pt;">                </span><br>
<span style="font-size: 9pt;">                roiData.trial{i3}(i,i4) = mean(timeseries(:,i4));</span><br>
<span style="font-size: 9pt;">                </span><br>
<span style="font-size: 9pt;">            end</span><br>
<span style="font-size: 9pt;">        else</span><br>
<span style="font-size: 9pt;">            roiData.trial{i3}(i,:) = ones(1,length(roiData.time{1}))*10^-10;</span><br>
<span style="font-size: 9pt;">        end</span><br>
<span style="font-size: 9pt;">    end</span><br>
<span style="font-size: 9pt;">    </span><br>
<span style="font-size: 9pt;">end</span></div>
<b><span style="font-size: 9pt;"></span></b></span></div>
</div>
</div>
</span></div>
</b></div>
</span></i></div>
</span></div>
</div>
<span style="font-size: 9pt;"></span>
<div style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<span style="font-size: 9pt;"></span><br>
<p></p>
<p>Using this method, some ROIs from the atlas have zero indices found in the source model, which is confusing to me. I tried replace the source data for missing ROIs with a very small non-zero #(10^-10) so that the rest of the script runs. Looking at the indices
 now I realize that these are the indices with extrememly high granger values, so adding in small non-zero values is not a valid solution it seems. Is there any reason for these ROIs to not be showing up in my model? The missing indices are listed below. I
 assume that the issue is coming from the interpolation of the atlas.</p>
<p><br>
</p>
<p><span><i><span style="font-size: 9pt;">missingLabels = </span><span style="font-size: 9pt;">[21 70 79 80 95 101 107 108 109]</span></i></span></p>
<p><span><br>
</span></p>
<p><span><br>
</span></p>
<p><span></span><u><b>Step 5: Calculate Connectivity</b></u></p>
<p><u><b><br>
</b></u></p>
<p>In this step I calculate granger causality. I don't think anything is going wrong here, after having gone through all of my code for this email I realize that the missing ROIs are the most likely culprit.</p>
<p><br>
</p>
<p></p>
<div><i><span style="font-size: 9pt;">cfg            = [];</span><br>
<span style="font-size: 9pt;">cfg.output     = 'fourier';</span><br>
<span style="font-size: 9pt;">cfg.method     = 'mtmfft';</span><br>
<span style="font-size: 9pt;">cfg.foilim     = [0 50];</span><br>
<span style="font-size: 9pt;">cfg.tapsmofrq  = 4;</span><br>
<span style="font-size: 9pt;">cfg.keeptrials = 'yes';</span><br>
<span style="font-size: 9pt;">cfg.pad = 4;</span><br>
<span style="font-size: 9pt;">freq    = ft_freqanalysis(cfg, roiData);</span><br>
<br>
<span style="font-size: 9pt;">cfg = [];</span><br>
<span style="font-size: 9pt;">cfg.method = 'granger';</span><br>
<span style="font-size: 9pt;">cfg.granger.sfmethod = 'bivariate';</span><br>
<span style="font-size: 9pt;">granger = ft_connectivityanalysis(cfg, freq);</span></i></div>
<div><i><span style="font-size: 9pt;"><br>
</span></i></div>
<div><span style="font-size: 12pt;"><u><b>Conclusions</b></u></span></div>
<div><span style="font-size: 12pt;"><br>
</span></div>
<div><span style="font-size: 12pt;">After going through all of my code, I realize the main issue is that some of the atlas ROIs have no indices in my sourcemodel after interpolating. Is there any fix/advice that you can suggest to either fix this problem, or
 to make ft_sourceparcellate work so that I can avoid this issue altogether? I realize there is a lot of code and steps to go through here, and I appreciate any help that you can provide. This mailing list has been a great resource for me so far, and I hope
 I can return the favor to some fellow fieldtrippers soon!</span></div>
<div><span style="font-size: 12pt;"><br>
</span></div>
<div><span style="font-size: 12pt;">Best,</span></div>
<div><span style="font-size: 12pt;">Michael Glassen</span><br>
<br>
</div>
<br>
<p></p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> fieldtrip <fieldtrip-bounces@science.ru.nl> on behalf of Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen@donders.ru.nl><br>
<b>Sent:</b> Thursday, May 14, 2020 2:02:38 AM<br>
<b>To:</b> FieldTrip discussion list<br>
<b>Subject:</b> Re: [FieldTrip] Computing source-level ROI EEG connectivity</font>
<div> </div>
</div>
<div>Dear Michael,
<div class=""><br class="">
</div>
<div class="">The convention is left column to right column, so in this case RGAST to LGAST. the stuff between the $B!F(B[$B!F(B is to indicate that the pairwise metric has been obtained with a bivariate model that included LGAST and RGAST.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 14 May 2020, at 03:14, Michael Glassen - Biomedical Engineer <<a href="mailto:MGlassen@kesslerfoundation.org" class="">MGlassen@kesslerfoundation.org</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div id="divtagdefaultwrapper" dir="ltr" style="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; font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif;" class="">
<div style="margin-top: 0px; margin-bottom: 0px;" class="">Hi<span class="Apple-converted-space"> </span><font class="" size="4">Jan-Mathijs</font>,</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">I implemented all of your suggestions but I had a quick question on the organization of the bivariate granger connectivity structure. From what I can understand, this should compute connectivity from
 each channel to every other channel. This is my connectivity structure:</div>
<p style="margin-top: 0px; margin-bottom: 0px;" class=""></p>
<div class="">struct with fields:<br class="">
<br class="">
         labelcmb: {14762$B!_(B2 cell}<br class="">
           dimord: 'chancmb_freq'<br class="">
    grangerspctrm: [14762$B!_(B201 double]<br class="">
             freq: [1$B!_(B201 double]<br class="">
              cfg: [1$B!_(B1 struct]</div>
<p style="margin-top: 0px; margin-bottom: 0px;" class=""></p>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">And looking at an entry of labelcmb(14762,:) gives:</div>
<p style="margin-top: 0px; margin-bottom: 0px;" class=""></p>
<div class="">1$B!_(B2 cell array<br class="">
<br class="">
    {'RGAST[RGAST,LGAST]'}    {'LGAST[RGAST,LGAST]'}</div>
<div class=""><br class="">
</div>
<div class="">So does this mean that grangerspctrm(14762,:) is the granger connectivity from RGAST to LGAST, or is it from LGAST to RGAST?<span class="Apple-converted-space"> </span><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Best,</div>
<div class="">Michael Glassen<br class="">
</div>
<br class="">
<p style="margin-top: 0px; margin-bottom: 0px;" class=""></p>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
</div>
<hr 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; display: inline-block; width: 1093.671875px;" class="" tabindex="-1">
<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 id="divRplyFwdMsg" dir="ltr" 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="">
<font style="font-size: 11pt;" class="" face="Calibri, sans-serif"><b class="">From:</b><span class="Apple-converted-space"> </span>fieldtrip <<a href="mailto:fieldtrip-bounces@science.ru.nl" class="">fieldtrip-bounces@science.ru.nl</a>> on behalf of Schoffelen,
 J.M. (Jan Mathijs) <<a href="mailto:jan.schoffelen@donders.ru.nl" class="">jan.schoffelen@donders.ru.nl</a>><br class="">
<b class="">Sent:</b><span class="Apple-converted-space"> </span>Saturday, May 9, 2020 4:11:51 AM<br class="">
<b class="">To:</b><span class="Apple-converted-space"> </span>FieldTrip discussion list<br class="">
<b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [FieldTrip] Computing source-level ROI EEG connectivity</font>
<div class=""> </div>
</div>
<div 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="">
<font class="" size="4">Hi Wanze,</font>
<div class=""><font class="" size="4"><br class="">
</font></div>
<div class="">
<div class="">
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div dir="auto" class=""><font class="" size="4">I have two short questions regarding your suggestions to Michael: 1) any reason for why doing svd for concatenated trials would work better than doing svd per trial? </font></div>
</div>
</div>
</blockquote>
<div class=""><font class="" size="4"><br class="">
</font></div>
<div class=""><font class="" size="4">Well, it$B!G(Bs not that $B!F(Bit works better$B!G(B, but using a per trial svd will result in a different orientation estimate per trial, which then inherently assumes a source model that fixes the location of the dipole, but not its
 orientation.</font></div>
<font class="" size="4"><br class="">
</font>
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div class=""><font class="" size="4">2) If we do svd with concatenated trials do we need to re-segment the data into epochs/trials?  I think ft_freqanalysis and ft_connectivity would work way more efficiently if they are applied to data in epochs rather than
 one long trial, although I am not 100% assured. </font></div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">
<div class=""><font class="" size="4">Indeed, in most situations (particularly if the experimental protocol is epoch based) it is mandatory to maintain the epoch-structure in the spectral decomposition and connectivity estimation step. To this end the concatenation
 step is an intermediate one, used only to compute the principal orientation, and this orientation can then be applied to the data structure that still contains the epochs, either using a for-loop across the individual epochs, or exploiting the external/cellfunction
 code, by a direct multiplication.</font></div>
<div class=""><font class="" size="4"><br class="">
</font></div>
<div class=""><font class="" size="4">Best wishes,</font></div>
<div class=""><font class="" size="4">Jan-Mathijs</font></div>
<div class=""><font class="" size="4"><br class="">
</font></div>
<font class="" size="4"></font></div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div dir="ltr" class="">
<div class=""><font class="" size="4"><br class="">
</font></div>
<div class=""><font class="" size="4">Look forward to hearing from you. </font></div>
<div class=""><font class="" size="4"><br class="">
</font></div>
<div class=""><font class="" size="4">Best,</font></div>
<div class=""><font class="" size="4">Wanze</font></div>
<div dir="auto" class=""><br class="">
</div>
<div dir="auto" class=""><br class="">
</div>
<div class=""><br class="">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Schoffelen, J.M. (Jan Mathijs) <<a href="mailto:jan.schoffelen@donders.ru.nl" target="_blank" class="">jan.schoffelen@donders.ru.nl</a>>$BP2(B2020$BG/(B5$B7n(B8$BF|(B $B<~8^>e8a(B10:35$B<LF;!'(B<br class="">
</div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div class="" style="word-wrap: break-word; line-break: after-white-space;">Hi Michael,
<div class=""><br class="">
</div>
<div class="">The WFU atlas is a volumetrically defined atlas, correct? So, in order for the parcellation to work, the atlas needs to be mapped onto the cortically constrained sheet of dipoles that you used for source reconstruction.</div>
<div class="">This is not entirely trivial, but doable. If you obtained your atlas already as represented on a cortically constrained set of locations, then you need to ensure that these locations topologically map to the dipole locations of your source model. </div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
</div>
<div class="" style="word-wrap: break-word; line-break: after-white-space;">
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On 8 May 2020, at 16:15, Michael Glassen - Biomedical Engineer <<a href="mailto:MGlassen@kesslerfoundation.org" target="_blank" class="">MGlassen@kesslerfoundation.org</a>> wrote:</div>
<br class="">
<div class="">
<div class="" style="word-wrap: break-word; line-break: after-white-space;">Thank you everyone for the help!<br class="">
<br class="">
Just one final question, I got the Brodmann area atlas and the hemisphere atlas from this toolbox SPM $B!H(BWFU-PickAtlas$B!I(B.<br class="">
<br class="">
Does anyone know if there is a Brodmann area atlas that is known to work with fieldtrip?<br class="">
<br class="">
Best,<br class="">
Michael Glassen<span class="Apple-converted-space"> </span>
<hr class="" style="display: inline-block; width: 1060.203125px;">
<div id="m_-9057387112358115007m_-3568020509046707828divRplyFwdMsg" dir="ltr" class="">
<font class="" style="font-size: 11pt;" face="Calibri, sans-serif"><b class="">From:</b><span class="Apple-converted-space"> </span>fieldtrip <<a href="mailto:fieldtrip-bounces@science.ru.nl" target="_blank" class="">fieldtrip-bounces@science.ru.nl</a>> on
 behalf of Schoffelen, J.M. (Jan Mathijs) <<a href="mailto:jan.schoffelen@donders.ru.nl" target="_blank" class="">jan.schoffelen@donders.ru.nl</a>><br class="">
<b class="">Sent:</b><span class="Apple-converted-space"> </span>Friday, May 8, 2020 3:17:56 AM<br class="">
<b class="">To:</b><span class="Apple-converted-space"> </span>FieldTrip discussion list<br class="">
<b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [FieldTrip] Computing source-level ROI EEG connectivity</font>
<div class=""> </div>
</div>
<div class="">Hi Michael,
<div class=""><br class="">
</div>
<div class="">Adding to Wanze$B!G(Bs and Xavier$B!G(Bs replies:</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class="">
<div class="">
<blockquote type="cite" class="">
<div class="">
<div class="" style="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; text-decoration: none;">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">               I went through and plotted a couple different time series from the mom field from different trials and the same dipole, they are not equal and
 the shape looks ok to me, the magnitudes range from 10^-7 to 10^-4, is that normal? Source was calculated with everything in meters if that matters. Can you explain a little more the other method for calculating mom? The only option I have to add is keepfilter
 to sourceanalysis? And then I multiply each of these filters against the trial data matrix and it will leave me with what rawtrial is giving me but more reliably? Can I then still use the parcellate option on the output here? Or is this not necessary as rawtrial
 seems to be working?</span></div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">If $B!F(Brawtrial$B!G(B works, than this would be fine. I was a bit worried (and I$B!G(Bd need to look in the code myself in some more detail) because historically the $B!F(Brawtrial$B!G(B-functionality was implemented for the beamformer algorithms, and not for the MNE.
 As such, it has never been tested thoroughly for MNE, so although it seems to produce an output for you, I am not 100% sure that it$B!G(Bs correct. Also, anecdotally, the $B!F(Brawtrial$B!G(B/$B!G(Bsingletrial$B!G(B functionality for the beamformers is shaky in itself, and we still
 have it on our to-do-list to make the code more internally consistent and correct. </div>
<div class=""><br class="">
</div>
<br class="">
<blockquote type="cite" class="">
<div class="" style="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; text-decoration: none;">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;">-In order to get a $B!F(Bparcellated$B!G(B representation of your source level data, I recommend to use ft_sourceparcellate, which should achieve the parcellation you performed by hand (with the binary masks).<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;">              <span class=""> </span></span></i><i class=""><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">              <span class=""> </span></span></i><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 78, 121);">I tried using the ft_sourceparcellate
 function but I was running into a memory issue when ran on the rawtrial source, and when I remove that option and run it on the default trial-averaged sources I get a different error, which is pasted below. mri2 is the broddman area atlas interpolated onto
 my source model. Also, is there any way to parcellate twice with the function like I am doing by hand? The broddman area atlas I have is not divided into left and right hemispheres so I have another atlas I am using that is divided into hemispheres.</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 10pt;"><u class=""></u> <u class=""></u></span></div>
<div class="" style="margin: 0in 0in 0.0001pt 0.5in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">mri2 =<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;"><u class=""></u> <u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;">                                             struct with fields:<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;"><u class=""></u> <u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;">                                             pos: [8196$B!_(B3 double]<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;">                                              tri: [16384$B!_(B3 double]<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;">                                             unit: 'm'<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;">                                              tissue: [8196$B!_(B1 double]<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;">                                             tissuelabel: {1$B!_(B70 cell}<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;">                                             cfg: [1$B!_(B1 struct]<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;"><u class=""></u> <u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;">                              cfg =<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;"><u class=""></u> <u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;">                                             struct with fields:<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;"><u class=""></u> <u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;">                                              method: 'mean'<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;">                                             parcellation: 'tissue'<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;">                                               parameter: 'mom'<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;"><u class=""></u> <u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">ft_sourceparcellate(cfg,sourceEEG,mri2)<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Dentate" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Hypothalamus" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Substania Nigra" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Caudate Tail" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Putamen" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Medial Geniculum Body" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Lateral Globus Pallidus" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Subthalamic Nucleus" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Medial Globus Pallidus" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Lateral Geniculum Body" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Anterior Commissure" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Ventral Posterior Lateral Nucleus" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Ventral Posterior Medial Nucleus" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Ventral Lateral Nucleus" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Ventral Anterior Nucleus" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Caudate Body" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Lateral Posterior Nucleus" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1.5in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Lateral Dorsal Nucleus" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 0.5in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there is no "Midline Nucleus" in "tissue"<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">there are in total 8196 positions, 8190 positions are inside the brain, 2611 positions have a label<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">2609 of the positions inside the brain have a label<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">2609 of the labeled positions are inside the brain<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">5581 of the positions inside the brain do not have a label<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">creating 70 parcels for parameter mom by taking the mean<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">computing parcellation<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">Index exceeds the number of array elements (0).<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;"><u class=""></u> <u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">Error in ft_sourceparcellate>cellmean1 (line 488)<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">y = x{1};<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;"><u class=""></u> <u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt 1in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<i class=""><span class="" style="font-size: 10pt;">Error in ft_sourceparcellate (line 226)<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;">                                             tmp(j,:,:) = cellmean1(dat(seg==j));<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<u class=""></u> <u class=""></u></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 78, 121);">               -If I cannot get source parcellate to work, does my method of creating a mask and pulling out the source powers seem sound? I see that I should
 use mom instead of pow, so would I then just take all the voxels in an ROI and average the x direction together, the y direction together and the z together? Then find the direction with the largest power and use that as my 1by x time series power(using svd
 as described in documentation)? This is what I$B!G(Bm assuming sourceparcellate does if I select $B!F(Beig$B!G(B as the method.</span></div>
</div>
</blockquote>
<div class=""><br class="">
</div>
-With regard to thte parcellation: understood if memory limitations prevent you from using it. Yet, the error message you get when using the trial-averaged data suggests an issue with your atlas. Where did you get it from? It looks as if only 2611 out of the
 8196 cortical locations have a label. Is that according to your expectations? </div>
<div class="">-If indeed you are to manually parcellate (with the mask), you can do one of the following:</div>
<div class="">  * average x/y/z across dipole locations, followed by an svd (I$B!G(Bd recommend to do this svd on the trial-concatenated data, rather than on a per-trial basis)</div>
<div class="">  * (to mimick the $B!F(Beig$B!G(B method): concatenate the time series across dipole locations (and trials), followed by a single svd on the whole matrix.<br class="">
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<br class="">
<blockquote type="cite" class="">
<div class="" style="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; text-decoration: none;">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<i class=""><span class="" style="font-size: 10pt;">ALSO IMPORTANT: if you go for a granger-like measure (granger/dtf/pdc), in the spectral analysis you should probably use a decent amount of zero padding (cfg.pad) and sufficient tapsmofrq in order to get spectral
 data that stands a chance to get a stable factorization.<u class=""></u><u class=""></u></span></i></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"><u class=""></u> <u class=""></u></span></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);"><u class=""></u> <u class=""></u></span></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);">               -Finally, if I choose to go for granger, what kind of cfg.pad and tapsmofrq would you recommend? I am mostly interested in the beta band(12-30Hz)
 and my trial lengths are 357 samples(1.3 seconds)</span></div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">Irrespective of using granger or the disrecommended dtf/pdc, all techniques that require a spectral factorization need padding and smoothing. In your case I$B!G(Bd recommend a padding of 4 (cfg.pad = 4), and a cfg.tapsmofrq somewhere in the range of
 3 and 6 (but the latter is a bit of $B!F(Bwet finger work$B!G(B, as we sould say in Dutch -> google for $B!G(Bnatte vingerwerk$B!G(B if you want to learn more).</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<br class="">
<blockquote type="cite" class="">
<div class="" style="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; text-decoration: none;">
<div class="">
<div class="" style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0in 0in;">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><b class="">Subject:</b><span class=""> </span>Re: [FieldTrip] Computing source-level ROI EEG connectivity<u class=""></u><u class=""></u></span></div>
</div>
</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<u class=""></u> <u class=""></u></div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 13.5pt;">Dear Michael, </span><u class=""></u><u class=""></u></div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<u class=""></u> <u class=""></u></div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 13.5pt;">It looks that you already got quite far! I agree that the DTF values do not make much sense.</span><u class=""></u><u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<u class=""></u> <u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 13.5pt;">a few pointers:</span><u class=""></u><u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<u class=""></u> <u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 13.5pt;">-I would use some regularisation for  the MNE reconstruction.</span><u class=""></u><u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 13.5pt;">-I would check whether the individual trials after source reconstruction yield meaningful values in the $B!F(Bmom$B!G(B-field. Particularly, are the different trials different? Do the time series look meaningful to begin with
 (both in terms of signal magnitude and $B!G(Bshape$B!G(B)? The reason I ask, is that I am not fully sure whether the $B!F(Brawtrial$B!G(B option is behaving according to your expectations.</span><u class=""></u><u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 13.5pt;">-Another way for getting the mom would be to use cfg.keepfilter in ft_sourceanalysis, and left-multiply each dipole location$B!G(Bs $B!G(Bspatial filter$B!G(B (in sourceEEG.avg.filter) with a dataEEG.trial matrix.</span><u class=""></u><u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 13.5pt;">-IMPORTANT: don$B!G(Bt use the $B!F(Bpow$B!G(B for the subsequent spectral analysis and connectivity estimation. You should work with the mom.</span><u class=""></u><u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 13.5pt;">-In order to get a $B!F(Bparcellated$B!G(B representation of your source level data, I recommend to use ft_sourceparcellate, which should achieve the parcellation you performed by hand (with the binary masks).</span><u class=""></u><u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 13.5pt;">-The parcellation operation can be an average of the mom across the dipoles that belong to a parcel, but an alternative might be the the 1st principal component. The advantage of the latter would be that the per-parcel
 signal will be reduced to a single time series (rather then 3 x/y/z orientation time courses), which is convenient (and required) for the interpretation of the subsequent computations.</span><u class=""></u><u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 13.5pt;">-You may want to think a bit about the depth weighting, since the MNE favors superficial locations in terms of amplitude, and this will also percolate to the way the parcellated time series are computed.</span><u class=""></u><u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 13.5pt;">-IMPORTANT: using $B!F(Bdtf$B!G(B without any additional specification of parameters is probably not what you want here. The reason is that under the hood a multivariate factorization of the spectral matrix is performed (at least:
 an attempt is made), which will miserably fail in your case. The reason for this failure (thinking a bit more about this, I am quite surprised that it worked to begin with) is the fact that you ask for a factorization of a size NparcelxNparcel(xfrequency bins)
 matrix, where the effective rank of the matrix is less than the number of channels in your EEG array. Even if Nparcel is less than the number of EEG electrodes, this factorization will be very poorly estimated and nonsensical. I$B!G(Bd recommend using $B!F(Bgranger$B!G(B
 as a method, in combination with cfg.granger.sfmethod = $B!F(Bbivariate$B!G(B. This results in a parcel-pairwise factorization (which is hopefully stable most of the time). I am not a fan of dtf/pdc anyway given that the measures are claimed to provide estimates unproblematic
 estimates that are interpretable without any caveats.</span><u class=""></u><u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 13.5pt;">-ALSO IMPORTANT: if you go for a granger-like measure (granger/dtf/pdc), in the spectral analysis you should probably use a decent amount of zero padding (cfg.pad) and sufficient tapsmofrq in order to get spectral data
 that stands a chance to get a stable factorization.</span><u class=""></u><u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<u class=""></u> <u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 13.5pt;">So, no definitive answers unfortunately, but perhaps some food for thought that might get you closer to a good result.</span><u class=""></u><u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<u class=""></u> <u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 13.5pt;">Good luck and keep up the good work,</span><u class=""></u><u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<u class=""></u> <u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 13.5pt;">Jan-Mathijs</span><u class=""></u><u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<u class=""></u> <u class=""></u></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<u class=""></u> <u class=""></u></div>
</div>
<div class="">
<p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<u class=""></u> <u class=""></u></p>
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 13.5pt;">J.M.Schoffelen, MD PhD<br class="">
Associate PI, VIDI-fellow - PI, language in interaction<br class="">
Telephone: +31-24-3614793</span><span class=""><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 13.5pt;">Physical location: room 00.028</span><span class=""><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 13.5pt;">Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands<br class="">
<br class="">
</span><span class=""><u class=""></u><u class=""></u></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
 <u class=""></u><u class=""></u></div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<br class="">
<br class="">
<u class=""></u><u class=""></u></div>
<blockquote class="" style="margin-top: 5pt; margin-bottom: 5pt;">
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
On 6 May 2020, at 22:34, Michael Glassen - Biomedical Engineer <<a href="mailto:MGlassen@kesslerfoundation.org" target="_blank" class="" style="color: purple; text-decoration: underline;">MGlassen@kesslerfoundation.org</a>> wrote:<u class=""></u><u class=""></u></div>
</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<u class=""></u> <u class=""></u></div>
<div class="">
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">Hi all,<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"> <u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">I am having issues using fieldtrip for source reconstruction and connectivity analysis with preprocessed EEG data. I believe the issue is occurring when I try to project my sources to
 specific ROIs before getting the connectivity. I have outlined my pipeline below:<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"> <u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">-Because I do not have subject MRIs, I am using a template headmodel and sourcemodel that come included with fieldtrip<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">               - headmodel = standard_bem.mat<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">               -sourcemodel = cortex_8196.surf.gii<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"> <u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">-After importing EEG data, I project the EEG electrodes to the scalp using the code below:<u class=""></u><u class=""></u></span></p>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">              <span class=""> </span></span><span class="" style="font-size: 9pt; font-family: "Courier New"; color: blue;">if</span><span class=""><span class="" style="font-size: 9pt; font-family: "Courier New";"> </span></span><span class="" style="font-size: 9pt; font-family: "Courier New";">strcmp(headmodel.type,<span class=""> </span><span class="" style="color: rgb(160, 32, 240);">'bemcp'</span>)</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">             scalp_index = 3;</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New"; color: blue;">elseif</span><span class=""><span class="" style="font-size: 9pt; font-family: "Courier New";"> </span></span><span class="" style="font-size: 9pt; font-family: "Courier New";">strcmp(headmodel.type,<span class=""> </span><span class="" style="color: rgb(160, 32, 240);">'dipoli'</span>)</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">             scalp_index = 1;</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New"; color: blue;">end</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg = [];</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.method =<span class=""> </span><span class="" style="color: rgb(160, 32, 240);">'project'</span>;</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.headshape = headmodel.bnd(scalp_index);</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 9pt; font-family: "Courier New"; color: forestgreen;"> </span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">eegData.elec = ft_electroderealign(cfg, eegData.elec);</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";"> </span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";"> </span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">-I then calculate covariance on a trial basis and calculate the leadfield matrix:<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"> <u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">              <span class=""> </span></span><span class="" style="font-size: 9pt; font-family: "Courier New";">cfg = [];</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.covariance =<span class=""> </span><span class="" style="color: rgb(160, 32, 240);">'yes'</span>;</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.covariancewindow = [-inf 0];</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.keeptrials =<span class=""> </span><span class="" style="color: rgb(160, 32, 240);">'yes'</span>;</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">tlckEeg = ft_timelockanalysis(cfg, eegData);</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg         = [];</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.elec    = tlckEeg.elec;  <span class=""> </span><span class="" style="color: forestgreen;">% sensor information</span></span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.channel = tlckEeg.label; <span class=""> </span><span class="" style="color: forestgreen;">% the used channels</span></span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.grid    = sourcemodel;  <span class=""> </span><span class="" style="color: forestgreen;">% source points</span></span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.headmodel = headmodel;  <span class=""> </span><span class="" style="color: forestgreen;">% volume conduction model</span></span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.singleshell.batchsize = 5000;<span class=""> </span><span class="" style="color: forestgreen;">% speeds up the computation</span></span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">leadfield   = ft_prepare_leadfield(cfg);</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"> <u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">              <span class=""> </span><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">-Now with the leadfield calculated, I calculate sources on a trial basis here:<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"> <u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg               = [];</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.method        =<span class=""> </span><span class="" style="color: rgb(160, 32, 240);">'mne'</span>;</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.sourcemodel   = leadfield;</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.headmodel     = headmodel;</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.mne.prewhiten =<span class=""> </span><span class="" style="color: rgb(160, 32, 240);">'yes'</span>;</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.mne.lambda    = 0;</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.mne.scalesourcecov =<span class=""> </span><span class="" style="color: rgb(160, 32, 240);">'yes'</span>;</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.rawtrial      =<span class=""> </span><span class="" style="color: rgb(160, 32, 240);">'yes'</span>;</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">sourceEEG          = ft_sourceanalysis(cfg,tlckEeg);</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">               sourceEEG =<span class=""> </span><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"> <u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">                              struct with fields:<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"> <u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">                              time: [1$B!_(B357 double]<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">                              inside: [8196$B!_(B1 logical]<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">                              pos: [8196$B!_(B3 double]<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">                               tri: [16384$B!_(B3 double]<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">                              method: 'rawtrial'<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">                              trial: [1$B!_(B400 struct]<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">                              df: 400<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">                              cfg: [1$B!_(B1 struct]<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"> <u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"> <u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">               sourceEEG.trial =<span class=""> </span><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"> <u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">                              1$B!_(B400 struct array with fields:<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"> <u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">                              mom<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">                               pow<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">                              noisecov<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">              <span class=""> </span><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">size(sourceEEG.trial(1).pow)<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"> <u class=""></u><u class=""></u></span></div>
</div>
<div class="" style="margin-left: 0.5in;">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">ans =<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"> <u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">                                             8196         357<u class=""></u><u class=""></u></span></div>
</div>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"> <u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">-So at this point I have 400 trials, and for each of these trials I have a time course of source power at 8196 voxels and 357 time points for each of those voxels.<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">-I then import two atlases, one that includes broddman areas and one that includes left and right hemispheres. I interpolate these atlases onto my source model and get the following:<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">              <span class=""> </span></span><span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;">broddman =</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt 0.5in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;">struct with fields:</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;"> </span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;">                                      pos: [8196$B!_(B3 double]</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;">                                       tri: [16384$B!_(B3 double]</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;">                                        unit: 'm'</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;">                                       tissue: [8196$B!_(B1 double] (<b class="">each of these is a value 1-70, corresponding to which atlas entry the voxel is located in)</b></span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;">                                       tissuelabel: {1$B!_(B70 cell}<b class="">(ROI labels for the atlas, includes broddman areas not separated by hemisphere)</b></span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;">                                      cfg: [1$B!_(B1 struct]</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;">hemis2 =</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt 0.5in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;">struct with fields:</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt 0.5in; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;">pos: [8196$B!_(B3 double]</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;">                                      tri: [16384$B!_(B3 double]</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;">                                        unit: 'm'</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;">                                        tissue: [8196$B!_(B1 double] (<b class="">each of these is a value 1-7, corresponding to which atlas entry the voxel is located in)</b></span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;"> </span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;">                                         tissuelabel: {1$B!_(B7 cell}<span class=""> </span><b class="">(ROI Labels for hemisphere atlas, contains 3 Left areas, 3 Right Areas and one
 inter-hemispheric)</b></span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;">                                      cfg: [1$B!_(B1 struct]</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;"> </span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: "Calibri Light", sans-serif;"> </span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">Now I create a binary mask for each left and right broddman area. For each ROI in the broddman area atlas(1-70), I find all voxels that are located within. This gives me a list of voxels
 for each broddman area. I then take each of these lists and find which are in the left hemisphere and which are in the right to get left and right broddman areas.<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">After these steps I am left with 140 binary masks, (size 1x8196), which equal 1 if the voxel is contained in the specific ROI and 0 if it is not. Using these masks, I extract the time
 course power for each ROI by taking the mean power of every voxel in the roi at each time point:<u class=""></u><u class=""></u></span></p>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 9pt; font-family: Calibri, sans-serif;">                   <span class=""> </span></span><span class="" style="font-size: 9pt; font-family: "Courier New";">roiData(i,i3,i2) = mean(sourceEEG.trial(i2).pow(Masks{i},i3));</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 9pt; font-family: "Courier New";"> </span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">where i = roi number,</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 9pt; font-family: "Courier New";"> </span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">       i2 = trial number,</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">      <span class=""> </span></span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">       i3 = time point</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 9pt; font-family: "Courier New";"> </span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">In order to get this data into fieldtrip format, I put ROI data into an EEGLAB structure along with 6 emg channels that were recorded at the same time and use eeglab2fieldtrip function
 to have a fieldtrip structure containing the broddman area sources as channels. (contained in<span class=""> </span><i class="">header</i>)<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"> <u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">After this I perform the final step of computing dtf connectivity between each of the source rois and the emg channels with the code below:<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">              <span class=""> </span><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg           = [];</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.method    =<span class=""> </span><span class="" style="color: rgb(160, 32, 240);">'mtmfft'</span>;</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.taper     =<span class=""> </span><span class="" style="color: rgb(160, 32, 240);">'dpss'</span>;</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.output    =<span class=""> </span><span class="" style="color: rgb(160, 32, 240);">'fourier'</span>;</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.tapsmofrq = 2;</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">freq          = ft_freqanalysis(cfg, header);</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg           = [];</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">cfg.method    =<span class=""> </span><span class="" style="color: rgb(160, 32, 240);">'dtf'</span>;</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";">dtf           = ft_connectivityanalysis(cfg, freq);</span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";"> </span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif; text-indent: 0.5in;">
<span class="" style="font-size: 9pt; font-family: "Courier New";"> </span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">The values I get in DTF are extremely low, 10^-20. I am not sure why but I believe it has to do with the way I am projecting source activations onto specific ROIs. Any help or advice
 on how to change my pipeline is appreciated.<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"> <u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 9pt; font-family: Calibri, sans-serif;"> </span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">Best,<u class=""></u><u class=""></u></span></div>
</div>
<div class="">
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;">Michael Glassen<u class=""></u><u class=""></u></span></div>
</div>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 9pt; font-family: Calibri, sans-serif;"> </span><span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"><u class=""></u><u class=""></u></span></p>
<p class="MsoNormal" style="margin: 0in 0in 8pt; font-size: 12pt; font-family: "Times New Roman", serif; line-height: 11.65pt;">
<span class="" style="font-size: 11pt; font-family: Calibri, sans-serif;"> <u class=""></u><u class=""></u></span></p>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<span class="" style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"><br class="">
  ­­   _______________________________________________<br class="">
fieldtrip mailing list<br class="">
</span><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank" class="" style="color: purple; text-decoration: underline;"><span class="" style="font-size: 10.5pt; font-family: Helvetica, sans-serif; color: rgb(149, 79, 114);">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</span></a><span class="" style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"><br class="">
</span><a href="https://doi.org/10.1371/journal.pcbi.1002202" target="_blank" class="" style="color: purple; text-decoration: underline;"><span class="" style="font-size: 10.5pt; font-family: Helvetica, sans-serif; color: rgb(149, 79, 114);">https://doi.org/10.1371/journal.pcbi.1002202</span></a><u class=""></u><u class=""></u></div>
</div>
</blockquote>
</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<u class=""></u> <u class=""></u></div>
</div>
<div class="" style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: "Times New Roman", serif;">
<u class=""></u> <u class=""></u></div>
</div>
</div>
<br class="" style="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; text-decoration: none;">
<span class="" style="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; text-decoration: none; float: none; display: inline !important;">  ­­  <span class=""> </span></span><span class="" style="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; text-decoration: none; float: none; display: inline !important;">_______________________________________________</span><br class="" style="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; text-decoration: none;">
<span class="" style="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; text-decoration: none; float: none; display: inline !important;">fieldtrip
 mailing list</span><br class="" style="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; text-decoration: none;">
<span class="" style="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; text-decoration: none; float: none; display: inline !important;"><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></span><br class="" style="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; text-decoration: none;">
<span class="" style="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; text-decoration: none; float: none; display: inline !important;"><a href="https://doi.org/10.1371/journal.pcbi.1002202" target="_blank" class="">https://doi.org/10.1371/journal.pcbi.1002202</a></span></blockquote>
</div>
<br class="">
</div>
</div>
</div>
<br class="">
  ­­  </div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" target="_blank" class="">https://doi.org/10.1371/journal.pcbi.1002202</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank" class="">https://doi.org/10.1371/journal.pcbi.1002202</a><br class="">
</blockquote>
</div>
</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
<a href="https://doi.org/10.1371/journal.pcbi.1002202" class="">https://doi.org/10.1371/journal.pcbi.1002202</a><br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
<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="">  ­­  <span class="Apple-converted-space"> </span></span><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="">
<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=""><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></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=""><a href="https://doi.org/10.1371/journal.pcbi.1002202" class="">https://doi.org/10.1371/journal.pcbi.1002202</a></span></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</body>
</html>