Back to the main page.

Bug 1235 - ft_selectdata (ft_selectdata_new) should retain sampleinfo when possible

Status REOPENED
Reported 2011-12-15 08:05:00 +0100
Modified 2016-01-19 13:08:57 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P4 enhancement
Assigned to: Eelke Spaak
URL:
Tags:
Depends on:
Blocks:
See also:

Eelke Spaak - 2011-12-15 08:05:43 +0100

Given this: >> data data = hdr: [1x1 struct] label: {22x1 cell} fsample: 1000 trial: {[22x3001 double] [22x3001 double] [22x3001 double] [22x3001 double] [22x3001 double] [22x3001 double]} time: {[1x3001 double] [1x3001 double] [1x3001 double] [1x3001 double] [1x3001 double] [1x3001 double]} sampleinfo: [6x2 double] >> dat=ft_selectdata(data,'toilim',[-0.999 2]); selecting 6 trials The output will be this: >> dat dat = hdr: [1x1 struct] label: {22x1 cell} fsample: 1000 trial: {[22x3000 double] [22x3000 double] [22x3000 double] [22x3000 double] [22x3000 double] [22x3000 double]} time: {[1x3000 double] [1x3000 double] [1x3000 double] [1x3000 double] [1x3000 double] [1x3000 double]} Which is undesirable, since the sampleinfo can perfectly well be determined from the original sampleinfo and the specified toilim.


Boris Reuderink - 2011-12-22 14:19:29 +0100

Confirmed (defect by developer) --- seems like a sensible thing to do.


Jan-Mathijs Schoffelen - 2012-01-27 08:46:34 +0100

assigned bug to get all bugs lined up before the grand bug binge


Eelke Spaak - 2012-02-08 14:45:53 +0100

Fixed in revision 5262.


Eelke Spaak - 2012-02-08 14:46:58 +0100

NB: This was a change in utilities/private/selfromraw; I am not sure if/how the ft_selectdata_new function uses this. It solves the problem for ft_selectdata_old, though.


Eelke Spaak - 2012-03-14 10:00:43 +0100

closing several bugs that have been RESOLVED for a long time


Eelke Spaak - 2016-01-19 12:47:09 +0100

I've noticed that when calling ft_selectdata with the "new" syntax ft_selectdata(cfg, data) the sampleinfo is still thrown away (at least when selecting across time using cfg.latency or cfg.toilim). When using key-value input arguments (thus using ft_selectdata_old) everything is fine and sampleinfo is retained and updated properly.


Jan-Mathijs Schoffelen - 2016-01-19 13:08:57 +0100

looks like the statements made in comment 4 now have an answer...