Strange output from T1w fmriprep preprocessing


I preprocessed data using this command:

fmriprep-docker /media/$USER/data/data_prep /media/$USER/data/output participant --participant-label 01 --fs-license-file ~/Desktop/license.txt --fs-no-reconall

Everything went without errors, but for some reason one person has strange T1w output.

We use Siemens Skyra 3T scanner.

Thanks in advance for the help!


  1. What version of fMRIPrep is this?
  2. What does the original T1 look like?
  3. Have you tried including FreeSurfer?


1 Like

Looks like you probably have multiple T1w images and the conformation and merge is failing. Are they both of reasonable quality and containing correct orientation information?


1.I use the newest version of fmriprep.
2.T1 looks ok.

3. Now I am running the script without --fs-no-reconall and waiting for it to finish.

Thanks a lot for the help!


Thanks for responding.

There is also an MP2RAGE data in the anat folder. Its quality is not very good.


Ah, if that MP2RAGE also has the T1w suffix, then it’s very likely that we’re attempting to merge them, and the background noise is breaking the algorithm (which does well for local failures like neck or jaw position).

You’re probably going to need to create your own filters (see FAQ - Frequently Asked Questions β€” fmriprep version documentation). If you share your file listing (tree /path/to/dataset), I can help you with coming up with a filter that should work.

1 Like


Thanks a lot for answers and help.

/mnt/nas2/nifti - this is a dataset path

β”‚ β”œβ”€β”€ anat
β”‚ β”‚ β”œβ”€β”€ sub-92039939_acq-mp2rage_T1w.json
β”‚ β”‚ β”œβ”€β”€ sub-92039939_acq-mp2rage_T1w.nii.gz
β”‚ β”‚ β”œβ”€β”€ sub-92039939_T1w.json
β”‚ β”‚ β”œβ”€β”€ sub-92039939_T1w.nii.gz
β”‚ β”‚ β”œβ”€β”€ sub-92039939_T2w.json
β”‚ β”‚ └── sub-92039939_T2w.nii.gz
β”‚ β”œβ”€β”€ dwi
β”‚ β”‚ β”œβ”€β”€ sub-92039939_dir-AP_dwi.bval
β”‚ β”‚ β”œβ”€β”€ sub-92039939_dir-AP_dwi.bvec
β”‚ β”‚ β”œβ”€β”€ sub-92039939_dir-AP_dwi.json
β”‚ β”‚ β”œβ”€β”€ sub-92039939_dir-AP_dwi.nii.gz
β”‚ β”‚ β”œβ”€β”€ sub-92039939_dir-AP_sbref.json
β”‚ β”‚ β”œβ”€β”€ sub-92039939_dir-AP_sbref.nii.gz
β”‚ β”‚ β”œβ”€β”€ sub-92039939_dir-PA_dwi.bval
β”‚ β”‚ β”œβ”€β”€ sub-92039939_dir-PA_dwi.bvec
β”‚ β”‚ β”œβ”€β”€ sub-92039939_dir-PA_dwi.json
β”‚ β”‚ β”œβ”€β”€ sub-92039939_dir-PA_dwi.nii.gz
β”‚ β”‚ β”œβ”€β”€ sub-92039939_dir-PA_sbref.json
β”‚ β”‚ └── sub-92039939_dir-PA_sbref.nii.gz
β”‚ β”œβ”€β”€ fmap
β”‚ β”‚ β”œβ”€β”€ sub-92039939_acq-fmri_dir-AP_run-2_epi.json
β”‚ β”‚ β”œβ”€β”€ sub-92039939_acq-fmri_dir-AP_run-2_epi.nii.gz
β”‚ β”‚ β”œβ”€β”€ sub-92039939_acq-fmri_dir-PA_run-1_epi.json
β”‚ β”‚ └── sub-92039939_acq-fmri_dir-PA_run-1_epi.nii.gz
β”‚ β”œβ”€β”€ func
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-carit_run-1_bold.json
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-carit_run-1_bold.nii.gz
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-carit_run-1_events.tsv
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-carit_run-1_sbref.json
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-carit_run-1_sbref.nii.gz
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-carit_run-2_bold.json
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-carit_run-2_bold.nii.gz
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-carit_run-2_events.tsv
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-carit_run-2_sbref.json
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-carit_run-2_sbref.nii.gz
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-rest_run-1_bold.json
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-rest_run-1_bold.nii.gz
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-rest_run-1_events.tsv
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-rest_run-1_sbref.json
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-rest_run-1_sbref.nii.gz
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-rest_run-2_bold.json
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-rest_run-2_bold.nii.gz
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-rest_run-2_events.tsv
β”‚ β”‚ β”œβ”€β”€ sub-92039939_task-rest_run-2_sbref.json
β”‚ β”‚ └── sub-92039939_task-rest_run-2_sbref.nii.gz
β”‚ β”œβ”€β”€ sub-92039939_scans.json
β”‚ └── sub-92039939_scans.tsv

Huge Thanks for help!

Okay, so it looks like the only thing that needs to change is to set acq to null to avoid picking up acq-mp2rage. You can save this snippet as no-mp2rage.json and use --bids-filter-file no-mp2rage.json when running fMRIPrep:

  "t1w": {
    "datatype": "anat",
    "acquisition": null,
    "suffix": "T1w"
1 Like

Thanks a lot for help!

I have created a file and I am getting error:

fmriprep: error: Path does not exist: <`~/Desktop/no-mp2rage.json>

I tried several paths and still don’t work.

I’m guessing that ~/Desktop is not bound to the Docker container. I’m not sure if the docker wrapper would be best suited for this. Instead you may have more luck with the docker run command.

Example docker run --rm -it -v /path/to/data/dir:/data:ro \ -v /home/user/.licenses/freesurfer/license.txt:/opt/freesurfer/license.txt \ -v /path/to_output/dir:/out nipreps/fmriprep:21.0.1 \ /data /out participant

You can alter those paths to match your needs, making sure all relevant directories are bound to docker (that’s what the -v arguments are doing). Add your extra fmriprep arguments after β€˜participant’.

1 Like

Ah right, --bids-filter-file was not mapped into the container in 21.0.0. It is in 21.0.1, so if you pip install --upgrade fmriprep-docker, that should resolve this.


Everything works now - huge thanks for help again.