Back to the main page.

Bug 3226 - ft_preprocessing gives error "Reference to non-existent field 'checkmaxfilter'."

Reported 2016-12-20 15:35:00 +0100
Modified 2016-12-21 10:28:36 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Linux
Importance: P5 blocker
Assigned to: Pim Mostert
Depends on:
See also:

Pim Mostert - 2016-12-20 15:35:21 +0100

My script that worked this morning, stopped working just now. The function ft_preprocessing gives me this weird error, which it did not before. I saw on Github that Robert changed the file ft_preprocessing: - hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat, 'coordsys', cfg.coordsys, 'coilaccuracy', cfg.coilaccuracy); + hdr = ft_read_header(cfg.headerfile, 'headerformat', cfg.headerformat, 'coordsys', cfg.coordsys, 'coilaccuracy', cfg.coilaccuracy, 'checkmaxfilter', istrue(cfg.checkmaxfilter)); Is it possible that you perhaps overlooked something in your thought process? :) Or would you perhaps have a suggestion for a quick workaround? Thanks!

Jan-Mathijs Schoffelen - 2016-12-21 09:11:23 +0100

what about initializing cfg.checkmaxfilter in ft_read_header, as per cfg.checkmaxfilter = ft_getopt(cfg, 'checkmaxfilter', false); @Pim: I suggest to try and fix it yourself, using the recommended procedure on the wiki. This would perhaps help you across the first hurdle to try and contribute things yourself :o). The idea would be to create a clone of the fieldtrip github repository in your home-dir, which from then on will be the FT-version you can use on a daily basis. If you make changes in that directory, you can push it to your fork on github, and by means of a pull request beneficial changes can end up in the master branch, for everybody to use. The recipe is documented here:

Robert Oostenveld - 2016-12-21 10:16:45 +0100

I feel guilty and ambivalent: I Introduced the bug, so I am to blame. But I also agree with JM that it would be good for Pim to use git (as it is soooo easy and fast!) In this case I will fix it so that others don't suffer, but will leave a trace to be fixed by Pim...

Robert Oostenveld - 2016-12-21 10:27:07 +0100

mac011> git status On branch master mac011> git pull upstream master mac011> git checkout -b bug3226 Switched to a new branch 'bug3226' mac011> vi ft_preprocessing.m >>> made changes mac011> git commit ft_preprocessing.m [bug3226 cd86d74] FIX 3266 - add empty default for checkmaxfilter, see Also added a line for Pim to remove. 1 file changed, 14 insertions(+), 11 deletions(-) mac011> git push fatal: The current branch bug3226 has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin bug3226 >>> here I always look up the exact command mac011> git push --set-upstream origin bug3226 Then I go to and click the "Compare & pull request" button. This results in and an email to Jan-Mathijs and me, which we then follow up. We review the suggested change, and click "merge".

Robert Oostenveld - 2016-12-21 10:28:36 +0100

I have merged the pull request. There is still a line of comment in the code that contains "THIS LINE SHOULD BE REMOVED BY PIM". I will assign the bug to Pim for further fixing.