Back to the main page.

Bug 3344 - ft_preprocessing error with g.tec files

Reported 2017-09-14 16:23:00 +0200
Modified 2017-12-08 15:35:21 +0100
Product: FieldTrip
Component: preproc
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P5 normal
Assigned to:
Depends on:
See also:

- 2017-09-14 16:23:03 +0200

Hello everyone, I recently started using a g.tec EEG and a simulink module to record the data. Simulink outputs the data as a .mat file. I used the following script to define trials and preprocess (see below). It seems that ft_definetrial runs and epochs my data, but then crashes at ft_preprocessing. cfg=[]; cfg.trialfun='mytrlfunction' ; cfg.datafile=currDataFile; cfg.trialdef.preStimTime=0.5; cfg.outputMode='fieldtrip'; cfg=ft_definetrial(cfg); cfg.continuous='yes'; cfg.detrend='yes'; dataRaw1=ft_preprocessing(cfg); And I get this error: unsupported header format "matlab" Error in ft_error (line 39) ft_notification(varargin{:}); Error in ft_read_header (line 2325) ft_error('unsupported header format "%s"', headerformat); Error in ft_preprocessing (line 395) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat, 'coordsys', cfg.coordsys, 'coilaccuracy', cfg.coilaccuracy, 'checkmaxfilter', istrue(cfg.checkmaxfilter)); From the error in ft_read_header, it seems that the file isn't recognized as a g.tec file and so it think that it cannot read the mat file. Has anybody tried preprocessing with g.tec? Thank you everyone

Jan-Mathijs Schoffelen - 2017-11-20 20:27:47 +0100

saving the data as a 'mat' file does not guarantee that FieldTrip understands the format, in how the variables are represented in the file. I think that you need to write some dedicated code for this, to be incorporated into: ft_read_data ft_read_event ft_read_header ft_filetype

Jan-Mathijs Schoffelen - 2017-11-23 11:37:02 +0100

I think that this needs to be followed up by Omri. If there is insufficient interest, I suggest to close this bug, in order not to clog the whole system with things that have an apparent low priority. I'd happy to provide pointers for getting this solved.

- 2017-12-08 10:27:26 +0100

Indeed, it seems that fieldtrip is not compatible with gTec data saved with SimuLink (rather than gRecorder). We resolved our problem by adapting ft_preprocessing and ft_read_header with in-house code. If there is no interest in this bug, I guess you can just close it.

Jan-Mathijs Schoffelen - 2017-12-08 14:44:48 +0100

Well, if you have a clean fix, I suggest that you contribute your adapted version through a git "Pull Request" see for instructions

Jan-Mathijs Schoffelen - 2017-12-08 15:35:21 +0100

My suggestion to close this bug was mostly inspired by the ~ 2 months of silence on your end. If you have a solid solution, we would greatly appreciate any contributions that improve the code