<div dir="ltr">
<p class="MsoNormal"><span style="font-size:8pt">Dear FT experts,</span></p><p class="MsoNormal"><span style="font-size:8pt">I just recently started to use Fieldtrip for my MEG data source reconstruction. </span></p><p class="MsoNormal"><span style="font-size:8pt"><br></span></p>
<p class="MsoNormal"><span style="font-size:8pt">I would like to use an atlas with
my source reconstruction. I limited</span><span style="font-size:8pt"> template_grid.inside to the
atlas, as advised in the tutorial (<a href="http://www.fieldtriptoolbox.org/tutorial/salzburg">http://www.fieldtriptoolbox.org/tutorial/salzburg</a>)</span>
</p><p class="MsoNormal"><span style="font-size:8pt"> </span></p>
<p class="MsoNormal"><span style="font-size:8pt">%% Create template grid based
on the standard head model</span></p>
<p class="MsoNormal"><span style="font-size:8pt">load(strcat(fieldtripfolder, '/template/headmodel/standard_singleshell'));</span></p>
<p class="MsoNormal"><span style="font-size:8pt">step=0.7;</span></p>
<p class="MsoNormal"><span style="font-size:8pt">cfg = [];</span></p>
<p class="MsoNormal"><span style="font-size:8pt">cfg.grid.xgrid =
-20:step:20;</span></p>
<p class="MsoNormal"><span style="font-size:8pt">cfg.grid.ygrid =
-20:step:20;</span></p>
<p class="MsoNormal"><span style="font-size:8pt">cfg.grid.zgrid =
-20:step:20;</span></p>
<p class="MsoNormal"><span style="font-size:8pt">cfg.grid.unit = 'cm';</span></p>
<p class="MsoNormal"><span style="font-size:8pt">cfg.grid.tight = 'yes';</span></p>
<p class="MsoNormal"><span style="font-size:8pt">cfg.inwardshift = -1;</span></p>
<p class="MsoNormal"><span style="font-size:8pt">cfg.headmodel
= vol;</span></p>
<p class="MsoNormal"><span style="font-size:8pt">template_grid =
ft_prepare_sourcemodel(cfg);</span></p>
<p class="MsoNormal"><span style="font-size:8pt"> </span><span style="font-size:8pt"><br></span></p><p class="MsoNormal"><span style="font-size:8pt">%% Load atlas and create a
binary mask</span>
</p><p class="MsoNormal"><span style="font-size:8pt">atlas =
ft_read_atlas(strcat(fieldtripfolder, '/template/atlas/aal/ROI_MNI_V4.nii') );</span></p>
<p class="MsoNormal"><span style="font-size:8pt">atlas =
ft_convert_units(atlas,'cm');% assure that atlas and template_grid are
expressed in the %same units</span></p>
<p class="MsoNormal"><span style="font-size:8pt"> </span></p>
<p class="MsoNormal"><span style="font-size:8pt">cfg = []</span></p>
<p class="MsoNormal"><span style="font-size:8pt">cfg.atlas = atlas;</span></p>
<p class="MsoNormal"><span style="font-size:8pt">cfg.roi = atlas.tissuelabel; %
here you can also specify a single label, i.e. single ROI</span></p>
<p class="MsoNormal"><span style="font-size:8pt">cfg.inputcoord = 'mni';</span></p>
<p class="MsoNormal"><span style="font-size:8pt">mask =
ft_volumelookup(cfg,template_grid);</span></p>
<p class="MsoNormal"><span style="font-size:8pt"> </span></p>
<p class="MsoNormal"><span style="font-size:8pt">% create temporary mask
according to the atlas entries</span></p>
<p class="MsoNormal"><span style="font-size:8pt">tmp
= repmat(template_grid.inside,1,1);</span></p>
<p class="MsoNormal"><span style="font-size:8pt">tmp(tmp==1)
= 0;</span></p>
<p class="MsoNormal"><span style="font-size:8pt">tmp(mask)
= 1;</span></p>
<p class="MsoNormal"><span style="font-size:8pt">% define inside locations
according to the atlas based mask</span></p>
<p class="MsoNormal"><span style="font-size:8pt">template_grid.inside = tmp;</span></p>
<p class="MsoNormal"><span style="font-size:8pt">%%</span></p><p class="MsoNormal"><span style="font-size:8pt"> <br></span></p>
<p class="MsoNormal"><span style="font-size:8pt">Then I performed the source reconstruction using this template_grid and plotted the result (induced visual gamma
power) on the standard brain surface. </span></p>
<p class="MsoNormal"><span style="font-size:8pt"> </span></p>
<p class="MsoNormal"><span style="font-size:8pt">The resulting surface image
has ‘holes’ and it does not look correct to me.</span></p>
<p class="MsoNormal"><span style="font-size:8pt">When I do not limit the template_grid.inside
to the atlas it looks much better.</span></p>
<p class="MsoNormal"><span style="font-size:8pt">(figures are attached)</span></p>
<p class="MsoNormal"><span style="font-size:8pt"> </span></p>
<p class="MsoNormal"><span style="font-size:8pt">What am I doing wrong?</span></p>
<p class="MsoNormal"><span style="font-size:8pt"> </span></p>
<p class="MsoNormal"><span style="font-size:8pt">Best regards,</span></p>
<p class="MsoNormal"><span style="font-size:8pt">Elena</span></p>
<p class="MsoNormal"><span style="font-size:8pt"> </span></p>
<p class="MsoNormal"><span style="font-size:8pt"> </span></p>
<p class="MsoNormal"><span style="font-size:8pt"> </span></p>
<p class="MsoNormal"><span style="font-size:8pt"> </span></p>
<span style="font-size:9pt"> </span>
<p class="gmail-p5"> </p>
<p class="MsoNormal"><span style="font-size:9pt"> </span></p>
<br><font size="1"><span> </span></font><font size="1">
</font><p class="gmail-p2"><font size="1"><span> </span></font></p><font size="1">
</font><p class="gmail-p5"><font size="1"> </font></p><font size="1">
</font><p class="MsoNormal"><font size="1"><span> </span></font></p><font size="1">
</font><p class="gmail-p2"><font size="1"> </font></p><font size="1">
</font><p class="gmail-p5" style="text-align:left"><font size="1"> </font></p><font size="1">
</font><p class="MsoNormal"><font size="1"> </font></p>
<div class="gmail-Iyc gmail-d-k-l"> </div></div>