Back to the main page.
Bug 3399 - ft_appenddata does not keep the .fsample field
Status | CLOSED FIXED |
Reported | 2018-01-10 18:16:00 +0100 |
Modified | 2019-08-10 12:43:50 +0200 |
Product: | FieldTrip |
Component: | core |
Version: | unspecified |
Hardware: | PC |
Operating System: | Mac OS |
Importance: | P5 normal |
Assigned to: | Arjen Stolk |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Arjen Stolk - 2018-01-10 18:16:20 +0100
See for instance below. I this desired behavior? If not, an easy fix would be to add fsample to the several 'keepfields' calls occurring in append_common.m raw{1} struct with fields: hdr: [1×1 struct] label: {86×1 cell} time: {1×23 cell} trial: {1×23 cell} fsample: 5000 sampleinfo: [23×2 double] trialinfo: [23×4 double] cfg: [1×1 struct] raw{2} struct with fields: hdr: [1×1 struct] label: {86×1 cell} time: {1×32 cell} trial: {1×32 cell} fsample: 5000 sampleinfo: [32×2 double] trialinfo: [32×4 double] cfg: [1×1 struct] raw_app = ft_appenddata([], raw{:}) raw_app = struct with fields: (note the missing fsample) label: {86×1 cell} trialinfo: [55×4 double] sampleinfo: [55×2 double] trial: {1×55 cell} time: {1×55 cell} cfg: [1×1 struct]
Robert Oostenveld - 2018-02-03 17:42:17 +0100
fsample is not a required field in raw data, so as such this is acceptable behavior. Whenever a FT function really needs it, it is usually computed on the fly using something like data.fsample = 1/median(diff(data.trial{1})); If you want, feel free to send a PR which copies it over from the input to the output when present.
Diego Lozano Soldevilla - 2019-03-01 12:24:35 +0100
(In reply to Robert Oostenveld from comment #1) https://github.com/fieldtrip/fieldtrip/commit/6aee30b933280a94291a430d2af22f6a9ef38794