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

Cristiano Micheli michelic72 at gmail.com
Tue Mar 10 17:23:26 CET 2015

Dear Vitoria,
how are you?

The problem seems to lie in the definition of the sensors (first error
message, which is encapsulated by the subsequent ones).
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.
On top of that I would always clean the actual cfg by nulling it at the
beginning of every function call (cfg=[]). This avoids to carry around
incompatible fields in sequential calls of different functions (which also
require different cfg options).

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 hope this helps!
Greetings from Oldenburg


On Mon, Mar 9, 2015 at 4:58 AM, Vitória Piai <v.piai.research at gmail.com>

> 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
> 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/cec90eac/attachment-0002.html>

More information about the fieldtrip mailing list