Skip to content

Commit 5a637be

Browse files
committed
Expand git section
1 parent 1d7bbd0 commit 5a637be

File tree

9 files changed

+61
-49
lines changed

9 files changed

+61
-49
lines changed
8.39 KB
Loading

docs/assets/figures/git_config.png

13.5 KB
Loading

docs/development/git.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ The instructions to set your commit name and email address in GitHub Desktop are
5959

6060
* [Configuring your global author information](https://docs.github.com/en/desktop/installing-and-configuring-github-desktop/configuring-and-customizing-github-desktop/configuring-git-for-github-desktop#configuring-your-global-author-information)
6161

62+
<figure markdown>
63+
![Git configuration](../assets/figures/git_config.png)
64+
<figcaption>Specify your commit name and email address in GitHub Desktop.</figcaption>
65+
</figure>
66+
6267
The command line equivalent is:
6368

6469
```
@@ -94,7 +99,12 @@ To apply this setting from GitHub Desktop, you need to open the command prompt b
9499

95100
## Clone the SPM repository
96101

97-
Follow [these instructions](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/adding-and-cloning-repositories/cloning-a-repository-from-github-to-github-desktop) with the SPM repository: https://github/spm/spm
102+
Follow [these instructions](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/adding-and-cloning-repositories/cloning-a-repository-from-github-to-github-desktop) with the SPM repository: [https://github/spm/spm](https://github/spm/spm)
103+
104+
<figure markdown>
105+
![Git clone](../assets/figures/git_clone_repo.png)
106+
<figcaption>Clone the SPM repository from its GitHub URL.</figcaption>
107+
</figure>
98108

99109
From the command line, the equivalent is:
100110

@@ -104,7 +114,20 @@ git clone [email protected]:spm/spm.git
104114

105115
## Git Commits
106116

107-
### Log Messages
117+
After editing some files in the `main` branch, select the changes to include in a commit, write a commit message and push the changes to `origin`:
118+
119+
* [Making changes](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/making-changes-in-a-branch/committing-and-reviewing-changes-to-your-project#selecting-changes-to-include-in-a-commit)
120+
121+
From the command line, this is obtained with:
122+
123+
```
124+
git add spm_example.m
125+
git commit -m "<commit message>"
126+
```
127+
128+
Ideally, "each commit should be a perfect, atomic unit of change". Do commit related changes, commit often but don't commit half-done work (use branch or stash instead).
129+
130+
### Commit Messages
108131

109132
Use the imperative and prefix the commit message with one of:
110133

@@ -114,6 +137,18 @@ Use the imperative and prefix the commit message with one of:
114137
* ++"Documentation"++
115138
* ++"Refactoring"++
116139

140+
You should be able to suffix a commit message to the phrase "If applied, this code will ...".
141+
142+
Commit messages should begin with a short summary of the changes (up to 70 characters) followed by a blank line and the body text, i.e.:
143+
144+
```
145+
Enhancement: replace this with that in such and such
146+
147+
Longer description that might contain bullet points:
148+
* item 1
149+
* item 2
150+
```
151+
117152
## Git Workflow
118153

119154
We are using a [Centralised Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows#centralized-workflow). This is also called [Trunk Based Development](https://trunkbaseddevelopment.com/) (see this [article](https://medium.com/@mattia.battiston/why-i-love-trunk-based-development-641fcf0b94a0) for a discussion). Popular other workflows include [GitHub Flow](https://githubflow.github.io/) and [Gitflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow).
@@ -122,7 +157,6 @@ We are using a [Centralised Workflow](https://www.atlassian.com/git/tutorials/co
122157

123158
Recommendation for pull request reviewers: When merging, we generally like `squash+merge`. Unless it is the rare case of a PR with carefully staged individual commits that you want in the history separately, in which case `merge` is acceptable, but usually prefer `squash+merge`.
124159

125-
126160
## References
127161

128162
* [Dangit, Git!?!](https://dangitgit.com/)

docs/installation.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44
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).
55

66
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-
8-
[GNU Octave](https://www.octave.org/) is a free open-source numerical analysis software similar to MATLAB. See SPM/Octave for more details about compatibility between SPM and Octave.
97

108
=== "Windows"
119

1210
## Installation
1311

14-
1. Download spm12.zip.
12+
1. Download `spm12.zip` from the [SPM website](https://www.fil.ion.ucl.ac.uk/spm/software/download/).
1513
2. Unzip spm12.zip in a folder of your choice, such as `C:\Users\login\Documents\MATLAB\spm12`.
1614
3. Start MATLAB and add SPM into your path, either using:
1715

@@ -51,13 +49,12 @@
5149

5250
Mac Intel with 64bit MATLAB is a supported SPM platform. Precompiled MEX files (`*.mexmaci64`) are included in the SPM distribution.
5351

54-
1. [Download `spm12.zip`](https://www.fil.ion.ucl.ac.uk/spm/software/download/) and its updates `spm12_updates_rxxxx.zip` in your home directory.
52+
1. [Download `spm12.zip`](https://www.fil.ion.ucl.ac.uk/spm/software/download/) in your home directory.
5553

5654
2. Uncompress the archive by typing the following in a terminal:
5755
```
5856
cd /Users/login
5957
unzip spm12.zip
60-
unzip -o spm12_updates_rxxxx.zip -d spm12
6158
```
6259

6360
3. Start MATLAB and add SPM to your path, either using:
@@ -138,14 +135,13 @@
138135

139136
## Installation
140137

141-
1. Download `spm12.zip` and its updates `spm12_updates_rxxxx.zip` in your home directory.
138+
1. [Download `spm12.zip`](https://www.fil.ion.ucl.ac.uk/spm/software/download/) in your home directory.
142139

143140
2. Uncompress the archive by typing the following in a terminal:
144141

145142
```
146143
cd /home/login
147144
unzip spm12.zip
148-
unzip -o spm12_updates_rxxxx.zip -d spm12
149145
```
150146

151147
3. Start MATLAB and add SPM into your path, either using:

docs/tutorials/fmri_preprocessing/normalisation.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,11 @@ Normalisation refers to bringing your data into a standard template space to all
99

1010
For a thorough overview of issues related to normalisation, see the SPM book:
1111

12-
[Penny, W., Friston, K., Ashburner, J., Kiebel, S., & Nichols, T. (2006). *Statistical parametric mapping: The analysis of functional brain images* (1st ed.).](http://www.elsevierdirect.com/product.jsp?isbn=9780123725608&srccode=89660)
12+
[Penny, W., Friston, K., Ashburner, J., Kiebel, S., & Nichols, T. (2006). *Statistical parametric mapping: The analysis of functional brain images*.](https://www.fil.ion.ucl.ac.uk/spm/doc/#books)
1313

1414
And other readings:
1515

16-
[Brett, M., Johnsrude, I. S., & Owen, A. M. (2002). The problem of functional localization in the human brain. *Nature Reviews Neuroscience, 3*(3), 243-249.](https://doi.org/10.1038/nrn756)
17-
18-
[Jenkinson, M. & Chappell, M. (2018). *Introduction to neuroimaging analysis*. Oxford University Press.](http://www.neuroimagingprimers.org/examples/introduction-primer-example-boxes/)
19-
20-
[Poldrack, R. A., Mumford, J. A., & Nichols, T. E. (2011). *Handbook of functional MRI data analysis*. Cambridge University Press.](https://www.cambridge.org/core/books/handbook-of-functional-mri-data-analysis/8EDF966C65811FCCC306F7C916228529)
16+
[Ashburner, J. and Firston, K.J. (2005) *Unified segmentation*.](https://doi.org/10.1016/j.neuroimage.2005.02.018)
2117

2218
1. From the SPM menu panel, select `Normalise (Write)`. You will see a pop-up window appear looking like this:
2319

docs/tutorials/fmri_preprocessing/realignment.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@ Realignment refers to correcting the functional data for movement that has occur
99

1010
For a thorough overview of issues related to motion in fMRI, see the SPM book:
1111

12-
[Penny, W., Friston, K., Ashburner, J., Kiebel, S., & Nichols, T. (2006). *Statistical parametric mapping: The analysis of functional brain images* (1st ed.).](http://www.elsevierdirect.com/product.jsp?isbn=9780123725608&srccode=89660)
13-
14-
And other readings:
15-
16-
[Jenkinson, M. & Chappell, M. (2018). *Introduction to neuroimaging analysis*. Oxford University Press.](http://www.neuroimagingprimers.org/examples/introduction-primer-example-boxes/)
17-
18-
[Poldrack, R. A., Mumford, J. A., & Nichols, T. E. (2011). *Handbook of functional MRI data analysis*. Cambridge University Press.](https://www.cambridge.org/core/books/handbook-of-functional-mri-data-analysis/8EDF966C65811FCCC306F7C916228529)
12+
[Penny, W., Friston, K., Ashburner, J., Kiebel, S., & Nichols, T. (2006). *Statistical parametric mapping: The analysis of functional brain images*.](https://www.fil.ion.ucl.ac.uk/spm/doc/#books)
1913

2014
1. From the SPM menu panel, select `Realign (Estimate & Reslice)`. You will see a pop-up window appear looking like this:
2115

docs/tutorials/fmri_preprocessing/slice_timing.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ Slice timing correction aims to account for the differences in timing of data ac
1717

1818
For a thorough overview of issues related to slice timing in fMRI, see the SPM book:
1919

20-
[Penny, W., Friston, K., Ashburner, J., Kiebel, S., & Nichols, T. (2006). *Statistical parametric mapping: The analysis of functional brain images* (1st ed.).](http://www.elsevierdirect.com/product.jsp?isbn=9780123725608&srccode=89660)
20+
[Penny, W., Friston, K., Ashburner, J., Kiebel, S., & Nichols, T. (2006). *Statistical parametric mapping: The analysis of functional brain images*.](https://www.fil.ion.ucl.ac.uk/spm/doc/#books)
2121

2222
And other readings:
2323

24-
[Jenkinson, M. & Chappell, M. (2018). *Introduction to neuroimaging analysis*. Oxford University Press.](http://www.neuroimagingprimers.org/examples/introduction-primer-example-boxes/)
25-
26-
[Poldrack, R. A., Mumford, J. A., & Nichols, T. E. (2011). *Handbook of functional MRI data analysis*. Cambridge University Press.](https://www.cambridge.org/core/books/handbook-of-functional-mri-data-analysis/8EDF966C65811FCCC306F7C916228529)
24+
[Sladky, R., Friston, K.j., Trostl J., Cunnington, R., Moser, E, Windischberger, C. (2011). *Slice-timing effects and their correction in functional MRI*.](https://doi.org/10.1016/j.neuroimage.2011.06.078)
2725

2826
??? info "When to use slice timing correction?"
2927
* Slice timing can be done on any fMRI data but it is particularly beneficial for studies with **longer TRs** (i.e. >2s). For studies with shorter TRs (≤2s), temporal derivative may be a better option.

docs/tutorials/fmri_preprocessing/smoothing.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@ Smoothing is the process of averaging the signal in each voxel with a weighted a
99

1010
For a thorough overview of issues related to smoothing, see the SPM book:
1111

12-
[Penny, W., Friston, K., Ashburner, J., Kiebel, S., & Nichols, T. (2006). *Statistical parametric mapping: The analysis of functional brain images* (1st ed.).](http://www.elsevierdirect.com/product.jsp?isbn=9780123725608&srccode=89660)
13-
14-
And other readings:
15-
16-
[Jenkinson, M. & Chappell, M. (2018). *Introduction to neuroimaging analysis*. Oxford University Press.](http://www.neuroimagingprimers.org/examples/introduction-primer-example-boxes/)
17-
18-
[Poldrack, R. A., Mumford, J. A., & Nichols, T. E. (2011). *Handbook of functional MRI data analysis*. Cambridge University Press.](https://www.cambridge.org/core/books/handbook-of-functional-mri-data-analysis/8EDF966C65811FCCC306F7C916228529)
12+
[Penny, W., Friston, K., Ashburner, J., Kiebel, S., & Nichols, T. (2006). *Statistical parametric mapping: The analysis of functional brain images*.](https://www.fil.ion.ucl.ac.uk/spm/doc/#books)
1913

2014
1. From the SPM menu panel, select `Smooth`. You will see a pop-up window appear looking like this:
2115

docs/tutorials/fmri_preprocessing/visual_inspection.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
Let's take a look at the structure of the data you [downloaded](https://www.fil.ion.ucl.ac.uk/spm/download/data/MoAEpilot/MoAEpilot.bids.zip). The data is organised following [BIDS](https://bids.neuroimaging.io/) - a standardised format for organising and naming neuroimaging files, and looks like this:
66

77
```
8-
MoAEpilot/
9-
CHANGES
10-
dataset_description.json
11-
README
12-
sub-01/
13-
anat/
14-
sub-01_T1w.nii
15-
func/
16-
sub-01_task-auditory_bold.nii
17-
sub-01_task-auditory_events.tsv
18-
task-auditory_bold.json
8+
MoAEpilot
9+
├── CHANGES
10+
├── dataset_description.json
11+
├── README
12+
├── sub-01
13+
│   ├── anat
14+
│   │   └── sub-01_T1w.nii
15+
│   └── func
16+
│   ├── sub-01_task-auditory_bold.nii
17+
│   └── sub-01_task-auditory_events.tsv
18+
└── task-auditory_bold.json
1919
```
2020

2121
Inside the folder containing the Mother of All Experiments (MoAE) data, you can find `CHANGES`, `dataset_description.json`, `README` and `task-auditory_bold.json` files - these files contain meta-data about the study. The subject directory, `sub-01`, contains `anat` and `func` folders, which store anatomical and functional images, respectively. Additionally, onset timings for task data are stored in the `func` folder alongside task images.
@@ -28,13 +28,13 @@ We will first look at the anatomical image `sub-01_T1w.nii` stored in `sub-01/an
2828

2929
From your terminal or Matlab window open SPM by typing:
3030

31-
```
31+
```matlab
3232
spm fmri
3333
```
3434

3535
or:
3636

37-
```
37+
```matlab
3838
spm
3939
```
4040

@@ -43,8 +43,8 @@ and selecting `fMRI` in the SPM window.
4343
To view an image, click on `Display` from the SPM menu and select the image you want to inspect from the pop-up window. The selected image will now be shown in the SPM graphics window.
4444

4545
!!! tip "File extensions"
46-
SPM can read read files in the Analyze format (`.hdr`/`.img`) and uncompressed NIFTI files (`.nii`). If your files are compressed and end in `.gz`, make sure to uncompress them first, e.g.:
47-
```
46+
SPM can read uncompressed NIfTI files in single (`.nii`) and dual (`.hdr`/`.img`) formats. If your files are compressed with `gzip` and end in `.gz`, make sure to uncompress them first, e.g.:
47+
```matlab
4848
gunzip your_file.nii.gz
4949
```
5050

0 commit comments

Comments
 (0)