Problem while using prepare_leadfield with parameters cfg.resolution and cfg.inwardshift

Ingmar Schneider ingmar.schneider at BIO.UNI-GIESSEN.DE
Wed Feb 13 15:36:43 CET 2008

Hello everybody,

I am currently trying to analyze my MEG data with the DICS beamforming
technique. While preparing my leadfield grid via the prepare_leadfield.m
function I stumbled across a problem I don't understand. Every time I try to
decrease the inwardshift to suit the leadfield upon my anatomy data and at
the same time increase the resolution the resulting grid is even smaller,
than without specification.

For example applying the following parameters reduces the size of the
resulting grid instead of increasing its volume:
cfg.inwardshift = -1.5; %Increasing the grid size to cover the anatomy
cfg.resoltion = 0.5;    %[cm]

Without the cfg.resolution parameter a reduction of cfg.inwardshift results
in the desired bigger leadfield grid which eventually fits upon the MRI
data. Are these factors intertwined in the calculations so that one effects
the other in the course of calculation?

I hope someone can help me solve this little problem and am grateful for any
kind of hint.


The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also and

More information about the fieldtrip mailing list