-
Notifications
You must be signed in to change notification settings - Fork 714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
identify channel breaks ft_databrowser on apple silicon (m3) #2421
Comments
what happens if you directly type
in your MATLAB command window? I would expect a number to be returned... on my computer it returns 10. |
uhm, but doesn't this mean that the ft_getopt function is generically not robust when there are key-value pairs like this: {'bla1', somevalue, 'bla2', someothervalue} and that this is the case for the *.m version of the file, and not for the compiled ones (and since there's not yet a mexmaca64 version you noticed it...? |
@EceKayaMPI could you execute the https://github.com/fieldtrip/fieldtrip/blob/master/test/test_ft_getopt.m script and see whether that works for you? We have not tested extensively yet on apple silicon but it would be good to know whether our test script misses anything. I do now have a Mac M3 and will install MATLAB asap to execute all tests. |
Yes, I modified the ft_getopt.m file, and the original version did have the issue while checking other properties like font units, etc. @robertoostenveld I executed the test script and it ran without errors :) |
Did it run without errors with the original version of ft_getopt, or only after you made the changes? |
Ah, I now see that the error that was reported is actually due to
having the FontSize and FontUnits options both twice. That is incorrect usage, so ft_getopt is actually right in throwing an error. The error should therefore first of all be solved in ft_databrowser. Subsequently we have to improve the test script. Apparently the m-file version is stricter (and better) in checking the incorrect use than the mex-file version. |
The issue is now only partially resolved, as we should improve the mex files implementation. Giving the same option twice is incorrect and unclear usage of ft_getopt. When you do
you could expect it to return
it is ambiguous. Hence passing the same key twice in the cell-array should not be allowed. With structure input arguments (like cfg) this problem cannot apply. |
the https://github.com/fieldtrip/fieldtrip/blob/master/test/test_ft_getopt.m script ran without problems, using the unmodified getopt function |
…es (correct) error in ft_getopt. Thanks to @EceKayaMPI for reporting.
The bug
I simply try to identify a noisy channel in the databrowser, right after loading the data.
`cfg = [];
cfg.dataset = 'subj_1.eeg';
cfg.continuous = 'yes';
data = ft_preprocessing(cfg);
cfg = [];
ft_databrowser(cfg,data)`
I can see the data, and all functions of the databrowser seem to work, except when I use the 'identify channel' in I get the following error, and databrowser stops working:
click in the figure to identify the name of the closest channel
identified channel name: PO10
Error using ft_getopt
multiple input arguments with the same name
Error in ft_plot_text (line 67)
fontsize = ft_getopt(varargin, 'fontsize', get(0, 'defaulttextfontsize'));
Error in ft_databrowser>keypress_cb (line 1678)
ft_plot_text(xpos, ypos, label, 'FontSize', cfg.fontsize, 'FontUnits', cfg.fontunits, 'tag', 'identifiedchannel', 'FontSize', cfg.fontsize, 'FontUnits', cfg.fontunits);
Error while evaluating Figure KeyPressFcn.
Importantly, I don't get this error on my older MacBook (intel processor) with same fieldtrip version.
Environment and versions:
The text was updated successfully, but these errors were encountered: