[FieldTrip] Why inward shift in ft_prepare_sourcemodel?

Maris Skujevskis icelandhouse at gmail.com
Tue Sep 15 16:46:47 CEST 2015


Dear Fieldtrip community,

In ft_prepare_sourcemodel there is an option the meaning of which is not
clear to me.

>From ft_prepare_sourcemodel reference documentation:
%cfg.inwardshift  = number, how much should the innermost surface be moved
inward to constrain
%                      sources to be considered inside the source
compartment (default = 0)

In a fieldtrip tutorial this value is set to cfg.inwardshift = -1.5, but it
does not expain why..
http://www.fieldtriptoolbox.org/example/create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space

Can someone explain what the practical purpose of this option is, i.e.,
what problem does it address? Naively speaking, I would not have this
option at all and always have the value at zero - why should the surface be
shifted at all? Inside is inside, and outside is outside, right? Clearly I
am missing something here...

Thanks in advance,
Maris




On Tue, Sep 15, 2015 at 12:00 PM, <fieldtrip-request at science.ru.nl> wrote:

> Send fieldtrip mailing list submissions to
>         fieldtrip at science.ru.nl
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> or, via email, send a message with subject or body 'help' to
>         fieldtrip-request at science.ru.nl
>
> You can reach the person managing the list at
>         fieldtrip-owner at science.ru.nl
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of fieldtrip digest..."
>
>
> Today's Topics:
>
>    1. Re: Problem with ft_megrealign (Daria Laptinskaya)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 15 Sep 2015 11:36:15 +0200
> From: Daria Laptinskaya <daria.laptinskaya at googlemail.com>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] Problem with ft_megrealign
> Message-ID:
>         <
> CADcxnnNDRP_DYQGq+uEeqKJVvVd+AEzXNszbPwc1LWC13wqJjw at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear J?rn,
>
>
> thank you very much for your helpful answer! I did not want to answer
> before running the function. First I got an error message with the notice
> that separate structures of the cfg.template could not be translated into a
> variable of the type double (template variable).  Hence I defined the
> template variable as a cell-array:
>
> Ntemplate = length(cfg.template);
>
> template = cell(Ntemplate, 1);
>
>
>
> and at the end did this:
>
> j = 1;
>
>
>
> for i=1:length(template)
>
>
>
>     eval(['tp', num2str(j), ' = template{1};'])
>
>
>
>     j = j+1;
>
> end
>
>
>
> template_new = ([tp1, tp2]);
>
>
>
> grad = ft_average_sens(template_new);
>
>
>
> Now it works fine, then I leave out the cfg.headshape = ?hs_file?.  Using
> this command is leading to the following error message: Reference to
> non-existent field 'xgrid'. I understand the message, but could not fix the
> problem till now. I could swear, it worked some time ago :).
>
> I?m sorry to bother you with this, but I would appreciate, if you or
> someone else could give me a further tip, how to solve the problem.
>
> Many thank in advance!
>
>
> Best,
>
> Daria
>
> 2015-09-10 10:52 GMT+02:00 J?rn M. Horschig <jorn at artinis.com>:
>
> > Dear Daria,
> >
> >
> >
> > try initializing tp_avg just before the for-loop, e.g. by set tp_avg = []
> >
> >
> >
> > The error message you got means that you have a function called template
> > somewhere in your path. In the command line, you can type
> >
> > >> which template
> >
> > to find out where function is located. Afaik it?s not a FieldTrip
> > function.  Anyway, to fix this, the template variable should have been
> > initialized in the same vein as I described above. I?ll quickly fix this
> so
> > that this does not happen anymore in the new version (from tomorrow
> > onwards).
> >
> > This means, also for you the fix would have been just to initialize the
> > template variable rather than renaming the variable, but your solution
> also
> > works fine after initializing the variable ;)
> >
> >
> >
> > Best,
> >
> > J?rn
> >
> >
> >
> >
> >
> >
> >
> > *--*
> >
> >
> >
> > *J?rn M. Horschig, PhD*, Software Engineer
> >
> > Artinis Medical Systems <http://www.artinis.com/>  |  +31 481 350 980
> >
> >
> >
> > *From:* fieldtrip-bounces at science.ru.nl [mailto:
> > fieldtrip-bounces at science.ru.nl] *On Behalf Of *Daria Laptinskaya
> > *Sent:* Thursday, September 10, 2015 10:39 AM
> > *To:* FieldTrip discussion list <fieldtrip at science.ru.nl>
> > *Subject:* [FieldTrip] Problem with ft_megrealign
> >
> >
> >
> > Dear all,
> >
> > I would like to apply the ft_megrealign function to MEG data.
> >
> > First I tried this:
> >
> >     cfg             = [];
> >
> >     cfg.vol.r       = 12;
> >
> >     cfg.vol.o       = [0, 0, 4];
> >
> >     cfg.template    = allsens;
> >
> >     cfg.channel     = {'MEG'};
> >
> >     cfg.inwardshift =  1;
> >
> >     cfg.headshape   = 'hs_file';
> >
> >
> >
> > new_data = ft_megrealign(cfg, old_data);
> >
> >
> >
> > Then I got the following error message:
> >
> > At compilation, "template" was determined to be a variable and this
> > variable is
> > uninitialized. "template" is also a function name and previous versions
> of
> > MATLAB would
> > have called the function. However, MATLAB 7 forbids the use of the same
> > name in the same
> > context as both a function and a variable.
> >
> >
> >
> > I thought that renaming the variable ?template? would solve the problem
> > and did the following within the original function (replaced the
> > template-variable with the Ntp_avg variable):
> >
> >
> >
> > Ntp_avg = length(cfg.template);
> >
> > for i=1:Ntp_avg
> >
> >   if ischar(cfg.template{i}),
> >
> >     fprintf('reading template sensor position from %s\n',
> > cfg.template{i});
> >
> >     tp_avg(i) = ft_read_sens(cfg.template{i});
> >
> >   elseif isstruct(cfg.template{i}) && isfield(cfg.template{i}, 'coilpos')
> > && isfield(cfg.template{i}, 'coilori') && isfield(cfg.template{i},
> 'tra'),
> >
> >     tp_avg(i) = cfg.template{i};
> >
> >   end
> >
> > end
> >
> >
> >
> > No I get an error message, that ?the variable tp_avg is not defined?.
> >
> > Do I forget something? Or do anyone have an other solution for the
> problem?
> >
> >
> >
> > I would appreciate any help / ideas!
> >
> >
> >
> > Thanks in advance!
> >
> >
> >
> > Best,
> >
> > Daria
> >
> > _______________________________________________
> > fieldtrip mailing list
> > fieldtrip at donders.ru.nl
> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150915/923298df/attachment-0001.html
> >
>
> ------------------------------
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
> End of fieldtrip Digest, Vol 58, Issue 14
> *****************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150915/4e9c7345/attachment-0001.html>


More information about the fieldtrip mailing list