Skip to content

Commit

Permalink
ENH: Require specifying image type for various datasink workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mgxd committed Jul 26, 2024
1 parent 0e1b7cb commit 4a8a782
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 8 additions & 4 deletions smriprep/workflows/anatomical.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,9 @@ def init_anat_fit_wf(
image_type='T1w',
name='anat_template_wf',
)
ds_template_wf = init_ds_template_wf(output_dir=output_dir, num_anat=num_t1w)
ds_template_wf = init_ds_template_wf(
output_dir=output_dir, num_anat=num_t1w, image_type='T1w'
)

# fmt:off
workflow.connect([
Expand Down Expand Up @@ -992,7 +994,9 @@ def init_anat_fit_wf(
omp_nthreads=omp_nthreads,
templates=templates,
)
ds_template_registration_wf = init_ds_template_registration_wf(output_dir=output_dir)
ds_template_registration_wf = init_ds_template_registration_wf(
output_dir=output_dir, image_type='T1w'
)

# fmt:off
workflow.connect([
Expand Down Expand Up @@ -1075,7 +1079,7 @@ def init_anat_fit_wf(

fsnative_xfms = precomputed.get('transforms', {}).get('fsnative')
if not fsnative_xfms:
ds_fs_registration_wf = init_ds_fs_registration_wf(output_dir=output_dir)
ds_fs_registration_wf = init_ds_fs_registration_wf(output_dir=output_dir, image_type='T1w')
# fmt:off
workflow.connect([
(sourcefile_buffer, ds_fs_registration_wf, [
Expand Down Expand Up @@ -1365,7 +1369,7 @@ def init_anat_template_wf(
longitudinal: bool,
omp_nthreads: int,
num_files: int,
image_type: ty.Literal['T1w', 'T2w'] = 'T1w',
image_type: ty.Literal['T1w', 'T2w'],
name: str = 'anat_template_wf',
):
"""
Expand Down
6 changes: 3 additions & 3 deletions smriprep/workflows/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def init_ds_template_wf(
*,
num_anat: int,
output_dir: str,
image_type: str = 'T1w',
image_type: ty.Literal['T1w', 'T2w'],
name: str = 'ds_template_wf',
):
"""
Expand Down Expand Up @@ -532,7 +532,7 @@ def init_ds_tpms_wf(
def init_ds_template_registration_wf(
*,
output_dir: str,
image_type: ty.Literal['T1w', 'T2w'] = 'T1w',
image_type: ty.Literal['T1w', 'T2w'],
name: str = 'ds_template_registration_wf',
):
"""
Expand Down Expand Up @@ -618,7 +618,7 @@ def init_ds_template_registration_wf(
def init_ds_fs_registration_wf(
*,
output_dir: str,
image_type: ty.Literal['T1w', 'T2w'] = 'T1w',
image_type: ty.Literal['T1w', 'T2w'],
name: str = 'ds_fs_registration_wf',
):
"""
Expand Down

0 comments on commit 4a8a782

Please sign in to comment.