You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure that the following toolboxes are installed and added to the matlab path.
@@ -38,6 +43,7 @@ For instructions see the following links:
38
43
39
44
For simplicity the NIfTI tools toolbox has been added to this repo in the `subfun` folder.
40
45
46
+
41
47
## General description
42
48
43
49
This set of function will read and unzip the data from a [BIDS data set](https://bids.neuroimaging.io/). It will then perform:
@@ -53,19 +59,21 @@ It can also prepare the data to run an MVPA analysis by running a GLM for each s
53
59
54
60
The core functions are in the sub-function folder `subfun`
55
61
62
+
56
63
## Assumption
57
64
58
65
At the moment this pipeline makes some assumptions:
59
66
- it assumes that the dummy scans have been removed from the BIDS data set and it can jump straight into pre-processing,
60
67
- it assumes the metadata for a given task are the same as those the first run of the first subject this pipeline is being run on,
61
68
- it assumes that group are defined in the subject field (eg `sub-ctrl01`, `sub-blind01`, ...) and not in the `participants.tsv` file.
62
69
70
+
63
71
## Setting up
64
72
65
73
### getOptions
66
74
67
75
68
-
All the details specific to your analysis should be set in the `getOptions.m`.
76
+
All the details specific to your analysis should be set in the `getOptions.m`. There is a getOption_template file that shows you would set up the getOption file if one wanted to analyse the [ds001 data set from OpenNeuro](https://openneuro.org/datasets/ds000001/versions/57fecb0ccce88d000ac17538).
69
77
70
78
Set the group of subjects to analyze.
71
79
```
@@ -102,6 +110,7 @@ The directory where your files are located on your computer: make sure you have
102
110
103
111
Some more SPM options can be set in the `spm_my_defaults.m`.
104
112
113
+
105
114
### model JSON files
106
115
This files allow you to specify which contrasts to run and follow the BIDS statistical model extension and as implement by [fitlins](https://fitlins.readthedocs.io/en/latest/model.html)
107
116
@@ -153,47 +162,51 @@ In brief this means:
153
162
- at the subject level automatically compute the t contrast against baseline for the condition `motion`and `static` and compute the t-contrats for motion VS static with these given weights.
154
163
- at the level of the data set (so RFX) do the t contrast of the `motion`, `static`, `motion VS static`.
155
164
165
+
We are currently using this to run different subject level GLM models for our univariate and multivariate analysis where in the first one we compute a con image that averages the beta image of all the runs where as in the latter case we get one con image for each run.
166
+
156
167
157
168
## Order of the analysis
158
169
159
170
1.__Remove Dummy Scans__:
160
-
Unzip bold files and removes dummy scans by running the script (to be run even if `opt.numDummies` set to `0`):
161
-
`BIDS_rmDummies.m`
171
+
Unzip bold files and removes dummy scans by running the script (to be run even if `opt.numDummies` set to `0`): `BIDS_rmDummies.m`
172
+
173
+
2.__Slice Time Correction__: Performs Slice Time Correction (STC) of the functional volumes by running the script: `BIDS_STC.m`
162
174
163
-
2.__Slice Time Correction__: Performs Slice Time Correction (STC) of the functional volumes by running the script:
164
-
`BIDS_STC.m`
165
175
STC will be performed using the information provided in the BIDS data set. It will use the mid-volume acquisition time point as as reference.
176
+
166
177
The `getOption.m` fields related to STC can still be used to do some slice timing correction even no information is can be found in the BIDS data set.
178
+
167
179
In general slice order and reference slice is entered in time unit (ms) (this is the BIDS way of doing things) instead of the slice index of the reference slice (the "SPM" way of doing things).
180
+
168
181
More info available on this page of the [SPM wikibook](https://en.wikibooks.org/wiki/SPM/Slice_Timing).
169
182
170
183
3.__Spatial Preprocessing__:
171
-
Performs spatial preprocessing by running the script:
172
-
`BIDS_SpatialPrepro.m`
184
+
Performs spatial preprocessing by running the script: `BIDS_SpatialPrepro.m`
173
185
174
186
4.__SMOOTHING__:
175
-
Performs smoothing of the functional data by running the script:
176
-
`BIDS_Smoothing.m`
187
+
Performs smoothing of the functional data by running the script: `BIDS_Smoothing.m`
Performs the fixed effects analysis by running the ffx script:
180
-
`BIDS_FFX.m`
190
+
Performs the fixed effects analysis by running the ffx script: `BIDS_FFX.m`
181
191
182
192
This will run twice, once for model specification and another time for model estimation. See the function for more details.
183
193
184
194
This will take each condition present in the `events.tsv` file of each run and convolve it with a canonical HRF. It will also add the 6 realignment parameters of every run as confound regressors.
BELOW: some comments from [here](http://mindhive.mit.edu/node/109) on STC, when it should be applied
@@ -243,8 +258,10 @@ _If you do slice timing correction before realignment, you might look down your
243
258
244
259
_There's no way to avoid all the error (short of doing a four-dimensional realignment process combining spatial and temporal correction - Remi's note: fMRIprep does it), but I believe the current thinking is that doing slice timing first minimizes your possible error. The set of voxels subject to such an interpolation error is small, and the interpolation into another TR will also be small and will only affect a few TRs in the time course. By contrast, if one realigns first, many voxels in a slice could be affected at once, and their whole time courses will be affected. I think that's why it makes sense to do slice timing first. That said, here's some articles from the SPM e-mail list that comment helpfully on this subject both ways, and there are even more if you do a search for "slice timing AND before" in the archives of the list._
245
260
261
+
246
262
## Boiler plate methods section
247
263
264
+
248
265
### Preprocessing
249
266
250
267
The fMRI data were pre-processed and analyzed using statistical parametric mapping (SPM12 – v7487; Wellcome Center for Neuroimaging, London, UK; www.fil.ion.ucl.ac.uk/spm) running on {octave 4.{??} / matlab 20{XX} (Mathworks)}.
@@ -263,6 +280,7 @@ The anatomical T1 image was bias field corrected, segmented and normalized to MN
263
280
264
281
Functional MNI normalized images were then spatially smoothed using a 3D gaussian kernel (FWHM = {XX} mm).
265
282
283
+
266
284
### fMRI data analysis
267
285
268
286
At the subject level, we performed a mass univariate analysis with a linear regression at each voxel of the brain, using generalized least squares with a global FAST model to account for temporal auto-correlation (Corbin et al, 2018) and a drift fit with discrete cosine transform basis (128 seconds cut-off). Image intensity scaling was done run-wide before statistical modeling such that the mean image will have mean intracerebral intensity of 100.
@@ -279,17 +297,19 @@ Table of constrast with weight: WIP
Corbin, N., Todd, N., Friston, K. J. & Callaghan, M. F. Accurate modeling of temporal correlations in rapidly sampled fMRI time series. Hum. Brain Mapp. 39, 3884–3897 (2018).
287
306
288
307
289
-
## Testing
308
+
## Unit testing
290
309
291
310
All tests are in the test folder. There is also an empty dummy BIDS dataset that is partly created using the bash script `createDummyDataSet.sh`.
292
311
312
+
293
313
## Contributors ✨
294
314
295
315
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
0 commit comments