|
1 |
| -# Installation |
| 1 | +# SPM Installation with MATLAB |
2 | 2 |
|
3 | 3 | !!! info "Prerequisites"
|
4 | 4 | The SPM software is a collection of [MATLAB](https://www.mathworks.com/products/matlab.html) functions and thus requires the MATLAB software to be installed on your computer in order to run. SPM requires only core MATLAB to run (no special toolboxes are required - unless stated otherwise).
|
5 | 5 |
|
6 | 6 | Each SPM version was written for a particular MATLAB version and will not work with earlier versions. MATLAB versions released after SPM can have some peculiarities but SPM developers try to provide compatibility fixes in the updates.
|
7 | 7 |
|
8 |
| -=== "Windows" |
| 8 | +## Installation |
9 | 9 |
|
10 |
| - ## Installation |
| 10 | +=== "Windows" |
11 | 11 |
|
12 | 12 | 1. Download `spm12.zip` from the [SPM website](https://www.fil.ion.ucl.ac.uk/spm/software/download/).
|
13 |
| - 2. Unzip spm12.zip in a folder of your choice, such as `C:\Users\login\Documents\MATLAB\spm12`. |
14 |
| - 3. Start MATLAB and add SPM into your path, either using: |
| 13 | + |
| 14 | + 2. Unzip `spm12.zip` in a folder of your choice, such as `C:\Users\login\Documents\MATLAB\spm12`. |
| 15 | + |
| 16 | + 3. Start MATLAB and add SPM to your path, either using: |
15 | 17 |
|
16 | 18 | `Home` :material-arrow-right-bold: `Set Path` :material-arrow-right-bold: `Add Folder...`: select the directory containing your SPM installation then click on `Save` and `Close`.
|
17 | 19 |
|
18 | 20 | or type the following at the MATLAB prompt:
|
19 | 21 |
|
20 | 22 | ```matlab
|
21 | 23 | addpath('C:\Users\login\Documents\MATLAB\spm12')
|
| 24 | + savepath % if you want to save the current MATLAB path |
22 | 25 | ```
|
23 | 26 |
|
24 |
| - !!! danger |
25 |
| - If using the graphical interface, make sure to use the `Add Folder...` button and not `Add with Subfolders...`. SPM will automatically add the appropriate subfolders to the MATLAB path. |
26 |
| - |
27 |
| - You can then launch SPM by typing `spm` at the MATLAB prompt. |
28 |
| - |
29 |
| - ## Update |
30 |
| - |
31 |
| - If you have just downloaded the `spm12.zip` archive, it already contains the latest set of updates. To update SPM when a new version is released: |
| 27 | + If you are using MATLAB without its desktop, you can open the Set Path dialog box by typing `pathtool` at the MATLAB prompt. |
32 | 28 |
|
33 |
| - 1. [Download `spm12_updates_rxxxx.zip`](https://www.fil.ion.ucl.ac.uk/spm/software/download/). |
34 |
| - 2. Uncompress `spm12_updates_rxxxx.zip` on top of the folder containing your SPM installation so that newer files overwrite existing files. |
35 |
| - |
36 |
| - Alternatively, you can use the `spm_update.m` function: |
37 |
| - |
38 |
| - ``` |
39 |
| - spm_update |
40 |
| - ``` |
41 |
| - |
42 |
| - If a new version is available, it can be applied to your local installation by typing: |
43 |
| - |
44 |
| - ``` |
45 |
| - spm_update update |
46 |
| - ``` |
47 |
| - |
48 |
| -=== "Mac" |
49 |
| - ## Installation |
| 29 | + !!! danger |
| 30 | + If using the graphical interface, make sure to use the `Add Folder...` button and not `Add with Subfolders...`. SPM will automatically add the appropriate subfolders to the MATLAB path at runtime. |
50 | 31 |
|
51 |
| - Mac Intel with 64bit MATLAB is a supported SPM platform. Precompiled MEX files (`*.mexmaci64`) are included in the SPM distribution. |
| 32 | +=== "macOS" |
52 | 33 |
|
53 |
| - 1. [Download `spm12.zip`](https://www.fil.ion.ucl.ac.uk/spm/software/download/) in your home directory. |
| 34 | + 1. [Download `spm12.zip` from the [SPM website](https://www.fil.ion.ucl.ac.uk/spm/software/download/) in your home directory. |
54 | 35 |
|
55 |
| - 2. Uncompress the archive by typing the following in a terminal: |
56 |
| - ``` |
57 |
| - cd /Users/login |
| 36 | + 2. Uncompress the archive by typing the following in a Terminal: |
| 37 | + ```bash |
| 38 | + cd /Users/<login> |
58 | 39 | unzip spm12.zip
|
59 | 40 | ```
|
60 | 41 |
|
61 | 42 | 3. Start MATLAB and add SPM to your path, either using:
|
62 | 43 | `File` :material-arrow-right-bold: `Set Path` :material-arrow-right-bold: `Add Folder...`
|
63 | 44 |
|
64 |
| - or typing: |
| 45 | + or typing the following at the MATLAB prompt: |
65 | 46 |
|
66 |
| - ``` |
| 47 | + ```matlab |
67 | 48 | addpath /Users/login/spm12
|
68 |
| - savepath |
| 49 | + savepath % if you want to save the current MATLAB path |
69 | 50 | ```
|
70 |
| - |
71 |
| - in MATLAB's workspace. |
72 | 51 |
|
73 | 52 | ??? failure "Troubleshooting"
|
74 | 53 | **macOS Catalina**
|
|
83 | 62 |
|
84 | 63 | Open a terminal, `cd` to the SPM directory and type:
|
85 | 64 |
|
86 |
| - ``` |
| 65 | + ```bash |
87 | 66 | find . -name "*.mexmaci64" -exec xattr -d com.apple.quarantine {} \;
|
88 | 67 | ```
|
89 | 68 |
|
|
99 | 78 |
|
100 | 79 | Open a terminal, and type the following whilst replacing `SPM_PATH` with the path of your spm installation:
|
101 | 80 |
|
102 |
| - ``` |
| 81 | + ```bash |
103 | 82 | sudo xattr -r -d com.apple.quarantine SPM_PATH
|
104 | 83 | sudo find SPM_PATH -name "*.mexmaci64" -exec spctl --add {} \;
|
105 | 84 | ```
|
|
112 | 91 |
|
113 | 92 | If you get an error message such as:
|
114 | 93 |
|
115 |
| - ``` |
| 94 | + ```bash |
116 | 95 | mex -O -c spm_vol_utils.c -DSPM_UNSIGNED_CHAR
|
117 |
| - mex: unrecognized option `-O' |
118 |
| - mex: unrecognized option `-c' |
| 96 | + mex: unrecognized option '-O' |
| 97 | + mex: unrecognized option '-c' |
119 | 98 | This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011)
|
120 | 99 | restricted \write18 enabled.
|
121 | 100 | entering extended mode
|
122 | 101 | (./spm_vol_utils.c
|
123 | 102 | This is MeX Version 1.05 18 XII 1993 (B. Jackowski & M. Ry\'cko)
|
124 |
| - ! You can't use `macro parameter character #' in vertical mode. |
| 103 | + ! You can't use 'macro parameter character #' in vertical mode. |
125 | 104 | ```
|
126 | 105 |
|
127 | 106 | This is due to a conflict between MATLAB mex and a LaTeX command with the same name. Edit `src/Makefile.var` and mention the full path when referring to MEXBIN.
|
128 | 107 |
|
129 |
| - ``` |
| 108 | + ```bash |
130 | 109 | MEXBIN = /Applications/MATLAB_R2012a.app/bin/mex
|
131 | 110 | ```
|
132 | 111 |
|
133 | 112 | or change PATH accordingly.
|
134 | 113 |
|
135 | 114 | === "Linux"
|
136 | 115 |
|
137 |
| - ## Installation |
138 |
| - |
139 |
| - 1. [Download `spm12.zip`](https://www.fil.ion.ucl.ac.uk/spm/software/download/) in your home directory. |
| 116 | + 1. Download `spm12.zip` from the [SPM website](https://www.fil.ion.ucl.ac.uk/spm/software/download/) in your home directory. |
140 | 117 |
|
141 | 118 | 2. Uncompress the archive by typing the following in a terminal:
|
142 | 119 |
|
143 |
| - ``` |
| 120 | + ```bash |
144 | 121 | cd /home/login
|
145 | 122 | unzip spm12.zip
|
146 | 123 | ```
|
|
149 | 126 |
|
150 | 127 | `File` :material-arrow-right-bold: `Set Path` :material-arrow-right-bold: `Add Folder...`
|
151 | 128 |
|
152 |
| - or typing: |
| 129 | + or typing the following at the MATLAB prompt: |
153 | 130 |
|
154 |
| - ``` |
| 131 | + ```matlab |
155 | 132 | addpath /home/login/spm12
|
| 133 | + savepath % if you want to save the current MATLAB path |
156 | 134 | ```
|
157 | 135 |
|
158 |
| - in MATLAB's workspace. |
| 136 | + |
| 137 | + |
| 138 | +You can then launch SPM by typing `spm` at the MATLAB prompt. |
| 139 | + |
| 140 | +## Update |
| 141 | + |
| 142 | +If you have just downloaded the `spm12.zip` archive, it already contains the latest set of updates. To update SPM when a new version is released: |
| 143 | + |
| 144 | +1. [Download `spm12_updates_rxxxx.zip`](https://www.fil.ion.ucl.ac.uk/spm/download/spm12_updates/). |
| 145 | +2. Uncompress `spm12_updates_rxxxx.zip` on top of the folder containing your SPM installation so that newer files overwrite existing files. |
| 146 | + |
| 147 | +Alternatively, you can use the `spm_update.m` function: |
| 148 | + |
| 149 | +```matlab |
| 150 | +spm_update |
| 151 | +``` |
| 152 | + |
| 153 | +If a new version is available, it can be applied to your local installation by typing: |
| 154 | + |
| 155 | +```matlab |
| 156 | +spm_update update |
| 157 | +``` |
0 commit comments