Back to the main page.
Bug 3026 - ft_preprocessing does not reject artifacts identified with ft_rejectartifact
Status | CLOSED FIXED |
Reported | 2015-12-14 22:28:00 +0100 |
Modified | 2019-08-10 12:32:44 +0200 |
Product: | FieldTrip |
Component: | preproc |
Version: | unspecified |
Hardware: | PC |
Operating System: | Mac OS |
Importance: | P5 normal |
Assigned to: | |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Arjen Stolk - 2015-12-14 22:28:09 +0100
%%% reject artifacts cfg.artfctdef.reject = 'complete'; cfg = ft_rejectartifact(cfg); %%% make directory, if needed, to save all analysis data if exist(outputdir) == 0 mkdir(outputdir) end %%% Preprocess and SAVE dataM = ft_preprocessing(cfg); Warning: The field cfg.trl is forbidden, it will be removed from your configuration The field cfg.dataset is forbidden, it will be removed from your configuration The field cfg.datafile is forbidden, it will be removed from your configuration The field cfg.headerfile is forbidden, it will be removed from your configuration > In ft_checkconfig (line 221) In ft_preprocessing (line 267) In preproc_tcg (line 74) ... and does not reject the artifacts. The cause likely resides in the removal of the trl field by ft_preprocessing which is where the to-be-kept trials are stored (and thus to-be-removed trials are excluded from, as done by ft_rejectartifact).
Arjen Stolk - 2015-12-14 22:28:58 +0100
(In reply to Arjen Stolk from comment #0) The source of that code snippet: http://www.fieldtriptoolbox.org/tutorial/scripting
Robert Oostenveld - 2015-12-15 08:46:17 +0100
(In reply to Arjen Stolk from comment #1) line 267 applies in the case of "hasdata", which is set at line 254 as hasdata = exist('data', 'var'); it is unclear to me where that variable comes from. Did you specify cfg.inputfile, causing "ft_preamble loadvar data" to read the data? If so, cfg.trl does rightfully not apply.
Arjen Stolk - 2015-12-15 15:10:26 +0100
No cfg.inputfile, but i may have used cfg.dataset. Would that cause the same behavior? On the airport right now, will check when back.
Arjen Stolk - 2016-01-02 05:14:33 +0100
(In reply to Arjen Stolk from comment #3) Did you fix this already? It seems hasdata = exist('data', 'var'); now throws a zero under the same circumstances. As a result, the cfg.trl is no longer forbidden. Considering this fixed.