Back to the main page.

Bug 1306 - ctf64 data: ft_datatype_sens(data.grad) fails after call to ft_selectdata

Status CLOSED FIXED
Reported 2012-02-01 15:03:00 +0100
Modified 2019-08-10 11:55:46 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P4 normal
Assigned to: Diego Lozano Soldevilla
URL:
Tags:
Depends on:
Blocks:
See also: http://bugzilla.fcdonders.nl/show_bug.cgi?id=1309http://bugzilla.fcdonders.nl/show_bug.cgi?id=1763

Johanna - 2012-02-01 15:03:09 +0100

Inside ft_timelockanalysis, after call to ft_selectdata for cfg.trials, (put a breakpoint there around line 144), then if you run ft_datatype_sens(data.grad) it fails (for ctf64 data only; runs ok on ctf274 and bti). The reason is that senstype is not found correctly in ft_senstype, as the existence of data.grad.elecpos causes 'iselec' to be set 'true', so senstype is set to 'electrode' further down. Thus, why does elecpos get added?


Jan-Mathijs Schoffelen - 2012-05-16 08:05:40 +0200

*** Bug 1419 has been marked as a duplicate of this bug. ***


Robert Oostenveld - 2012-10-03 15:22:56 +0200

Start with implementing a test script. See /home/common/matlab/fieldtrip/data/test/original/meg


Diego Lozano Soldevilla - 2012-10-05 18:19:26 +0200

(In reply to comment #2) I'm checking the triggers of the ctf64 dataset but I cannot read the file: cfg = []; cfg.trialdef.eventtype = '?'; cfg.dataset = '/home/common/matlab/fieldtrip/data/test/original/meg/ctf64/Wat123r1raw.ds'; cfg = ft_definetrial(cfg); Warning: could not determine filetype of /home/common/matlab/fieldtrip/data/test/original/meg/ctf64/Wat123r1raw.ds/Wat123r1raw.meg4 > In fileio/private/warning_once at 75 In ft_filetype at 1061 In ft_checkconfig at 503 In ft_definetrial at 116 Warning: no trialfun was specified, using ft_trialfun_general > In ft_definetrial at 123 evaluating trialfunction 'ft_trialfun_general' Error using ft_read_header (line 1655) unsupported header format (unknown) Error in ft_trialfun_general (line 55) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); Error in ft_definetrial (line 162) [trl, event] = feval(cfg.trialfun, cfg); The error is because the ctf64 *.meg4 file header's mismatch when inside ft_definetrial (line 116), ft_checkconfing calls ft_filetype: Around line 230: filetype_check_header(filename, 'MEG41CP'), the ctf64 header is 'MEG4CPT' instead of 'MEG41CP'. What to do? Suggestion: add an OR statement in ft_filetype line 230 to make ctf64 compatible: elseif filetype_check_extension(filename, '.meg4') && filetype_check_header(filename, 'MEG41CP') || filetype_check_header(filename, 'MEG4CPT')


Jan-Mathijs Schoffelen - 2012-10-07 11:30:21 +0200

Hi Diego, This looks like a good suggestion. Note that you need brackets around the 2 statements that are separated by the '||' in order for it to work.


Diego Lozano Soldevilla - 2012-10-09 15:59:10 +0200

(In reply to comment #4) Done Jan-Mathijs. I've the same issue with the ctf64 *.res4 file: the header info is 'MEG3RES' but is not among the ft_filetype options (see line 226). I propose you the same: elseif filetype_check_extension(filename, '.res4') && (filetype_check_header(filename, 'MEG41RS') || filetype_check_header(filename, 'MEG42RS') || filetype_check_header(filename, 'MEG4RES') || filetype_check_header(filename, 'MEG3RES'))


Jan-Mathijs Schoffelen - 2012-10-09 16:03:17 +0200

sounds good to me!


Diego Lozano Soldevilla - 2012-10-09 17:29:39 +0200

(In reply to comment #6) cfg = ft_definetrial(cfg); Warning: no trialfun was specified, using ft_trialfun_general > In ft_definetrial at 123 evaluating trialfunction 'ft_trialfun_general' readCTFds: .meg4 file header=MEG4CPT Valid header options: MEG41CP MEG42CP Reference to non-existent field 'res4'. Error in ft_read_header (line 405) hdr.Fs = orig.res4.sample_rate; Error in ft_trialfun_general (line 55) hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat); Error in ft_definetrial (line 162) [trl, event] = feval(cfg.trialfun, cfg); The new headers for CTF64 are not included in readCTFds.m funtion. If we want to add them, we should change go to lines 88-89 in readCTFds.m: res4Headers=strvcat(['MEG41RS',char(0)],['MEG42RS',char(0)],['MEG3RES',char(0)]); meg4Headers=strvcat(['MEG41CP',char(0)],['MEG42CP',char(0)],['MEG4CPT',char(0)]); As it's readCTFds.m it's an external function, shall we discuss potential solutions tomorrow at the fieldtrip bug binge?


Diego Lozano Soldevilla - 2012-10-10 15:53:35 +0200

...


Robert Oostenveld - 2019-08-10 11:51:49 +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.


Robert Oostenveld - 2019-08-10 11:55:46 +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.