Back to the main page.

Bug 2194 - enhancement: allow ft_databrowser to mark entire trial as artifact with single keystroke

Reported 2013-06-10 14:21:00 +0200
Modified 2021-09-16 14:06:42 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 enhancement
Assigned to:
Depends on:
Blocks: 2314
See also:

Jim Herring - 2013-06-10 14:21:26 +0200

I've noticed that browsing through my own data for visual artifact rejection I spend the most time selecting a time range and clicking it to mark it for rejection (since I have about 1800 trials per subject to go through, it adds up). As I wish to completely reject the marked trial, having a single keyboard button to select the entire trial would greatly speed-up this process. For my local copy of FieldTrip I've modified ft_databrowser to mark the entire trial when the 'a'-key is pressed (a for artifact ;) ). I've added the following lines (copied,pasted and slightly modified from the segment that handles selecting and marking time-ranges with the mouse): case 'a' % select complete trial begsample = opt.trlvis(opt.trlop,1); endsample = opt.trlvis(opt.trlop,2); artval = opt.artdata.trial{1}(opt.ftsel, begsample:endsample); artval = any(artval,1); if any(artval) fprintf('there is overlap with the active artifact (%s), disabling this artifact\n',opt.artdata.label{opt.ftsel}); opt.artdata.trial{1}(opt.ftsel, begsample:endsample) = 0; else fprintf('there is no overlap with the active artifact (%s), marking this as a new artifact\n',opt.artdata.label{opt.ftsel}); opt.artdata.trial{1}(opt.ftsel, begsample:endsample) = 1; end % redraw only when marking (so the focus doesn't go back to the databrowser after calling selfuns setappdata(h, 'opt', opt); setappdata(h, 'cfg', cfg); redraw_cb(h);

Jörn M. Horschig - 2013-06-10 14:42:06 +0200

a bit offtopic: for that purpose, ft_rejectvisual in channel viewmode might be better suited (if you click on a trial, it gets marked as bad)

Jan-Mathijs Schoffelen - 2021-09-16 14:06:42 +0200

wontfix, given Jorn's comment, and given that there was no incentive to revisit this for the last 8 years or so.