Plugin installation

I ran into a few issues with the plugins recently.

  1. In Matlab 2021b, I get this error:
websave and urlwrite failed reading URL: ...
Error using websave (line 95)
The 'ftp' protocol ... is not supported.
  1. Would it be possible to allow updating when the installation folder is not the default one?

  2. Also, somehow Brainstorm often chooses to load spm8 (/usr/local/spm8), even if I did the default spm12 installation from Brainstorm previously.

  3. It would also be nice to allow the default install even if it was previously custom installed, perhaps when the toolbox is unloaded. Right now, we have to select an invalid custom installation directory to have the option to do the default install again.

In Matlab 2021b, I get this error:

Now the support of Java is more and more removed from Matlab, we're going to lose existing functionalities. They are progressively replaced by Matlab functions, but this requires we add extra tests everywhere to handle different Matlab versions.

I added a direct FTP download for 2021b, just like I did for bst_webread, you shouldn't get this error anymore: Bugfix: Added FTP download to bst_websave for Matlab 2021b · brainstorm-tools/brainstorm3@0482142 · GitHub

Would it be possible to allow updating when the installation folder is not the default one?

In many configurations, Brainstorm would not have the access rights to the file systems. And most of all, it would be too dangerous to have Brainstorm deleting folders outside of its sandbox. We have a history of deleted desktops, we don't want this to happen ever again. And this would happen if the spm.m is on the desktop and we allow brainstorm to delete the parent folder.
Either you let Brainstorm do its thing (automatically and safely), or you do it yourself (consciously and dangerously).

Also, somehow Brainstorm often chooses to load spm8 (/usr/local/spm8), even if I did the default spm12 installation from Brainstorm previously.

This is because the SPM8 folder is in the path, therefore spm.m is found, and identified as the SPM install. Remove the SPM8 folder from your Matlab path before starting Brainstorm.

It would also be nice to allow the default install even if it was previously custom installed, perhaps when the toolbox is unloaded

Indeed, but not when the toolbox is unloaded.
We want to keep track of local installs even when they are not loaded, mostly because of plugin incompatibilities that require to load/unload them several times in a row (eg. SPM+FieldTrip).

I added a button "Ignore local installation", which is in fact only a shortcut to setting an invalid path with "Custom install > Select installation folder", but much more satisfying in terms of interface.
Plugins: Added menu: Ignore local installation · brainstorm-tools/brainstorm3@67141ff · GitHub

Does this work for you?

Yes thanks!

Turns out spm8 is being added to my Matlab path every time I start. I still have to figure out how.

At the BIC it's addded through the environment variable: MATLABPATH

The SPM8 path is added by /etc/profile.d/spm8.sh

1 Like

Wouldn't it be useful to have an checkbox option in Preferences to "Ignore the local Plugin installations"?
(with default False)

Maybe call it "ignore custom installation" since that's what it's called in the menu, and both are "local", so it could be confusing.

@Raymundo.Cassani I'm not sure a preference option would help since this is more of a per-plugin setup. It does make sense to mark something already on the Matlab path as "loaded". We should update our workstation setup at the BIC (already on it).

I was thinking in this option as a way to ensure that Brainstorm uses only plugins that were installed through it.

I vote for keeping it simple for the moment (ie. not do anything more).
Advanced Matlab users working with multiple toolboxes simultaneously are capable of managing their path themselves, and it could be annoying to them to have one program that messes up their path.
Real beginners would only be using Brainstorm, and therefore would not have any problem.