Back to the main page.

Bug 3279 - cfg.selectfeature doesnt work in ft_databrowser

Status RESOLVED WONTFIX
Reported 2017-04-01 07:37:00 +0200
Modified 2021-09-16 13:41:06 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P5 normal
Assigned to: Roemer van der Meij
URL:
Tags:
Depends on:
Blocks: 2314
See also:

Diego Lozano Soldevilla - 2017-04-01 07:37:42 +0200

I'm using ft_databrowser to inspect sleep data and I want to visually mark different events (spindles, k-complexes, artifacts, so forth) and asign them to different cfg.artfctdef.xxx.artifact substructures. Could somebody give a hint me to mark different artifact trial types using the cfg.selectfeature option? It's not obvious to me where to start the fix. Please find below the code and data to reproduce the error I got. I'm using the very last fieldtrip version on windows with matlab 7.9b. data = []; data.label = {'Fpz';'F7';'F3';'Fz';'F4';'F8';'C3';'Cz';'C4';'P3';'Pz';'P4';'O1';'Oz';'O2'}; data.fsample = 250; data.trial{1} = rand(size(data.label,1),data.fsample*30); data.time{1} = (1:data.fsample*30)./data.fsample; cfg = []; cfg.length = 2; cfg.overlap = 0; trl = ft_redefinetrial(cfg,data); cfg = []; cfg.channel = 'all'; cfg.blocksize = 2; cfg.selectfeature = {'a';'b'}; cfg.viewmode = 'vertical'; events = ft_databrowser(cfg,trl); the input is raw data with 15 channels and 15 trials detected 0 a artifacts detected 0 b artifacts ??? Error using ==> plus Matrix dimensions must agree. Error in ==> ft_databrowser at 745 hsel = [1 2 3] + (opt.ftsel-1) .*3; ??? Reference to non-existent field 'trlvis'. Error in ==> ft_databrowser>redraw_cb at 1639 begsample = opt.trlvis(opt.trlop, 1); Error in ==> ft_databrowser>winresize_cb at 2250 redraw_cb(h,eventdata); ??? Error while evaluating figure ResizeFcn


Jan-Mathijs Schoffelen - 2017-11-28 09:36:32 +0100

I added a condition check to prevent the crash, @Roemer please review. this pertains to PR597 on github


Jan-Mathijs Schoffelen - 2021-09-16 13:41:06 +0200

using cfg.selectfeature today (i.e. september 16 2021) FT tells me that this option is deprecated. Therefore, I suggest to change this one to WONTFIX