@@ -92,9 +92,9 @@ It uses
9292to run those transformations. Please see this bids-matlab documentation to know
9393how to use them and call them in your JSON.
9494
95- The advantage of this bids-matlab transformers is
96- that they allow you to directly add on tsv files to quickly see
97- what outcome a series of transformers will produce.
95+ The advantage of this bids-matlab transformers is that they allow you to
96+ directly add on tsv files to quickly see what outcome a series of transformers
97+ will produce.
9898
9999Below is an example on how to subtract 3 seconds from the event onsets of the
100100conditions ` motion ` listed in the ` trial_type ` columns of the ` events.tsv ` file,
@@ -151,7 +151,7 @@ dummy scans will be included.
151151 " static"
152152 ],
153153 "Model" : " spm"
154- }
154+ }
155155```
156156
157157`HRF` specifies:
@@ -169,13 +169,40 @@ Not yet implementated:
169169
170170- `"fir"`
171171
172+ ```json
173+ "Model" : {
174+ "Type" : " glm" ,
175+ "X" : [
176+ " motion" , -------- Those 2 conditions will be convolved
177+ " static" , -------| using the canonical HRF only.
178+ Those 3 conditions <-------"trans_?", |
179+ will not <-------"rot_?", |
180+ be convolved. <-------"*outlier*" |
181+ ], |
182+ "HRF" : { |
183+ "Variables" : [ |
184+ " motion" , <--|
185+ " static" <--|
186+ ],
187+ "Model" : " spm"
188+ }
189+ ```
190+
191+ ```{image } ./images/gui_batch_model_hrf.png
192+ :alt: Corresponding options in SPM batch
193+ :align: center
194+ ```
195+
172196(bids_stats_model_sofware)=
173197
174198### Software
199+
175200<!-- markdown-link-check-disable -->
201+
176202Note that if you wanted to change the
177203[`SerialCorrelation` model ](auto_correlation_model) used by CPP SPM, you could
178204do so via the `Software` object of the BIDS stats model.
205+
179206<!-- markdown-link-check-enable -->
180207
181208Similar you can adapt directly in the model the threshold used by SPM to create
@@ -207,6 +234,111 @@ of SPM defaults.) .
207234}
208235```
209236
237+ ```{figure } ./images/gui_batch_model_serialCorrelation_maskThresh.png
238+ ---
239+ name: software_spm_batch
240+ align: center
241+ ---
242+ Corresponding options in SPM batch
243+ ```
244+
245+ ### Contrasts
246+
247+ #### Run level
248+
249+ To stay close to the way most SPM users are familiar with, all runs are analyzed
250+ in one single GLM.
251+
252+ Contrasts are the run level that are either specified using ` DummyContrasts ` or
253+ ` Contrasts ` will be computed and will have the run number appended to their name
254+ in the SPM gui as shown in {ref}` contrast_run_1 ` and {ref}` contrast_run_2 ` .
255+
256+ ``` {literalinclude} ./examples/model-contrastsRun_smdl.json
257+ :language: json
258+ ```
259+
260+ ``` {figure} ./images/gui_contrast_run_1.png
261+ ---
262+ name: contrast_run_1
263+ align: center
264+ ---
265+ Contrast for run 1
266+ ```
267+
268+ ``` {figure} ./images/gui_contrast_run_2.png
269+ ---
270+ name: contrast_run_2
271+ align: center
272+ ---
273+ Contrast for run 2
274+ ```
275+
276+ #### Subject level
277+
278+ At the moment the only type of model supported at the run level is averaging of
279+ run level contrasts.
280+
281+ ``` {literalinclude} ./examples/model-contrastsSubject_smdl.json
282+ :language: json
283+ ```
284+
285+ ``` {figure} ./images/gui_contrast_run_1_and_2.png
286+ ---
287+ name: contrast_subject
288+ align: center
289+ ---
290+ Subject level contrast averaging beta of run 1 and 2
291+ ```
292+
293+ ## Dataset level
294+
295+ At the moment only, the only type of models that are supported are:
296+
297+ - one sample t-test: averaging across all subjects
298+
299+ ``` {literalinclude} ./examples/model-datasetLevel_smdl.json
300+ :language: json
301+ ```
302+
303+ - one sample t-test: averaging across all subjects of a specific group
304+
305+ ``` {literalinclude} ./examples/model_withinGroup_smdl.json
306+ :language: json
307+ ```
308+
309+ - 2 samples t-test: comparing 2 groups
310+
311+ At the moment this can only be based on how participants are allocated to a
312+ group based on a ` group ` or ` Group ` column in the ` participants.tsv ` of in the
313+ raw dataset.
314+
315+ ``` {literalinclude} ./examples/model_betweenGroups_smdl.json
316+ :language: json
317+ ```
318+
319+ ### Method section
320+
321+ It is possible to write a draft of method section based on a BIDS statistical
322+ model.
323+
324+ ``` matlab
325+ opt.model.file = fullfile(pwd, ...
326+ 'models', ...
327+ 'model-faceRepetition_smdl.json');
328+ opt.fwhm.contrast = 0;
329+ opt = checkOptions(opt);
330+
331+ opt.designType = 'block';
332+
333+ outputFile = boilerplate(opt, ...
334+ 'outputPath', pwd, ...
335+ 'pipelineType', 'stats');
336+ ```
337+
338+ ``` {literalinclude} ./examples/stats.md
339+ :language: markdown
340+ ```
341+
210342## Parametric modulation
211343
212344Those are not yet fully implemented but there is an example of how to get
@@ -224,8 +356,13 @@ There are several examples of models in the
224356[ model zoo] ( https://github.com/bids-standard/model-zoo ) along with links to
225357their datasets.
226358
227- Several of the :ref:` demos ` have their own model and you can find several
359+ <!-- markdown-link-check-disable -->
360+
361+ Several of the [ demos] ( demos ) have their own model and you can find several
228362"dummy" models (without corresponding data) used for testing
363+
364+ <!-- markdown-link-check-enable -->
365+
229366[ in this folder] ( https://github.com/cpp-lln-lab/CPP_SPM/tree/dev/tests/dummyData/models ) .
230367
231368An example of JSON file could look something like that:
0 commit comments