Error when using --bids-filter-file

Trying to use the new --bids-filter-file to select only the first session to process for a given participant. I finally figured out the config.json file (documentation/examples on this that aren’t buried in PRs leave a bit to be desired, I will try to add one when I’m sure it works). I know that this participant starts running without errors using 20.0.2 without a filtering file. However, when I try to add the filter, I get the error below:

   Running fMRIPREP version 20.0.2:
      * BIDS dataset path: /mnt.
      * Participant list: ['CBPD0207'].
      * Run identifier: 20200309-183330_24bf583e-e89a-4cb4-ab9c-097ee54a7a3c.

    Spatial References:
    - Reference(space='MNI152NLin6Asym', spec={})
    - Reference(space='T1w', spec={})
    - Reference(space='MNIPediatricAsym', spec={'res': '1', 'cohort': '2'})
200309-18:35:48,207 nipype.utils INFO:
	 No new version available.
Process Process-2:
Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/multiprocessing/", line 297, in _bootstrap
  File "/usr/local/miniconda/lib/python3.7/multiprocessing/", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/cli/", line 691, in build_workflow
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/", line 274, in init_fmriprep_wf
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/", line 499, in init_single_subject_wf
    subject_id, task_id if task_id else '<all>'))
Exception: No BOLD images found for participant CBPD0207 and task <all>. All workflows require BOLD images.

Config file:

    "t1w": {
        "datatype": "anat",
        "session": "1",
        "suffix": "T1w"
    "bold": {
        "datatype": "func",
        "session": "1",
        "suffix": "bold"

It looks like <all> is not being evaluated properly? Or…something with the config file, I’m still confused about how to set it up properly.

Of course as soon as I make a post, I figure out the issue…"session": "1" does not evaluate to the same thing as "session": "01", and since I named my sessions with leading zeros…that’s the problem.

I am still curious, though, as to a few things:

A) How pre-run Freesurfer integrates (or not) with this filtering? Essentially I want to run different sessions as different cross-sectional “subjects”. Is there a way to point fmriprep to the Freesurfer that’s already been run for session 2 of a given subject, or do I have to rely on Freesurfer run within fmriprep for each session separately?

B) Is it possible to filter out acq=null or the equivalent? The example here shows this, but perhaps I am misinterpreting it. It looks like no matter what I put in the acq filter, the boilerplate still says that an average ref “map was computed after registration of 3 T1w images (after INU-correction) using mri_robust_template.” Maybe this is just not updated in the boilerplate output?

I want to use a T1 without an acquisition label–I have a vanilla sub-CBPD0207_ses-01_run-01_T1w, and a special acquisition named sub-CBPD0207_ses-01_acq-csacc42_run-01_T1w and I only want to use the vanilla version.

You should be able to do A) using the --fs-subjects-dir flag, given that you have the different sessions as separate FS_SUBJECTS_DIRs.

For B) it doesn’t seem your filter is currently excluding the other T1w images. Ensure that your “t1w” key contains the key/value pair: "acquisition": null. The boilerplate should reflect there only being 1 T1w image after filtering.

1 Like

That’s a good idea, thanks so much! I hadn’t realized that new flag covered my use case.