Is there a way to exclude some functional files from being processed in fmriprep?

All of my EPI data for a recent experiment has been processed with magnitude and phase reconstructions. Is there a way to tell fmriprep to only run the rec-mag files through the pipeline? Processing the phase ones doesn’t really make any sense, and it actually seems to take quite a long time to get through them, since they probably confuse most of the processing programs. I don’t see a way to pick and choose granularly which files get processed - there is the -t, --task-id command line option to select tasks to process, but there is not an analogous one for --rec-id (or acq-id), or any method for excluding files.

Two possible solutions come to mind - some set of command line options for tasks to include (already exists), tasks to exclude, and analogues for acquisition and reconstruction (so 5 new command line options), or maybe a .fmriprepignore file, analogous to a .gitignore file, to flexibly exclude certain files from analysis.

Is this something anybody else would want, and if so, which method feels better? I’m leaning towards the .fmriprepignore file. If anybody is interested I can see what it would take to add this.

1 Like

This is an interesting question which should be resolved on the BIDS standard level rather than just for FMRIPREP. The support for phase images has been recently discussed in the context of multispectral anatomical sequences (MP2RAGE, MPM etc.): https://groups.google.com/d/msg/bids-discussion/Xg3mcjXaPgw/1WavbSqOBQAJ

One thing to consider is that all BIDS Apps with expect _bold files to be magnitude images. For now I think the best course of action is save the phase image with a new non-bids suffix (for example _boldphase) and add that suffix to .bidsignore file (for example *_boldphase*). This way:

  1. BIDS Apps will not accidentally pick up phase images
  2. You will still save the phase images even though there is no clear way to name them in the current version of the spec.

Ah, ok, I misread the BIDS spec here - I didn’t get the implication that if the name ended in _bold it was “processable” - I thought the some things keyed off the rec- specifier. But since rec is optional, I guess that makes sense. So I think maybe your workaround is the best for now.

EDIT: Alternately, if I’m going to be using the bidsignore file anyway, could I just add *_rec-phase*bold* to avoid renaming the files?

Another question - is the .bidsignore file an official part of the BIDS spec? I can’t actually find it described in the spec document (maybe that’s an error)?

No this is not part of the spec - it’s a file only used by the validator. https://github.com/INCF/bids-validator#bidsignore

Phase reconstruction has been added to the BIDS standard (in bids-standard/bids-specification#128). There’s a new _phase suffix for those data in the func/ datatype.

I’ve been working lately on getting these data supported in heudiconv, pybids, and the bids-validator, and that’s mostly accomplished at this point.

I know that that has nothing to do with the *ignore files, but it does have implications for magnitude/phase reconstructed EPI data.