Errors when changing to newer fMRIPrep version

Summary of what happened:

For a project that previously used scripts/configurations/etc set up for fmriprep 1.3.2, using fmriprep 22.1.1, with some changes to options, results in various failures. The task data that has been through fmriprep 1.3.2 is not going to be reprocessed, but we need to put the resting state scans through the new version of fmriprep that produces different output. (Resting state scans have made it through the old version of fmriprep, but we plan on replacing that output).

Command used (and if a helper script was used, a link to the helper script or the command generated):

previously used (without error):

/opt/singularity/bin/singularity run --cleanenv -B \
"${PRIMARY_WORKING_DIR}ECDM$(echo ${SUBID} | cut -c 1-4)":/tmp \
/data/nil-bluearc/ccp-hcp/SingularityImages/fmriprep-1.3.2.simg \
 --fs-license-file /tmp/.license/freesurfer/license.txt \
 -w /tmp /tmp/BIDS /tmp/derivatives \
 participant --participant_label "ECDM$(echo ${SUBID} | cut -c 1-4)" \
 --output-space template fsaverage5 \
 --template MNI152NLin2009cAsym \
 --template-resampling-grid native \
 --n-cpus 16 \
 --omp-nthreads 4 \
 --mem-mb 64000 -v

New, failing command, with modified options for slightly different output (recommended by lab member)

/opt/singularity/bin/singularity run --cleanenv -B \ 
"${PRIMARY_WORKING_DIR}ECDM$(echo ${SUBID} | cut -c 1-4)":/tmp \
/data/nil-bluearc/ccp-hcp/SingularityImages/fmriprep-22.1.1.simg \
--fs-license-file /tmp/.license/freesurfer/license.txt \
-w /tmp /tmp/BIDS /tmp/derivatives \
participant --participant_label "ECDM$(echo ${SUBID} | cut -c 1-4)" \
--output-spaces MNI152NLin6Asym:res-2 MNI152NLin2009cAsym \
--cifti-output \
--n-cpus 16 \
--omp-nthreads 4 \
--mem-mb 64000 -v



Environment (Docker, Singularity, custom installation):


Data formatted according to a validatable standard? Please provide the output of the validator:

BIDS; Previously, with the older version of fmriprep, we were able to process without a dataset_description.json file. In my current attempts at troubleshooting, noting a related error, I did some digging and realized that the new version of fmriprep expected that as mandatory, so I created one to see if it helped. The data now passes through the online validator tool without errors, only warnings about missing events, readme, and too few authors. That doesn’t seem to resolve the problems, though.

Relevant log outputs (up to 20 lines):

Some of the errors: line 223: /scratch3/fMRIPrep_AFNI_Processing/ECDM/ECDM1000:/tmp: No such file or directory

a singularity error? (singularity versions haven’t changed)

Error for command "run": requires at least 1 arg(s), only received 0

  singularity [global options...] run [run options...] <container>

Run 'singularity run --help' for more detailed usage information.

Screenshots / relevant information:

My knowledge about neuro/BIDS/fmriprep is superficial at best; most of my work has been scriptifying containers that other people in our lab have made, and this feels like I’m going to have to take a deeper dive and better understand some things in order to troubleshoot. I believe the problem stems from differences in the different versions of fMRIPrep, and maybe some sort of difference in options that are passed, but it’s also possible that I might have made some other mistake in trying to adapt our old stuff to the new fmriprep version.

Hi @nbloom,

Would need to see more of your helper script, but this is probably unrelated to singularity / fmriprep, just sounds like a directory wasn’t created (or is in a different spot)

Could you try, instead of running the command, printing the command? That is, echoing the full singularity/fmriprep invocation after the variable names have been substituted? Then we could see if there was any unexpected syntax error.

Also it is generally good practice to put all the positional arguments (/tmp/BIDS /tmp/derivatives participant in your case) either as the first or last set of arguments. So you could move -w /tmp to after participant.


