@@ -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,43 @@ Not yet implementated:
169169
170170- `"fir"`
171171
172+
173+ <!--
174+ ```json
175+ "Model" : {
176+ "Type" : " glm" ,
177+ "X" : [
178+ " motion" , -------- Those 2 conditions will be convolved
179+ " static" , -------| using the canonical HRF only.
180+ Those 3 conditions <-------"trans_?", |
181+ will not <-------"rot_?", |
182+ be convolved. <-------"*outlier*" |
183+ ], |
184+ "HRF" : { |
185+ "Variables" : [ |
186+ " motion" , <--|
187+ " static" <--|
188+ ],
189+ "Model" : " spm"
190+ }
191+ ```
192+ -->
193+
194+ ```{image } ./images/gui_batch_model_hrf.png
195+ :alt: Corresponding options in SPM batch
196+ :align: center
197+ ```
198+
172199(bids_stats_model_sofware)=
173200
174201### Software
202+
175203<!-- markdown-link-check-disable -->
204+
176205Note that if you wanted to change the
177206[`SerialCorrelation` model ](auto_correlation_model) used by CPP SPM, you could
178207do so via the `Software` object of the BIDS stats model.
208+
179209<!-- markdown-link-check-enable -->
180210
181211Similar you can adapt directly in the model the threshold used by SPM to create
@@ -207,6 +237,111 @@ of SPM defaults.) .
207237}
208238```
209239
240+ ```{figure } ./images/gui_batch_model_serialCorrelation_maskThresh.png
241+ ---
242+ name: software_spm_batch
243+ align: center
244+ ---
245+ Corresponding options in SPM batch
246+ ```
247+
248+ ### Contrasts
249+
250+ #### Run level
251+
252+ To stay close to the way most SPM users are familiar with, all runs are analyzed
253+ in one single GLM.
254+
255+ Contrasts are the run level that are either specified using ` DummyContrasts ` or
256+ ` Contrasts ` will be computed and will have the run number appended to their name
257+ in the SPM gui as shown in {ref}` contrast_run_1 ` and {ref}` contrast_run_2 ` .
258+
259+ ``` {literalinclude} ./examples/model-contrastsRun_smdl.json
260+ :language: json
261+ ```
262+
263+ ``` {figure} ./images/gui_contrast_run_1.png
264+ ---
265+ name: contrast_run_1
266+ align: center
267+ ---
268+ Contrast for run 1
269+ ```
270+
271+ ``` {figure} ./images/gui_contrast_run_2.png
272+ ---
273+ name: contrast_run_2
274+ align: center
275+ ---
276+ Contrast for run 2
277+ ```
278+
279+ #### Subject level
280+
281+ At the moment the only type of model supported at the run level is averaging of
282+ run level contrasts.
283+
284+ ``` {literalinclude} ./examples/model-contrastsSubject_smdl.json
285+ :language: json
286+ ```
287+
288+ ``` {figure} ./images/gui_contrast_run_1_and_2.png
289+ ---
290+ name: contrast_subject
291+ align: center
292+ ---
293+ Subject level contrast averaging beta of run 1 and 2
294+ ```
295+
296+ ## Dataset level
297+
298+ At the moment only, the only type of models that are supported are:
299+
300+ - one sample t-test: averaging across all subjects
301+
302+ ``` {literalinclude} ./examples/model-datasetLevel_smdl.json
303+ :language: json
304+ ```
305+
306+ - one sample t-test: averaging across all subjects of a specific group
307+
308+ ``` {literalinclude} ./examples/model_withinGroup_smdl.json
309+ :language: json
310+ ```
311+
312+ - 2 samples t-test: comparing 2 groups
313+
314+ At the moment this can only be based on how participants are allocated to a
315+ group based on a ` group ` or ` Group ` column in the ` participants.tsv ` of in the
316+ raw dataset.
317+
318+ ``` {literalinclude} ./examples/model_betweenGroups_smdl.json
319+ :language: json
320+ ```
321+
322+ ### Method section
323+
324+ It is possible to write a draft of method section based on a BIDS statistical
325+ model.
326+
327+ ``` matlab
328+ opt.model.file = fullfile(pwd, ...
329+ 'models', ...
330+ 'model-faceRepetition_smdl.json');
331+ opt.fwhm.contrast = 0;
332+ opt = checkOptions(opt);
333+
334+ opt.designType = 'block';
335+
336+ outputFile = boilerplate(opt, ...
337+ 'outputPath', pwd, ...
338+ 'pipelineType', 'stats');
339+ ```
340+
341+ ``` {literalinclude} ./examples/stats.md
342+ :language: markdown
343+ ```
344+
210345## Parametric modulation
211346
212347Those are not yet fully implemented but there is an example of how to get
@@ -224,8 +359,13 @@ There are several examples of models in the
224359[ model zoo] ( https://github.com/bids-standard/model-zoo ) along with links to
225360their datasets.
226361
227- Several of the :ref:` demos ` have their own model and you can find several
362+ <!-- markdown-link-check-disable -->
363+
364+ Several of the [ demos] ( demos ) have their own model and you can find several
228365"dummy" models (without corresponding data) used for testing
366+
367+ <!-- markdown-link-check-enable -->
368+
229369[ in this folder] ( https://github.com/cpp-lln-lab/CPP_SPM/tree/dev/tests/dummyData/models ) .
230370
231371An example of JSON file could look something like that:
0 commit comments