Back to the main page.

Bug 2270 - channel selection does not work in forward and inverse routines

Reported 2013-08-29 22:17:00 +0200
Modified 2015-01-12 09:23:53 +0100
Product: FieldTrip
Component: forward
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 major
Assigned to: Jan-Mathijs Schoffelen
Depends on: 1746
See also:

Behnam - 2013-08-29 22:17:45 +0200

Hi, All the functions engaging in forward and inverse problems consider that all electrodes participate in the analysis. There is an option which is supposed to select a subset of electrodes from cfg.elec , but this option does not work at all. In another word, I cannot make a big leadfield model including about 300 channels and then re-use a subset of this leadfield model in my forward and inverse problems. Best, Behnam

Robert Oostenveld - 2013-08-30 08:35:16 +0200

Hi Behnam channel selection works in general, but you indeed cannot make selections out of a precomputed leadfield. I.e. if you have sourceanalysis compute the leadfields, is used, but if you specify cfg.grid.leadfield it is not. The implicit assumption in the code is that ft_prepare_leadfield and ft_sourceanalysis are executed as a pair. For experimental MEG data this makes sense, but I can indeed see that it makes less sense for EEG. The challenge with EEG however is that it is not simply involves removing channels, but also re-referencing. The covariance or CSD matrix are computed in timelock/freqanalysis and from that point on the reference cannot be changed. I will try to think of a solution. Robert

Behnam - 2013-08-30 11:02:54 +0200

(In reply to comment #1) Thanks Robert for explications. So, I do have a few suggestions and propositions: 1) Let's assume that a volume has been prepared for 300 electrodes by ft_prepare_vol_sens(), then we want to use a subset of these electrods (for example 50) for sourceanalysis. The current version of the ft_sourceanalysis() cannot work with the volume that has already been prepared for 300 electrodes (we should pass the original whole volume). The following piece of code can be added to ft_prepare_vol_sens() (line 421) in order to support this. elseif size(vol.mat,1)~=size(vol.mat,2) && size(vol.mat,1)==Nchans fprintf('volume should be matched with new selected sensors (Behnam)\n'); vol.mat = vol.mat(selsens,:); avg = mean(vol.mat, 1); 2) If we want to use a precomputed leadfield matrix for a subset of eeg channels, then all inverse routines (lcmv,mne, rv, ...) should load firstly the leadfield matrix for 300 channels and then a subset of this matrix should be used for the inverse problem. For example line 200-210 in beamformer_lcmv() should change accordingly. 3) I would suggest to add a=upper(a); b=upper(b); in match_str(). It is so often that channel names in our data is not identical to channel names of a template if the comparision is performed in case sensitive format. Best, Behnam Molaee

Jan-Mathijs Schoffelen - 2014-11-13 11:35:25 +0100

I suggest to follow up on this one (if needed) in #1746