Skip to content

Commit 5c8ef24

Browse files
authored
Merge pull request #512 from tsalo/collect-t2w-preproc
Collect preprocessed T2w image in collect_derivatives
2 parents bf1df32 + 93cb2ee commit 5c8ef24

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/smriprep/data/io_spec.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@
4444
".nii.gz",
4545
".nii"
4646
]
47+
},
48+
"t2w_preproc": {
49+
"datatype": "anat",
50+
"space": null,
51+
"desc": "preproc",
52+
"suffix": "T2w",
53+
"extension": [
54+
".nii.gz",
55+
".nii"
56+
]
4757
}
4858
},
4959
"transforms": {

src/smriprep/utils/bids.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ def collect_derivatives(
7070

7171
paths = [item.path for item in item]
7272

73-
derivs_cache[f't1w_{key}'] = paths[0] if len(paths) == 1 else paths
73+
if not key.startswith('t2w_'):
74+
key = f't1w_{key}'
75+
derivs_cache[key] = paths[0] if len(paths) == 1 else paths
7476

7577
transforms = derivs_cache.setdefault('transforms', {})
7678
for _space in std_spaces:

0 commit comments

Comments
 (0)