[FieldTrip] labels not updated in ft_scalpcurrentdensity using Hjorth's method

Hedderik van Rijn hedderik at van-rijn.org
Sat Jul 2 14:01:33 CEST 2011


Dear Fieldtrippers,

for a replication study, I'm applying Hjorth's SCD method on just FCz with a given set of neighbors. After running the following code:

cfg = [];
elec = ft_read_sens('electrodes-Tobias.set');
cfg.elec = elec;
ngh = {struct('label','FCz','neighblabel',{{'FC3','FC4','CPZ','AFz'}})};
cfg.method = 'hjorth';
cfg.neighbours = ngh;
cfg.trials = 'all';
data_hjorth = ft_scalpcurrentdensity(cfg,data);

The labels of the resulting dataset still refer to the original electrodes:

>> length(data_hjorth.label)

ans = 

    [32]

But the resulting data only contains FCz information (as expected):

>> size(data_hjorth.trial{1})

ans =

           1        2500

I was wondering if this is intentional, or whether the label field should only contain the electrode(s) for which the current density was calculated. If the latter is the case, line 229 of ft_scalpcurrentdensity, which reads:

    scd.label   = data.label;

should be replaced with:

if strcmp(cfg.method, 'hjorth')
    scd.label   = labelnew;
else
    scd.label   = data.label;
end


 - Hedderik.



More information about the fieldtrip mailing list