[FieldTrip] Is there an error in my anatomical pipeline?

Eelke Spaak eelke.spaak at donders.ru.nl
Thu Apr 4 14:18:59 CEST 2013

Dear FieldTrippers,

I am trying to do source reconstruction, but am encountering two weird
things in my pipeline related to anatomy. It could be that everything
is OK, but I am worried I might have introduced a left/right flip

To read in my (dicom) MRI, I use:

% read the mri
fprintf('loading mri for subject %d...\n', subjects(k).id);
mri = ft_read_mri(fetchDicomFilename(subjects(k).id));

and then I mark the fiducials as follows:

% align to fiducials in CTF coordsys
cfg = [];
cfg.coordsys = 'ctf';
cfg.method = 'interactive';
cfg.clim = [0 800];
mri = ft_volumerealign(cfg, mri);

In attachment ft_volumerealign.png I show the plot that comes up.
Although the position of the different slices is not what I usually
expect, this should all still be fine, right? The yellow crosshair is
in the right fiducial location, as evidenced by the white blob below
the ear (which is always on the right hand side during MRI

After marking r, l and n (and quitting with 'q') I do:

% reslice to make everything right-side up
mri = ft_volumereslice([], mri);

In attachment ft_sourceplot-1.png I show output of
ft_sourceplot([],mri) after this step. Note that the positions of the
axial/coronal/sagittal slices are not what one would typically expect.
Also note (and this is problem 1) that the right hand side of the
anatomy is displayed on the right hand side in the bottom (axial)
slice, but on the left hand side in the top right (coronal) slice.
Initially I thought this was just a benign visualisation issue
(analogous to http://fieldtrip.fcdonders.nl/faq/my_mri_is_upside_down_is_this_a_problem),
but it might be a real problem after all, because of what I found

After these steps, I proceed to do segmentation and I create a headmodel:

cfg = [];
cfg.coordsys = 'ctf';
mri = ft_volumesegment(cfg, mri);

% make single shell model
cfg = [];
cfg.method = 'singleshell';
headmodel = ft_prepare_headmodel(cfg, mri);

As outlined in the beamformingextended tutorial, I create a
subject-specific source model which I inverse-warp to MNI:

% load template sourcemodel (grid) in mni space
template = load('~/ft-src/template/sourcemodel/standard_sourcemodel3d8mm');

% warp the grid
cfg = [];
cfg.grid.warpmni = 'yes';
cfg.grid.template = template.sourcemodel;
cfg.grid.nonlinear = 'yes';
cfg.mri = mri;
sourcemodel = ft_prepare_sourcemodel(cfg);

(See attachment grid-hdm-grad.png for a plot of all three geometrical
objects superimposed. Looks fine to me.) Then I create a leadfield:

cfg = [];
cfg.grid = sourcemodel;
cfg.vol = headmodel;
cfg.channel = {'MEG'};
cfg.grad = data.grad;
leadfield  = ft_prepare_leadfield(cfg, data);

The next step, which is the one which alerted me to the potential
problem in the steps above, is to do an LCMV beamformer on a small
time window of my ERF:

% compute ERF covariance in small window
cfg = [];
cfg.covariance = 'yes';
cfg.covariancewindow = [1.5 1.55];
tl_right = ft_timelockanalysis(cfg, rightErf);

% do beamforming
cfg = [];
cfg.method = 'lcmv';
cfg.grid = leadfield;
cfg.vol = headmodel;
cfg.lcmv.lambda = '5%';
cfg.lcmv.projectnoise = 'yes';
cfg.lcmv.keepfilter = 'yes';

sourceRight = ft_sourceanalysis(cfg, tl_right);

% normalise with noise
sourceRightNAI = sourceRight;
sourceRightNAI.avg.pow = sourceRight.avg.pow ./ sourceRight.avg.noise;

% copy over pos and dim from template
sourceRight.pos = template.sourcemodel.pos;
sourceRight.dim = template.sourcemodel.dim;
sourceRightNAI.pos = template.sourcemodel.pos;
sourceRightNAI.dim = template.sourcemodel.dim;

% interpolate onto template brain
cfg              = [];
cfg.voxelcoord   = 'no';
cfg.parameter    = 'avg.pow';
cfg.interpmethod = 'nearest';
cfg.coordsys     = 'mni';
sourceRight_int= ft_sourceinterpolate(cfg, sourceRight, template_mri);
sourceRightNAI_int= ft_sourceinterpolate(cfg, sourceRightNAI, template_mri);

% plot
cfg              = [];
cfg.funparameter = 'avg.pow';
cfg.method       = 'ortho';
cfg.location     = 'max';
cfg.coordsys = 'mni';
ft_sourceplot(cfg, sourceRightNAI_int);

The output of the above step is shown in ft_sourceplot-2.png. Note
that there clearly is a maximum in the posterior right hemisphere. Now
compare this to when I just plot the sensor-level ERF for the same
time interval:

c2.xlim = [1.5 1.55];

(See attachment ft_topoplotER.png.) The sensor-level ERF looks to me
as if there should be a dipole in the left hemisphere. (That's problem

Now of course I know that interpreting axial gradient data by eye is
difficult, but this left-side increase is present in the majority of
my subjects, yet the resulting LCMV maximum always ends up in the
right hemisphere. Therefore my question: am I doing something wrong in
my anatomical pipeline, causing a left-right flip? An indication that
this might be the case is the weird display in ft_sourceplot after my
ft_volumereslice step. Or is it really possible that for many
subjects, a left-sided sensor topography ends up in the right
hemisphere after beamforming? (My intuitions on this are not very

Apologies for the lengthy e-mail. I thought it wise to provide all
possible details :) Hopefully someone can help me!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ft_sourceplot-1.png
Type: image/png
Size: 89562 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130404/4e68cf4a/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ft_volumerealign.png
Type: image/png
Size: 154439 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130404/4e68cf4a/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ft_sourceplot-2.png
Type: image/png
Size: 36589 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130404/4e68cf4a/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ft_topoplotER.png
Type: image/png
Size: 20860 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130404/4e68cf4a/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grid-hdm-grad.png
Type: image/png
Size: 49287 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20130404/4e68cf4a/attachment-0009.png>

More information about the fieldtrip mailing list