Hi Stephen,
the reason for toolboxes to add their path is that the SPM5/8 batch
system doesn't use the SPM2 style dropdown menu to invoke a toolbox.
Instead, toolboxes that have their own config files can be integrated
into any SPM processing pipeline. This requires that the toolbox .m
files can be found by MATLAB, even if the toolbox doesn't have its own
GUI or the toolbox GUI has not been opened. Most toolboxes (at least
their most recent versions) should be aware of the problems of name
collisions.
Hope this helps,
Volkmar
Am Montag, den 02.02.2009, 12:47 +0000 schrieb Stephen J. Fromm:
> On Sun, 1 Feb 2009 20:32:37 -0600, Darren Gitelman
> <[log in to unmask]> wrote:
>
> >Stephen
> >
> >You are correct. Any toolboxes that are available through the batch system
> >and use xx_config_yy files are added to the path at the time SPM is started.
> >See spm_config.m around line 259.
>
> Right, I saw that line of code.
>
> However, as far as I can tell that's not how SPM originally dealt with
> toolboxes. spm.m has code which adds the toolbox to the matlabpath upon
> its selection from the dropdown menu.
>
> That's the way SPM2 apparently dealt with it. For SPM5, some toolboxes do it
> that way; others do it through spm_config.m.
>
> Adding paths without the users having selected the toolbox can lead to
> unwanted name collisions. There's already one example of that, the VBM5
> toolbox with spm_getSPM, spm_list, and spm_results_ui.
> >-----
> >Darren Gitelman
> >
> >
> >On Sun, Feb 1, 2009 at 7:22 PM, Stephen J. Fromm
> <[log in to unmask]>wrote:
> >
> >> I noticed that in my most recent copy of SPM5 and its updates, many
> >> toolboxes were adding themselves to the matlab path after I started SPM
> and
> >> pushed the "fMRI" button. (Equivalently, after I started SPM by typing spm
> >> ('fmri') in matlab.)
> >>
> >> For a toolbox named "X", the line that caused this was in the file
> >> .../toolbox/X/spm_config_x.m
> >> and the line is of the form
> >> addpath(fullfile(spm('dir'),'toolbox','X'));
> >>
> >> My impression is that that line shouldn't be there, and it seems that
> >> that's the
> >> line that puts the toolboxes in the matlab path even before any toolbox has
> >> been selected using the menu on the main SPM5 window.
> >>
> >
>
--
Volkmar Glauche
-
Department of Neurology [log in to unmask]
Universitaetsklinikum Freiburg Phone 49(0)761-270-5331
Breisacher Str. 64 Fax 49(0)761-270-5416
79106 Freiburg http://fbi.uniklinik-freiburg.de/
|