[FieldTrip] keeptrials = 'yes' with DICS does not keep trials

Stephen Whitmarsh stephen.whitmarsh at gmail.com
Fri Jul 7 10:57:17 CEST 2017


Hi Elena,

Thanks for the link - that is indeed a very nice and complete tutorial! A
link in the current beamformer tutorial would be helpful for the next time
I think - I will put one there.

And yes, I see now that although the documentation is as follows:
%   cfg.rawtrial      = 'no' or 'yes'   *construct filter from single
trials*, apply to single trials. Note that you also may want to set
cfg.keeptrials='yes' to keep all trial information, especially if using in
combination with grid.filter

(I find the red part inconsistent) it does take the pre-specified filter
when provided, which is suggested somewhat implicitly further down in the
code:

if strcmp(cfg.rawtrial,'yes') && isfield(cfg,'grid') &&
~isfield(cfg.grid,'filter')
  warning('Using each trial to compute its own filter is not currently
recommended. Use this option only with precomputed filters in grid.filter');
end

So that really clears it up. I will suggest an edit to the documentation,
for the sake of clarification, and next time I run my beamformer I will
remove the loop over trials :-)

Thanks again,
Stephen


On 7 July 2017 at 10:31, Elena Orekhova <orekhova.elena.v at gmail.com> wrote:

> Hi Stephen,
> I followed the tutorial in http://www.fieldtriptoolbox.or
> g/tutorial/salzburg, but used 'dics' (see below).
> I think that in the example below the  sourceavg.avg.filter was indeed
> used and my results look nice.
>
> Elena
>
> cfg=[];cfg.method='lcmv';cfg.grid <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html>=grid <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html>;cfg.grid <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/grid.html>.filter <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/filter.html>=sourceavg.avg.filter <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/filter.html>;cfg.rawtrial = 'yes';cfg.vol=hdm;
> sourcepreS1=ft_sourceanalysis(cfg, avgpre);
> sourcepstS1=ft_sourceanalysis(cfg, avgpst);
>
>
>
> On 6 July 2017 at 18:03, Stephen Whitmarsh <stephen.whitmarsh at gmail.com>
> wrote:
>
>> Hi Elena!
>>
>> Thanks! But I do wonder.. did you check whether the common filter
>> (specified in the cfg) was used or whether a filter was calculated for each
>> trial separately (which does not make sense in my case)?
>>
>> Best,
>> Stephen
>>
>> On 6 July 2017 at 16:57, Elena Orekhova <orekhova.elena.v at gmail.com>
>> wrote:
>>
>>> Just recently had the same problem.
>>> It worked with  cfg.rawtrial='yes'.
>>>
>>> Best,
>>> Elena
>>>
>>> On 4 July 2017 at 18:03, Stephen Whitmarsh <stephen.whitmarsh at gmail.com>
>>> wrote:
>>>
>>>> Hi everyone,
>>>>
>>>> I am now trying to use the DICS method for sourceanalysis, with
>>>> 'powandcsd' output from ft_freqanalysis as its input and using a
>>>> precomputed filter and leadfield. However, I would like to keep my separate
>>>> trial estimates in the final source analysis, and while the documentation
>>>> suggests I should be able to get that with cfg.keeptrials, but this doesn't
>>>> have the expected effect.
>>>>
>>>> I previously made workaround using PCC on fourier data instead (see
>>>> below), I think to deal with this issue. I was wondering if this is still
>>>> the recommended option, i.e. workaround? Alternatively, and perhaps
>>>> preferably, would someone have a suggestion for a solution consistent with
>>>> the DICS implementation?
>>>>
>>>> Thanks for your time,
>>>> Stephen
>>>>
>>>> % source analysis
>>>> cfg.method           = 'pcc';
>>>> ...
>>>> cfg.keeptrials       = 'yes';
>>>> cfg.pcc.keepmom      = 'yes';
>>>> cfg.pcc.fixedori     = 'no';
>>>> source_control       = ft_sourceanalysis(cfg, FFT);
>>>>
>>>> and then:
>>>>
>>>> % project moment and tapers
>>>> cfg = [];
>>>> cfg.projectmom = 'no';
>>>> cfg.keeptrials = 'yes';
>>>> cfg.powmethod  = 'lambda1';
>>>> source         = ft_sourcedescriptives(cfg,source);
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> fieldtrip mailing list
>>>> fieldtrip at donders.ru.nl
>>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>>>
>>>
>>>
>>> _______________________________________________
>>> fieldtrip mailing list
>>> fieldtrip at donders.ru.nl
>>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>>
>>
>>
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170707/8bc5782b/attachment.html>


More information about the fieldtrip mailing list