Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 |

<!-- lint enable -->

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
```
Expand Down
18 changes: 10 additions & 8 deletions src/utils/checkDependencies.m
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down