Thanks for the help!
I did that, and immediately noticed that there was some kind of weird whitespace character between the first and second lines that were causing parsing issues.
I fixed that, and reordered the two options as per your recommendation, however, there is still some kind of issue:

/opt/singularity/bin/singularity run --cleanenv -B /scratch3/fMRIPrep_AFNI_Processing/ECDM/ECDM1000:/tmp /data/nil-bluearc/ccp-hcp/SingularityImages/fmriprep-22.1.1.simg --fs-license-file /tmp/.license/freesurfer/license.txt participant --participant_label ECDM1000 -w /tmp /tmp/BIDS /tmp/derivatives --output-spaces MNI152NLin6Asym:res-2 MNI152NLin2009cAsym --cifti-output --n-cpus 16 --omp-nthreads 4 --mem-mb 64000 -v
usage: fmriprep [-h] [--version] [--skip_bids_validation]
                [--participant-label PARTICIPANT_LABEL [PARTICIPANT_LABEL ...]]
                [-t TASK_ID] [--echo-idx ECHO_IDX] [--bids-filter-file FILE]
                [--anat-derivatives PATH] [--bids-database-dir PATH]
                [--nprocs NPROCS] [--omp-nthreads OMP_NTHREADS]
                [--mem MEMORY_MB] [--low-mem] [--use-plugin FILE]
                [--anat-only] [--boilerplate_only] [--md-only-boilerplate]
                [--error-on-aroma-warnings] [-v]
                [--ignore {fieldmaps,slicetiming,sbref,t2w,flair} [{fieldmaps,slicetiming,sbref,t2w,flair} ...]]
                [--longitudinal] [--output-spaces [OUTPUT_SPACES ...]]
                [--me-output-echos] [--bold2t1w-init {register,header}]
                [--bold2t1w-dof {6,9,12}] [--force-bbr] [--force-no-bbr]
                [--medial-surface-nan] [--slice-time-ref SLICE_TIME_REF]
                [--dummy-scans DUMMY_SCANS] [--random-seed _RANDOM_SEED]
                [--aroma-melodic-dimensionality AROMA_MELODIC_DIM]
                [--fd-spike-threshold REGRESSORS_FD_TH]
                [--dvars-spike-threshold REGRESSORS_DVARS_TH]
                [--skull-strip-template SKULL_STRIP_TEMPLATE]
                [--skull-strip-t1w {auto,skip,force}] [--fmap-bspline]
                [--fmap-no-demean] [--topup-max-vols TOPUP_MAX_VOLS]
                [--use-syn-sdc [{warn,error}]] [--force-syn]
                [--fs-license-file FILE] [--fs-subjects-dir PATH]
                [--no-submm-recon] [--cifti-output [{91k,170k}] |
                --fs-no-reconall] [--output-layout {bids,legacy}]
                [-w WORK_DIR] [--clean-workdir] [--resource-monitor]
                [--reports-only] [--config-file FILE] [--write-graph]
                [--stop-on-first-crash] [--notrack]
                [--debug {compcor,fieldmaps,pdb,all} [{compcor,fieldmaps,pdb,all} ...]]
                [--sloppy] [--track-carbon] [--country-code COUNTRY_CODE]
                bids_dir output_dir {participant}
fmriprep: error: Path does not exist: <participant>.

Not sure if it matters, but /scratch3/fMRIPrep_AFNI_Processing/ECDM/ECDM1000 definitely exists; the actual structure is:

                                       unprocessed/(source dicoms live in subdirectory)

within the BIDS folder, there is the “sub-ECDM1000” folder and “dataset_description.json” file that I made.

In your new command participant comes before tmp/BIDS /tmp/derivatives which is incorrect. The three positional arguments have to be in the correct order, in your case tmp/BIDS /tmp/derivatives participant.

It appears it was indeed a syntax error, because now it’s actually running!

1 Like

Great, happy to hear it!