Back to the main page.

Bug 2112 - have ft_prepare_neighbours accept electrode file as template

Status CLOSED FIXED
Reported 2013-04-12 23:08:00 +0200
Modified 2019-08-10 12:03:45 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 enhancement
Assigned to:
URL:
Tags:
Depends on:
Blocks:
See also:

Ingrid Nieuwenhuis - 2013-04-12 23:08:07 +0200

for my gsn128 no template is present. And I was also thinking, why not also making ft_prepare_neighbours accept and elec file as template. So for instance cfg.template = 'GSN-HydroCel-128.sfp'; then it calls elec = ft_read_sens('GSN-HydroCel-128.sfp'); data.elec = elec; cfg = []; cfg.method = 'distance'; neighbours = ft_prepare_neighbours(cfg, data); and use neigbours as the template. It's a bit obscure now, if the template for the user is not present what the templates are ans what's in it.


Robert Oostenveld - 2013-04-15 15:28:05 +0200

The ft_prepare_neighbours documentation states % The EEG or MEG sensor positions can be present in the data or can be specified as % cfg.elec = structure with electrode positions, see FT_DATATYPE_SENS % cfg.grad = structure with gradiometer definition, see FT_DATATYPE_SENS % cfg.elecfile = name of file containing the electrode positions, see FT_READ_SENS % cfg.gradfile = name of file containing the gradiometer definition, see FT_READ_SENS so I would expect this to be implemented already. Could you check whether it works for you?


Ingrid Nieuwenhuis - 2013-04-19 20:03:14 +0200

Yes, you're right, it works with calling: elec = ft_read_sens('GSN-HydroCel-129.sfp'); cfg = []; cfg.elec = elec; cfg.method = 'distance'; neighbours = ft_prepare_neighbours(cfg); I was just confused by the option cfg.template. This option and having all these pre-made templates now seems so redundant to me, since the above works as well. Well, maybe there is some other logic behind the templates and having cfg.template as an option. Anyways, bug solved.


Robert Oostenveld - 2019-08-10 12:03:45 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue describing the issue on https://github.com/fieldtrip/fieldtrip/issues.