Back to the main page.

Bug 3109 - ft_combineplanar does not work for trials containing one bad planar gradient chaannel

Status NEW
Reported 2016-04-19 00:24:00 +0200
Modified 2016-05-06 08:27:25 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P5 normal
Assigned to: Weiyong Xu
Depends on:
See also:

Weiyong Xu - 2016-04-19 00:24:31 +0200

Created attachment 788 code and .mat data ft_combineplanar computes the planar gradient magnitude over both directions combining the two gradients at each sensor to a single positive-valued number. However, if one of the two gradients(electa system) is defined as bad channel and thus removed from cfg.channels in the preprocessing. I found it gave an error that I cannot combine the rest of the gradients with ft_combineplanar. the error message looks like: Error using ft_combineplanar (line 119) not all planar channel combinations are complete Error in bug (line 21) ft_combineplanar([],test_trials);

Weiyong Xu - 2016-04-19 00:37:03 +0200

I cannot combine the rest of planar gradients because of one bad channel. Maybe the code can be modified so that the other gradient got discarded also.

Robert Oostenveld - 2016-04-19 08:49:02 +0200

For elekta data it should be possible to discard one bad channel. The consequence for combine planar should be that the other channel (from the same pair) is to be ignored.

Jan-Mathijs Schoffelen - 2016-05-06 08:27:25 +0200

This can be fixed by comparing the first output arguments to the match_str commands in lines 115 and 116 with each other, probably by means of an intersect or so. The unnpaired channels can be identified and removed, so the error would then not be necessary anymore. I suggest that Weiyong suggests a code change that we will pull into the main development version of Fieldtrip on See: for information how to best do this.