Fmriprep doesn't use T2 file

Hi, I am using fmriprep v. 1.3.2. The wierd thing is that fmriprep doesn’t save T2 images in output folder, and saves only one file of 3: sub-1_desc-preproc_T1w.nii.gz
Here is a tree of BIDS directory

    /tmp/BIDS/
├── CHANGES
├── README
├── dataset_description.json
├── participants.json
├── participants.tsv
├── sub-1
│   ├── anat
│   │   ├── sub-1_T1MprageSagP2IsoOrig_T1w.json
│   │   ├── sub-1_T1MprageSagP2IsoOrig_T1w.nii.gz
│   │   ├── sub-1_T2SpaceDaFlCorP2IsoOrig_FLAIR.json
│   │   ├── sub-1_T2SpaceDaFlCorP2IsoOrig_FLAIR.nii.gz
│   │   ├── sub-1_T2SpaceNsTra06MmIso_T2w.json
│   │   └── sub-1_T2SpaceNsTra06MmIso_T2w.nii.gz
│   ├── sub-1_scans.json
│   └── sub-1_scans.tsv

And fmriprep output is only mprage series:

 logs
│   ├── CITATION.bib
│   ├── CITATION.html
│   ├── CITATION.md
│   └── CITATION.tex
├── sub-1
│   └── anat
│       ├── sub-1_T1MprageSagP2IsoOrig_from-orig_to-T1w_mode-image_xfm.txt
│       ├── sub-1_desc-preproc_T1w.json
│       ├── sub-1_desc-preproc_T1w.nii.gz
│       └── sub-1_from-T1w_to-fsnative_mode-image_xfm.txt

freesurfer output mri have only orig in t2:

mri
│   ├── T1.mgz
│   ├── brainmask.auto.mgz
│   ├── brainmask.mgz
│   ├── ctrl_pts.mgz
│   ├── mri_nu_correct.mni.log
│   ├── mri_nu_correct.mni.log.bak
│   ├── norm.mgz
│   ├── nu.mgz
│   ├── orig
│   │   ├── 001.mgz
│   │   └── T2raw.mgz
│   ├── orig.mgz
│   ├── orig_nu.mgz
│   ├── rawavg.mgz
│   ├── talairach.label_intensities.txt
│   ├── talairach.log

I have thought that the issue is coming from of --skip-bids-validation flag, however naming of files is according to BIDS specification:

 sub-control01
○ anat
■ sub-control01_T1w.nii.gz
■ sub-control01_T1w.json
■ sub-control01_T2w.nii.gz
■ sub-control01_T2w.json

The middle part of your filenames (e.g., T1MprageSagP2IsoOrig) is not BIDS compatible. BIDS filenames are composed of key/value pairs, along with a suffix and an extension. There are a restricted set of valid key/value pairs (see Appendix IX for the current list).

I can’t say why fMRIPrep successfully processed sub-1_T1MprageSagP2IsoOrig_T1w.nii.gz, but the first thing I’d recommend doing is changing the filenames to be BIDS-compatible. Given that the text in the middle of each filename seems to be a somewhat freeform description, I’d recommend using acq, although TBH I don’t think the additional description is necessary based on the part of the file tree you shared.

Here is what the updated filenames would look like:

sub-1_acq-T1MprageSagP2IsoOrig_T1w.json
sub-1_acq-T1MprageSagP2IsoOrig_T1w.nii.gz
sub-1_acq-T2SpaceDaFlCorP2IsoOrig_FLAIR.json
sub-1_acq-T2SpaceDaFlCorP2IsoOrig_FLAIR.nii.gz
sub-1_acq-T2SpaceNsTra06MmIso_T2w.json
sub-1_acq-T2SpaceNsTra06MmIso_T2w.nii.gz

After fixing the filenames, I would try re-running fMRIPrep without using --skip-bids-validation.

Also, 1.3.2 is a pretty old version (~2 years old). Unless you have been preprocessing other parts of the same dataset with that version, I’d recommend using the LTS release (20.2.1). It will make it easier for folks to help, since we can compare against known bugs in the current version instead of having to do forensic debugging.

I hope that helps.

Best,
Taylor

@tsalo, Thanks for pointing out on acq template tag, will try to run it with new naming and new version of fmriprep. By the wat, does fmriprep: v.20.2.1 available at docker hub?

Regards,
Vyacheslav

Yes, each fMRIPrep release should deploy to DockerHub automatically. Hopefully the rename and update will work. :crossed_fingers: