Skip to content

Commit

Permalink
update FAQ to help structure data to run stats on fmriprep
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed Jun 27, 2022
1 parent 722bfc0 commit e9bf708
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions docs/source/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,90 @@ See those
for some pointers on how to make choices for the resolution to choose for your
analysis.
## Statistics
### How should I structure my data to run my statistical analysis?
The main thing to remember is that CPP SPM will read the events.tsv files from
your raw BIDS data set and will read the bold images from a `cpp_spm-preproc`
folder.
If your data was preprocessed with fmriprep, cpp_spm will first need to copy,
unzip and smooth the data into a `cpp_spm-preproc` folder
Here is an example of how the data is organized for the MoAE fmriprep demo and
what the `cpp_spm` bids call would look like.
```bash
├── inputs
│ ├── fmriprep # fmriprep preprocessed BIDS dataset
│ | ├── dataset_description.json
│ │ └── sub-01
│ │ ├── anat
│ │ ├── figures
│ │ └── func
│ │ ├── sub-01_task-auditory_desc-confounds_timeseries.json
│ │ ├── sub-01_task-auditory_desc-confounds_timeseries.tsv
│ │ ├── sub-01_task-auditory_space-MNI152NLin6Asym_desc-brain_mask.json
│ │ ├── sub-01_task-auditory_space-MNI152NLin6Asym_desc-brain_mask.nii.gz
│ │ ├── sub-01_task-auditory_space-MNI152NLin6Asym_desc-preproc_bold.json
│ │ └── sub-01_task-auditory_space-MNI152NLin6Asym_desc-preproc_bold.nii.gz
│ └── raw # raw BIDS dataset
│ ├── dataset_description.json
│ ├── README
│ ├── sub-01
│ │ ├── anat
│ │ │ └── sub-01_T1w.nii
│ │ └── func
│ │ ├── sub-01_task-auditory_bold.nii
│ │ └── sub-01_task-auditory_events.tsv
│ └── task-auditory_bold.json
├── models # models used to run the GLM
│ ├── model-MoAEfmriprep_smdl.json
│ ├── model-MoAEindividual_smdl.json
│ └── model-MoAE_smdl.json
├── options
└── outputs
└── derivatives
└── cpp_spm-preproc # contains either data taken from fmriprep and smoothed
├── dataset_description.json
├── README
├── jobs
│ └── auditory
│ └── sub-01
└── sub-01
├── anat
└── func
├── sub-01_task-auditory_desc-confounds_timeseries.json
├── sub-01_task-auditory_desc-confounds_timeseries.tsv
├── sub-01_task-auditory_space-MNI152NLin6Asym_desc-brain_mask.json
├── sub-01_task-auditory_space-MNI152NLin6Asym_desc-brain_mask.nii
├── sub-01_task-auditory_space-MNI152NLin6Asym_desc-preproc_bold.json
├── sub-01_task-auditory_space-MNI152NLin6Asym_desc-preproc_bold.nii
├── sub-01_task-auditory_space-MNI152NLin6Asym_desc-smth8_bold.json
└── sub-01_task-auditory_space-MNI152NLin6Asym_desc-smth8_bold.nii
```
```matlab
WD = fileparts(mfilename('fullpath'));
subject_label = '01';
bids_dir = fullfile(WD, 'inputs', 'raw');
output_dir = fullfile(WD, 'outputs', 'derivatives');
preproc_dir = fullfile(output_dir, 'cpp_spm-preproc');
model_file = fullfile(pwd, 'models', 'model-MoAEfmriprep_smdl.json');
cpp_spm(bids_dir, output_dir, 'subject', ...
'participant_label', {subject_label}, ...
'action', 'stats', ...
'preproc_dir', preproc_dir, ...
'model_file', model_file, ...
'fwhm', 8, ...
'options', opt);
```
## Results
### How can I change which slices are shown in a montage?
Expand Down

0 comments on commit e9bf708

Please sign in to comment.