Back to the main page.

Bug 2668 - ft_rejectvisual plots non-zero variance as zero

Status CLOSED FIXED
Reported 2014-08-05 11:40:00 +0200
Modified 2019-08-10 12:29:44 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P5 normal
Assigned to: Diego Lozano Soldevilla
URL:
Tags:
Depends on:
Blocks:
See also: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2625

- 2014-08-05 11:40:04 +0200

Created attachment 657 Plotting variance using ft_rejectvisual I have been using ft_rejectvisual to inspect and reject trials with variance that is too high (see code snippet below). However, since yesterday afternoon, visual output looks like there is zero variance in the data (see screenshot). In contrast, calculating the variance in MATLAB using var(data_clean{1}.trial{1}) shows that there is variance in the data. Have there been any relevant changes to ft_rejectvisual yesterday afternoon? cfg=[]; cfg.channel='MEG'; for i=1:15 data_clean{i}=ft_rejectvisual(cfg,data_clean{i}); end


Eelke Spaak - 2014-08-05 15:49:36 +0200

Diego, does this have something to do with your commit 9762 (https://code.google.com/p/fieldtrip/source/detail?r=9762)?


Diego Lozano Soldevilla - 2014-08-05 15:59:29 +0200

I was my bad. Now reverted Sending ft_rejectvisual.m Transmitting file data . Committed revision 9763.


Diego Lozano Soldevilla - 2014-08-05 16:34:38 +0200

(In reply to Diego Lozano Soldevilla from comment #2) Solved: Transmitting file data . Committed revision 9764. ft_rejectvisual has cfg.latency with options not available in ft_selectdata (but same field name): ft_rejectvisual: cfg.latency = [begin end] in seconds, or 'minperlength', 'maxperlength', % 'prestim', 'poststim' (default = 'maxperlength') ft_selectdata: % cfg.latency = scalar -> can be 'all', 'prestim', 'poststim' % cfg.latency = [beg end] I bypassed it by: orgcfg.latency = cfg.latency; tmpcfg = []; tmpcfg = keepfields(cfg, {'trials'}); data = ft_selectdata(tmpcfg, data); % restore the provenance information [cfg, data] = rollback_provenance(cfg, data); cfg.latency = orgcfg.latency;% restore the original latency, it should not be 'all' Sophie, could you please confirm my hunch?


- 2014-08-05 17:57:52 +0200

It seems to work fine now.


Robert Oostenveld - 2014-10-07 10:16:15 +0200

let me close this, since it has been resolved


Robert Oostenveld - 2014-10-07 10:16:31 +0200

let me close this, since it has been resolved


Robert Oostenveld - 2019-08-10 12:29:44 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue describing the issue on https://github.com/fieldtrip/fieldtrip/issues.