[FieldTrip] ft_scalpcurrentdensity methods + error if method is not 'spline'

Vitoria Piai v.piai.research at gmail.com
Tue Mar 10 20:56:55 CET 2015

Thank you, Cris.

> What I noticed (but I fear I can't be more precise due to lack of 
> information) is that you use two cfg definitions (cfg and cfgn) and 
> that might create problems.
One of them (cfgn) is only being used to define neighbours, so I don't 
think that matters.
> On top of that I would always clean the actual cfg by nulling it at 
> the beginning of every function call (cfg=[]).
I always do this, only didn't paste that part of my code to have it 
occupying less space. So that isn't the problem either.
> It would also help a lot if you included the call to ft_freqanalysis 
> (again with an eye of regard of nulling the cfg beforehand).
I doubt it's the cfg in ft_freqanalysis that is causing the problem - 
it's the same cfg I've been using for 5 years now, and in line with the 
one shown in the tutorial. So unfortunately, not the solution either.

The key is in the computation of the scd depending on the method. The 
error only occurs with 'hjorth' and 'finite', but not with 'spline'. 
Maybe I should just read more on these three methods before I try to 
advance any further.

Thanks anyways, Vitoria

> On Mon, Mar 9, 2015 at 4:58 AM, Vitória Piai 
> <v.piai.research at gmail.com <mailto:v.piai.research at gmail.com>> wrote:
>     Hi all,
>     I'm interested in using Laplacian transformation prior to
>     computing TFRs.
>     I still haven't read anything about the three methods implemented
>     in FieldTrip, I must confess, but I think my question is
>     independent of that. I'm using FT version: fieldtrip-20140801 on
>     Matlab2014a.
>     If I use the method 'spline', I can subsequently run
>     ft_freqanalysis (or ft_timelockanalysis for that matter). However,
>     with either 'hjorth' or 'finite', I get an error when running
>     ft_freqanalysis/ft_timelockanalysis:
>     My cfg:
>       cfgn.method       = 'template';
>       cfgn.layout       = 'biosemi64.lay';
>       cfg.neighbours      = ft_prepare_neighbours(cfgn, dat);
>       cfg.method = 'hjorth'; %'finite', 'spline'
>       cfg.elec            = ft_read_sens('standard_1005.elc');
>       lpc = ft_scalpcurrentdensity(cfg, dat);
>     % Then after that, a commonly used cfg for ft_freqanalysis
>     Error using ft_datatype_sens (line 375)
>     inconsistent number of channels in sensor description
>     Error in ft_datatype_raw (line 138)
>           data.elec = ft_datatype_sens(data.elec);
>     Error in ft_checkdata (line 219)
>       data = ft_datatype_raw(data, 'hassampleinfo', hassampleinfo);
>     Error in ft_freqanalysis (line 211)
>     data = ft_checkdata(data, 'datatype', {'raw', 'raw+comp', 'mvar'},
>     'feedback', cfg.feedback, 'hassampleinfo', 'yes');
>     I understand that the "inconsistent number of channels in sensor
>     description" is coming from these two other implementations, but
>     should that be the case? The help on ft_scalpcurrentdensity says "
>     The output data has the same format as the input and can be used
>     in combination with most other FieldTrip functions". So I'm
>     wondering whether there's something special intrinsic to these
>     implementations, I'm using a too old FT version, my config isn't
>     right, or this is an issue that has gone unnoticed because those
>     implementations are not used often.
>     Thanks a lot!
>     Cheers from Berkeley,
>     Vitoria
>     _______________________________________________
>     fieldtrip mailing list
>     fieldtrip at donders.ru.nl <mailto:fieldtrip at donders.ru.nl>
>     http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> _______________________________________________
> 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/20150310/8f274af8/attachment-0002.html>

More information about the fieldtrip mailing list