diff --git a/README.md b/README.md index 80967101..debfb5b0 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,8 @@ initCppSpm ``` Please see our -[documentation](https://cpp_spm.readthedocs.io/en/latest/index.html) for -more detailed instructions. +[documentation](https://cpp_spm.readthedocs.io/en/latest/index.html) for more +detailed instructions. ### Dependencies @@ -76,7 +76,7 @@ For instructions see the following links: | ---------------------------------------------------------- | ------------ | | [Matlab](https://www.mathworks.com/products/matlab.html) | 20??? | | or [octave](https://www.gnu.org/software/octave/) | 4.? | -| [SPM12](https://www.fil.ion.ucl.ac.uk/spm/software/spm12/) | v7487 | +| [SPM12](https://www.fil.ion.ucl.ac.uk/spm/software/spm12/) | >7219 | @@ -109,8 +109,8 @@ This can perform: The core functions are in the `src` folder. Please see our -[documentation](https://cpp_spm.readthedocs.io/en/latest/index.html) for -more info. +[documentation](https://cpp_spm.readthedocs.io/en/latest/index.html) for more +info. ## Octave compatibility @@ -148,12 +148,14 @@ Constant are written in `UPPERCASE`. There is a [pre-commit hook](https://pre-commit.com/) that you can use to reformat files as you commit them. -Install pre-commit by using our `requirements.txt` file +Install pre-commit by using our `requirements.txt` file + ```bash pip install -r requirements.txt ``` Install the hook + ```bash pre-commit install ``` diff --git a/src/utils/checkDependencies.m b/src/utils/checkDependencies.m index dfb09d5b..cca7e2cb 100644 --- a/src/utils/checkDependencies.m +++ b/src/utils/checkDependencies.m @@ -13,22 +13,24 @@ function checkDependencies() fprintf('Checking dependencies\n'); SPM_main = 'SPM12'; - SPM_sub = '7487'; + SPM_sub = 7219; %% check spm version try [a, b] = spm('ver'); - fprintf(' Using %s %s\n', a, b); - if any(~[strcmp(a, SPM_main) strcmp(b, SPM_sub)]) - str = sprintf('%s %s %s.\n%s', ... - 'The current version SPM version is not', SPM_main, SPM_sub, ... - 'In case of problems (e.g json file related) consider updating.'); - warning(str); %#ok<*SPWRN> - end catch error('Failed to check the SPM version: Are you sure that SPM is in the matlab path?'); end + fprintf(' Using %s %s\n', a, b); + + if ~strcmp(a, SPM_main) || str2num(b) < 7219 + str = sprintf('%s %s %s.\n%s', ... + 'The current version SPM version is less than', SPM_main, SPM_sub, ... + 'Update with: spm_update update'); + warning(str); %#ok<*SPWRN> + end + spm('defaults', 'fmri'); %% Check the Nifti tools are indeed there.