ChristianGaser / cat12

Computational Anatomy Toolbox for SPM12
https://neuro-jena.github.io/cat
GNU General Public License v2.0
32 stars 5 forks source link

Don't hardcode installation path of CAT12 to be inside toolbox directory #3

Closed gdevenyi closed 1 year ago

gdevenyi commented 2 years ago

The path to CAT12 is hard-coded to be inside the toolbox directory of the SPM12 installation: https://github.com/ChristianGaser/cat12/blob/main/spm_cat12.m#L43

But SPM12 allows modification of toolbox directory path via spm_get_defaults('tbx') it will iterate over all directories defined in the variable and load toolboxes there: https://github.com/neurodebian/spm12/blob/master/spm.m#L943-L977

I use this to install SPM toolboxes into lmod modules to provide proper versioning (see #2 for an improvement request there)

fullfile(fileparts(mfilename('fullpath'))) might be a better way to locate the installation path when CAT12 loads.

ChristianGaser commented 1 year ago

Thanks for the advice. I have changed all hardcoded paths.