Replies: 6 comments 6 replies
-
OK if you want to use fmriprep data without extra smoothing, you must first indeed copy the data you need in a bidspm-preproc folder. For this you can use the copy action https://bidspm.readthedocs.io/en/latest/usage_notes.html
You can use the The default structure used is this one: struct('fmap', struct('modality', 'fmap'), ...
'bold', struct('modality', 'func', 'suffix', 'bold'), ...
't2w', struct('modality', 'anat', 'suffix', 'T2w'), ...
't1w', struct('modality', 'anat', 'space', '', 'suffix', 'T1w'), ...
'roi', struct('modality', 'roi', 'suffix', 'mask'), ...
'xfm', struct('modality', 'anat', 'suffix', 'xfm', 'to', 'T1w')); https://bidspm.readthedocs.io/en/latest/dev_doc.html#src.defaults.checkOptions So in your case you could do: bids_filter_file = struct('fmap', struct('modality', 'fmap'), ...
'bold', struct('modality', 'func', 'suffix', 'bold', 'desc', 'smoothAROMAnonaggr'), ... % < ---- specify the 'desc' here
't2w', struct('modality', 'anat', 'suffix', 'T2w'), ...
't1w', struct('modality', 'anat', 'space', '', 'suffix', 'T1w'), ...
'roi', struct('modality', 'roi', 'suffix', 'mask'), ...
'xfm', struct('modality', 'anat', 'suffix', 'xfm', 'to', 'T1w'));
task_in_the_model ={'food'}
bidspm(bids_dir, output_dir, 'subject', ...
'action', 'copy', ...
'participant_label', {subject_label}, ...
'bids_filter_file', bids_filter_file, ...
'verbosity', 2, ...
'space', {'MNI152NLin6Asym'}, ...
'options', struct([]), ...
'task', task_in_the_model, ...
'skip_validation', true) |
Beta Was this translation helpful? Give feedback.
-
Your bids stats model looks mostly fine: I removed:
{
"Name": "default_food_model",
"BIDSModelVersion": "1.0.0",
"Description": "default BIDS stats model for food task",
"Input": {
"task": ["food"],
"space": ["MNI152NLin6Asym"]
},
"Nodes": [
{
"Level": "Run",
"Name": "run",
"GroupBy": [
"run",
"session",
"subject"
],
"Model": {
"X": [
"trial_type.hi_savory",
"trial_type.hi_sweet",
"trial_type.lo_savory",
"trial_type.lo_sweet",
"1",
"trans_?",
"rot_?",
"non_steady_state_outlier*",
"motion_outlier*"
],
"Type": "glm",
"HRF": {
"Variables": [
"trial_type.hi_savory",
"trial_type.hi_sweet",
"trial_type.lo_savory",
"trial_type.lo_sweet"
],
"Model": "spm"
},
"Options": {
"HighPassFilterCutoffHz": 0.008,
"Mask": {
"desc": ["brain"],
"suffix": ["mask"]
}
},
"Software": {
"SPM": {
"SerialCorrelation": "FAST",
"InclusiveMaskingThreshold": 0.8
}
}
},
"DummyContrasts": {
"Test": "t",
"Contrasts": [
"trial_type.hi_savory",
"trial_type.hi_sweet",
"trial_type.lo_savory",
"trial_type.lo_sweet"
]
}
},
{
"Level": "Subject",
"Name": "subject",
"GroupBy": [
"subject",
"contrast"
],
"Model": {
"X": [1],
"Type": "glm"
},
"DummyContrasts": {
"Test": "t"
}
},
{
"Level": "Dataset",
"Name": "dataset",
"GroupBy": ["contrast"],
"Model": {
"X": [1],
"Type": "glm"
},
"DummyContrasts": {
"Test": "t"
}
}
],
"Edges": [
{
"Source": "run",
"Destination": "subject"
},
{
"Source": "subject",
"Destination": "dataset"
}
]
} |
Beta Was this translation helpful? Give feedback.
-
When I try to copy using your suggestions I receive the error message
```matlab
15:19:43] bidspm - INFO getData
WILL WORK ON SUBJECTS
- 1085
[15:19:43] bidspm - INFO
No data found for this query:
- desc: {preproc, brain}
- modality: {anat}
- space: {MNI152NLin6Asym}
- suffix: {T1w, bold, mask}
- sub: {1085}
in dataset:
/server/fo2-17/data/NASAL_2018/DAGen_Bromo/BIDS/Tuebingen/inputs/fmriprep
```
The data is actually in the dataset folder but with different sessions
.../fmriprep/sub-1085/ses-V0/func
.../fmriprep/sub-1085/ses-V9/func
.../fmriprep/sub-1085/anat
anat is in a superior folder because fmriprep is searching for all
T1-images in a certain subject and create one anat folder below the
subject folder.
In the other .../sub-1085/ses-V0/anat folder there is only a file
sub-1085_ses-V0_from-orig_to-T1w_mode-image_xfm.txt with affine
transformation parameters.
Should I define the two sessions (and runs) in the bids_filter_file?
How to handle the different level of the anat folder? I just realized
that in the anat the data has a different space (MNI152NLin2009cAsym -
but the default output for anat processing in fmriprep). Defining both
spaces or the 2009 space in the structure for space does not change
the error.
|
Beta Was this translation helpful? Give feedback.
-
using the options flag, the copying works with the defaults files
(including the confounds_timeseries.tsv files)
```
copying
/server/fo2-17/data/NASAL_2018/DAGen_Bromo/BIDS/Tuebingen/inputs/fmriprep/sub-1085/ses-V0/func/sub-1085_ses-V0_task-food_run-1_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz -->
/server/fo2-17/data/NASAL_2018/DAGen_Bromo/BIDS/Tuebingen/outputs/derivatives/bidspm-preproc/derivatives/bidspm-preproc/../bidspm-preproc/sub-1085/ses-V0/func/sub-1085_ses-V0_task-food_run-1_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz
```
but not with the already smoothed files that were stated in in the
bids_filter_file
```
bids_filter_file = struct('fmap', struct('modality', 'fmap'), ...
'bold', struct('modality', 'func', 'suffix', 'bold', 'desc',
'smoothAROMAnonaggr'), ...
't2w', struct('modality', 'anat', 'suffix', 'T2w'), ...
't1w', struct('modality', 'anat', 'space',
'MNI152NLin2009cAsym', 'suffix', 'T1w'), ...
'roi', struct('modality', 'roi', 'suffix', 'mask'), ...
'xfm', struct('modality', 'anat', 'suffix', 'xfm', 'to', 'T1w'));
```
should I modify the options to select the specific 'bold' files
|
Beta Was this translation helpful? Give feedback.
-
The bids_filter_file shows the correct field
```
bids_filter_file.bold
ans =
struct with fields:
modality: 'func'
space: 'MNI152NLin6Asym'
suffix: 'bold'
desc: 'smoothAROMAnonaggr'
```
but when running a different desc reference is listed
```
No data found for this query:
- desc: {preproc, brain}
- modality: {func}
- space: {MNI152NLin6Asym}
- suffix: {T1w, bold, mask}
- sub: {1424}
- task: {food}
```
|
Beta Was this translation helpful? Give feedback.
-
OK so this problem should be fixed.
I have a test where it works: bidspm/tests/tests_cli/test_bidspm_copy.m Lines 60 to 71 in e684f7a
so I am going to close this discussion, but feel free to reopen it or open a new one or an issue if you still encounter problems with this. |
Beta Was this translation helpful? Give feedback.
-
Dear Rami,
now I'm starting to run the statistics using my own dataset.
We conducted a food-cue reactivity task on two sessions and with two runs each. Preprocessing with fmriprep worked fine. We selected the flag --use-aroma to nonaggressively correct movement related noise components. In this case fmriprep creates a file sub-1085_ses-V0_task-food_run-1_space-MNI152NLin6Asym_desc-smoothAROMAnonaggr_bold.nii that is already smoothed with FWHM of 6mm.
The preprocessed data is now in the folder
In your default setup you expect smoothing, because fmriprep is normally not smoothing the data during preprocessing. To become more familiar with the stats processing I created a simple default model
the model was then created and saved at /server/fo2-17/data/NASAL_2018/DAGen_Bromo/BIDS/Tuebingen/outputs/derivatives/models/model-defaultFood_smdl.json
It's only a test file and there are some modifications in the design matrix (i.e. confounds) and contrast settings necessary (I use visual studio code for editing).
then I tried to run the stats using
and the script stopped with the error message
and ...
Now there are several question. Should I copy the data to a folder outside fmriprep (bidspm-preproc) and how? How can I change the input of
the - desc flag {smth6} to {smooth}. How can I adapt the script that only one session (ses-V0) will be analyzed?
Best
Ralf
model-defaultFood_smdl.zip
Beta Was this translation helpful? Give feedback.
All reactions