this is the third time I've seen the same inline "filt-or-regress" if-else. Makes me worry about forgetting to copy it where it's needed, when adding new code. Not sure if there is a sensible way to reduce that cognitive overhead / duplication that wouldn't feel over-engineered, though.
There are other places where this happens, too, like in the filtering step where you need to triage based on whether or not SSS was used. It would be good if there were a standard way of handling this triaging. We have some helpers along these lines for picking "all raw data runs" (e.g., whether noise or rest needs to be processed in addition to task runs) so maybe we can do something similar that looks at cfg.spatial_filter, cfg.maxwell_filter etc.
_Originally posted by @drammock in https://github.com/mne-tools/mne-bids-pipeline/pull/840#discussion_r1480010865_
There are other places where this happens, too, like in the filtering step where you need to triage based on whether or not SSS was used. It would be good if there were a standard way of handling this triaging. We have some helpers along these lines for picking "all raw data runs" (e.g., whether noise or rest needs to be processed in addition to task runs) so maybe we can do something similar that looks at
cfg.spatial_filter
,cfg.maxwell_filter
etc.