Back to the main page.
Bug 3093 - ft_artifact_zvalue>redraw_cb looks for cfg.datafile instead of the input data
Status | CLOSED FIXED |
Reported | 2016-03-09 23:50:00 +0100 |
Modified | 2016-06-14 16:14:47 +0200 |
Product: | FieldTrip |
Component: | core |
Version: | unspecified |
Hardware: | PC |
Operating System: | Windows |
Importance: | P5 normal |
Assigned to: | Robert Oostenveld |
URL: | |
Tags: | |
Depends on: | |
Blocks: | |
See also: |
Teresa Madsen - 2016-03-09 23:50:08 +0100
I am getting these error messages: Reference to non-existent field 'datafile'. Error in ft_artifact_zvalue>redraw_cb (line 906) data = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', trl(trlop,1), 'endsample', trl(trlop,2), 'chanindx', sgnind, 'checkboundary', strcmp(cfg.continuous,'no')); Error in ft_artifact_zvalue (line 498) redraw_cb(h); Error in FT_preprocFear_chunks_TEM (line 401) [~, artifact.thetafreq{t}] = ft_artifact_zvalue(cfg,data); The line where the error is thrown is under "else" for "if ~isempty(opt.data)" -- meaning it's trying to reload the data from the file when it can't find it in opt. Since I am including the data as an input to ft_artifact_zvalue, I'm not sure why it's not showing up in opt.data in this subfunction. Tracking it back into the main ft_artifact_zvalue function, I think this bit at line 478 could be the problem: if hasdata opt.data = {}; else opt.data = data; end Isn't that backwards? Adding a tilde to hasdata seems to fix it. Was this changed recently? I've only had this problem after downloading the latest version to troubleshoot another bug yesterday.
Robert Oostenveld - 2016-03-10 10:11:39 +0100
(In reply to Teresa Madsen from comment #0) Thanks for reporting. It has to do with https://github.com/fieldtrip/fieldtrip/commit/ce2c0806 related to http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3077 where I made a change to deal better with cfg.inputfile input. So actually there are three options to consider, where 3 was not working correctly on all MATLAB versions: 1) cfg.dataset 2) data provided as input arg 3) data read from cfg.inputfile I agree to your proposed solution. This should fix it: 130-229-40-210> git commit ft_artifact_zvalue.m [master 609bad9] FIX - hasdata should be ~hasdata, see http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3093 and thanks to Theresa 1 file changed, 1 insertion(+), 1 deletion(-) 130-229-40-210> git push upstream master X11 forwarding request failed on channel 0 You're about to push master, is that what you intended? [y|n] y Counting objects: 5, done. Delta compression using up to 4 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 382 bytes | 0 bytes/s, done. Total 3 (delta 2), reused 0 (delta 0) To git@github.com:fieldtrip/fieldtrip.git bf61f23..609bad9 master -> master