Back to the main page.

Bug 2685 - ft_scalpcurrendensity blocks on combined MEG-EEG dataset

Status NEW
Reported 2014-09-15 14:15:00 +0200
Modified 2014-09-17 16:44:58 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P5 normal
Assigned to: Jim Herring
URL:
Tags:
Depends on:
Blocks: 2684
See also:

Jim Herring - 2014-09-15 14:15:19 +0200

In light of the Stockholm workshop ft_scalpcurrentdensity is used on a combined MEG-EEG dataset stripped of the MEG data. The grad structure, however, still remains in the dataset. ft_scalpcurrentdensity does not allow datasets containing a grad structure: 115 | % check if the input data is valid for this function 116 | data = ft_checkdata(data, 'datatype', 'raw', 'feedback', 'yes', 'ismeg', 'no'); One possible solution is to replace the error with a warning. Users should be aware that this function should not be used on MEG data but in the end users are responsible for the correct input data. Another solution would be to remove the grad field at the step where the EEG data is extracted and the MEG data removed. In this case using ft_preprocessing with cfg.channel = 'EEG';


Robert Oostenveld - 2014-09-15 14:33:53 +0200

ft_checkdata should have both ismeg=yes/no/empty and iseeg=yes/no/empty. These are not mutually exclusive. Note that ismeg=no is only to be used when we know that an algorithm does not work for MEG. In general the common options for ismeg are 'yes' and []. The error should remain as is.


Robert Oostenveld - 2014-09-15 14:34:32 +0200

oh, the specific bug is to be addressed by iseeg=yes, and ismeg=[] as requirements for ft_scalpcurrendensity.


Jim Herring - 2014-09-15 16:02:19 +0200

ok, that solves the main issue. ft_scalpcurrentdensity now crashes because ft_fetch_sens reads out the grad information, not the elec information. Unlike ft_read_sens, ft_fetch_sens does not have a senstype option. Should I implement such an option?


Jim Herring - 2014-09-15 16:30:26 +0200

ft_fetch_sens doesn't even recognize it as having eeg data as ft_senstype, in an if-then statement, first looks for the presence of a grad field. Currently, ft_fetch_sens should throw an error if both a grad and elec field are present. This does not happen, however, as iseeg currently cannot be true in the presence of a grad field.


Jan-Mathijs Schoffelen - 2014-09-17 14:26:24 +0200

Discussed in ft-meeting: change ft_senstype to be non-mutually exclusive. implement senstype in ft_fetch_sens as in ft_read_sens


Jim Herring - 2014-09-17 16:44:58 +0200

I've implemented senstype in ft_fetch_sens and I've made ft_scalpcurrentdensity ask for 'EEG' sensors. Sending ft_scalpcurrentdensity.m Sending private/ft_fetch_sens.m Adding test/test_bug2685.m Transmitting file data ... Committed revision 9810.