File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -429,10 +429,20 @@ def init_single_subject_wf(subject_id: str):
429
429
430
430
fmap_estimators = [fmap for fmap in fmap_estimators if fmap .bids_id in used_estimators ]
431
431
432
+ # Simplification: Unused estimators are removed from registry
433
+ # This fiddles with a private attribute, so it may break in future
434
+ # versions. However, it does mean the BOLD workflow doesn't need to
435
+ # replicate the logic that got us to the pared down set of estimators
436
+ # here.
437
+ final_ids = {fmap .bids_id for fmap in fmap_estimators }
438
+ unused_ids = [bids_id for bids_id in fm ._estimators if bids_id not in final_ids ]
439
+ for bids_id in unused_ids :
440
+ del fm ._estimators [bids_id ]
441
+
432
442
if fmap_estimators :
433
443
config .loggers .workflow .info (
434
444
"B0 field inhomogeneity map will be estimated with "
435
- f" the following { len (fmap_estimators )} estimators : "
445
+ f"the following { len (fmap_estimators )} estimator(s) : "
436
446
f"{ [e .method for e in fmap_estimators ]} ."
437
447
)
438
448
Original file line number Diff line number Diff line change @@ -289,7 +289,14 @@ def init_func_preproc_wf(bold_file, has_fieldmap=False):
289
289
config .loggers .workflow .info (sbref_msg )
290
290
291
291
if has_fieldmap :
292
- estimator_key = get_estimator (layout , bold_file if not multiecho else bold_file [0 ])
292
+ from sdcflows import fieldmaps as fm
293
+
294
+ # We may have pruned the estimator collection due to `--ignore fieldmaps`
295
+ estimator_key = [
296
+ key
297
+ for key in get_estimator (layout , bold_file if not multiecho else bold_file [0 ])
298
+ if key in fm ._estimators
299
+ ]
293
300
294
301
if not estimator_key :
295
302
has_fieldmap = False
You can’t perform that action at this time.
0 commit comments