Closed ftadel closed 3 years ago
Hello,
I'll raise the question during our MEM meeting tomorrow morning. Personnally, i won't have time before early april.
Édouard
I copy here the list of other requests I posted on the forum: https://neuroimage.usc.edu/forums/t/issue-trying-to-compute-surces-wiht-mem-with-eeg-recordings/26910/2?u=francois
Hello @ftadel
fminunc
, the toolbox defaults to minFunc
(shipped with BEst) if license('test', 'Optimization_Toolbox')
returns false.Concerning the dependence to fminunc, the toolbox defaults to minFunc (shipped with BEst) if license('test', 'Optimization_Toolbox') returns false.
Wouldn't there be Matlab-only alternatives for the optimization functions you need? Maintaining MacOS mex files over the years can be painful. Including them in the compiled version of Brainstorm might be complicated too.
Hello @ftadel
minFunc
is in fact a MATLAB-only alternative but additionally uses by default MEX files for speeding things up.
I will be adding a parameter to the BEst panel so that users can choose to use or not this speedup feature (users can already choose between fminunc
and minFunc
with mincFunc
being automatically set if the optimization toolbox is not present).
Thanks
Concerning the dependence to fminunc, the toolbox defaults to minFunc (shipped with BEst) if license('test', 'Optimization_Toolbox') returns false.
This test doesn't work: it tests for what the license allows, not for what is installed on the computer. See what I get in my MATLAB install, which does not include the optimization tb:
>> license('test', 'Optimization_Toolbox')
ans =
1
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.10.0.1602886 (R2021a)
MATLAB License Number: 521249
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 19042)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.10 (R2021a)
Curve Fitting Toolbox Version 3.5.13 (R2021a)
Image Processing Toolbox Version 11.3 (R2021a)
MATLAB Compiler Version 8.2 (R2021a)
MATLAB Compiler SDK Version 6.10 (R2021a)
Parallel Computing Toolbox Version 7.4 (R2021a)
Signal Processing Toolbox Version 8.6 (R2021a)
Statistics and Machine Learning Toolbox Version 12.1 (R2021a)
Wavelet Toolbox Version 5.6 (R2021a)
You should replace this test with a much simpler:
if exist('fminunc', 'file')
minFunc is in fact a MATLAB-only alternative but additionally uses by default MEX files for speeding things up. I will be adding a parameter to the BEst panel so that users can choose to use or not this speedup feature (users can already choose between fminunc and minFunc with mincFunc being automatically set if the optimization toolbox is not present).
It would be great for the future compatibility of this library, thanks.
Hello @ftadel
Indeed, as you note, one may have a license for a toolbox but not have it installed and the test that you propose catches partially this case, and I agree that it should be added.
In addition, one may have a toolbox installed with no license to run its functions and the previous test with license(...)
catches this case.
I will be combining the two.
Thanks
It should be working now, both with the Matlab and the compiled versions of Brainstorm. Please test it and confirm that we can close this issue.
The work left to do includes only documentation:
Hello @ftadel, The tests were successful. @multifunkim is currently working on the tutorials. Thanks
@multifunkim @aliobaibk @YounesZ @klacourse
I added a new solution for managing the packages downloaded by Brainstorm:
It would be great if we could also move the BrainEntropy toolbox to this framework, in order to have everything managed in a centralized way. This will also allow to have automated builds including all the dependencies, to have the BE toolbox compiled with Brainstorm. Having the MEM included in the compiled distribution of Brainstorm has been requested recently on the forum: https://neuroimage.usc.edu/forums/t/best-toolbox-in-brainstorm-compiled-version/25898
Who could help me with this task? Maybe we could organize a short meeting to plan these changes?