Skip to content

Commit 4a8a782

Browse files
committed
ENH: Require specifying image type for various datasink workflows
1 parent 0e1b7cb commit 4a8a782

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

smriprep/workflows/anatomical.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,9 @@ def init_anat_fit_wf(
762762
image_type='T1w',
763763
name='anat_template_wf',
764764
)
765-
ds_template_wf = init_ds_template_wf(output_dir=output_dir, num_anat=num_t1w)
765+
ds_template_wf = init_ds_template_wf(
766+
output_dir=output_dir, num_anat=num_t1w, image_type='T1w'
767+
)
766768

767769
# fmt:off
768770
workflow.connect([
@@ -992,7 +994,9 @@ def init_anat_fit_wf(
992994
omp_nthreads=omp_nthreads,
993995
templates=templates,
994996
)
995-
ds_template_registration_wf = init_ds_template_registration_wf(output_dir=output_dir)
997+
ds_template_registration_wf = init_ds_template_registration_wf(
998+
output_dir=output_dir, image_type='T1w'
999+
)
9961000

9971001
# fmt:off
9981002
workflow.connect([
@@ -1075,7 +1079,7 @@ def init_anat_fit_wf(
10751079

10761080
fsnative_xfms = precomputed.get('transforms', {}).get('fsnative')
10771081
if not fsnative_xfms:
1078-
ds_fs_registration_wf = init_ds_fs_registration_wf(output_dir=output_dir)
1082+
ds_fs_registration_wf = init_ds_fs_registration_wf(output_dir=output_dir, image_type='T1w')
10791083
# fmt:off
10801084
workflow.connect([
10811085
(sourcefile_buffer, ds_fs_registration_wf, [
@@ -1365,7 +1369,7 @@ def init_anat_template_wf(
13651369
longitudinal: bool,
13661370
omp_nthreads: int,
13671371
num_files: int,
1368-
image_type: ty.Literal['T1w', 'T2w'] = 'T1w',
1372+
image_type: ty.Literal['T1w', 'T2w'],
13691373
name: str = 'anat_template_wf',
13701374
):
13711375
"""

smriprep/workflows/outputs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def init_ds_template_wf(
232232
*,
233233
num_anat: int,
234234
output_dir: str,
235-
image_type: str = 'T1w',
235+
image_type: ty.Literal['T1w', 'T2w'],
236236
name: str = 'ds_template_wf',
237237
):
238238
"""
@@ -532,7 +532,7 @@ def init_ds_tpms_wf(
532532
def init_ds_template_registration_wf(
533533
*,
534534
output_dir: str,
535-
image_type: ty.Literal['T1w', 'T2w'] = 'T1w',
535+
image_type: ty.Literal['T1w', 'T2w'],
536536
name: str = 'ds_template_registration_wf',
537537
):
538538
"""
@@ -618,7 +618,7 @@ def init_ds_template_registration_wf(
618618
def init_ds_fs_registration_wf(
619619
*,
620620
output_dir: str,
621-
image_type: ty.Literal['T1w', 'T2w'] = 'T1w',
621+
image_type: ty.Literal['T1w', 'T2w'],
622622
name: str = 'ds_fs_registration_wf',
623623
):
624624
"""

0 commit comments

Comments
 (0)