Skip to content

Commit e3b87eb

Browse files
committed
FIX: Remove defunct collect_derivatives code
1 parent 6730539 commit e3b87eb

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

smriprep/utils/bids.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
# https://www.nipreps.org/community/licensing/
2222
#
2323
"""Utilities to handle BIDS inputs."""
24-
from collections import defaultdict
2524
from pathlib import Path
2625
from json import loads
2726
from pkg_resources import resource_filename as pkgrf
@@ -40,9 +39,9 @@ def collect_derivatives(derivatives_dir, subject_id, std_spaces, spec=None, patt
4039
if patterns is None:
4140
patterns = _patterns
4241

43-
derivs_cache = defaultdict(list)
4442
layout = BIDSLayout(derivatives_dir, config=["bids", "derivatives"], validate=False)
4543

44+
derivs_cache = {}
4645
for k, q in spec["baseline"].items():
4746
q["subject"] = subject_id
4847
item = layout.get(return_type='filename', **q)
@@ -51,18 +50,6 @@ def collect_derivatives(derivatives_dir, subject_id, std_spaces, spec=None, patt
5150

5251
derivs_cache["t1w_%s" % k] = item[0] if len(item) == 1 else item
5352

54-
for space in std_spaces:
55-
for k, q in spec["std_xfms"].items():
56-
q["subject"] = subject_id
57-
q["from"] = q["from"] or space
58-
q["to"] = q["to"] or space
59-
item = layout.get(return_type='filename', **q)
60-
if not item:
61-
continue
62-
derivs_cache[k] += item
63-
64-
derivs_cache = dict(derivs_cache) # Back to a standard dictionary
65-
6653
transforms = derivs_cache.setdefault('transforms', {})
6754
for space in std_spaces:
6855
for k, q in spec["transforms"].items():

0 commit comments

Comments
 (0)