Back to the main page.
Bug 1813 - ft_fetch_header: requires grad field in header
Status | CLOSED FIXED |
Reported | 2012-11-06 16:46:00 +0100 |
Modified | 2012-12-31 11:46:26 +0100 |
Product: | FieldTrip |
Component: | core |
Version: | unspecified |
Hardware: | PC |
Operating System: | Mac OS |
Importance: | P3 normal |
Assigned to: | Robert Oostenveld |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Joscha Schmiedt - 2012-11-06 16:46:50 +0100
ft_fetch_header checks sets the grad field of data to data.hdr.grad: ... %in data has been appended, the grad might be lost but inside of hdr %there should be the grad if ~isfield(hdr,'grad') && isfield(data, 'hdr') hdr.grad=data.hdr.grad; end ... However, not all types of headers contain a grad field.
Robert Oostenveld - 2012-11-07 09:55:41 +0100
Thanks for the report, seems indeed incorrect. However, I cannot find the specific piece of code. mac001> grep 'in data has been appended' fieldtrip/*.m mac001> grep 'in data has been appended' fieldtrip/*/*.m mac001> grep data.hdr.grad fieldtrip/*.m mac001> grep data.hdr.grad fieldtrip/*/*.m mac001> grep data.hdr.grad fieldtrip/*/*/*.m all return empty. The latest ft_fetch_header at line 63 has % fill in hdr.grad or hdr.elec if isfield(data, 'grad') hdr.grad=data.grad; elseif isfield(data, 'elec') hdr.elec=data.elec; end Can you please clarify where you found this piece of code?
Joscha Schmiedt - 2012-11-07 10:05:58 +0100
Sorry, should have included that info. The code snippet is from Lines 69-73 of utilities/ft_fetch_header.m, Version % $Id: ft_fetch_header.m 6878 2012-11-06 15:01:28Z dieloz $¬
Robert Oostenveld - 2012-11-07 10:28:04 +0100
(In reply to comment #2) My apologies, I was looking at an old version myself and should have done an update. I just changed it into % retrieve the gradiometer and/or electrode information if isfield(data, 'grad') hdr.grad = data.grad; elseif isfield(data, 'hdr') && isfield(data.hdr, 'grad') hdr.grad = data.hdr.grad; end if isfield(data, 'elec') hdr.elec = data.elec; elseif isfield(data, 'hdr') && isfield(data.hdr, 'elec') hdr.elec = data.hdr.elec; end Sending fileio/private/ft_fetch_header.m Transmitting file data . Committed revision 6882. mac001> svn update U utilities/ft_fetch_header.m Updated to revision 6883.