From 4a8a782ef603fc6049c037454c809f54f9875529 Mon Sep 17 00:00:00 2001 From: mathiasg Date: Fri, 26 Jul 2024 15:44:52 -0400 Subject: [PATCH] ENH: Require specifying image type for various datasink workflows --- smriprep/workflows/anatomical.py | 12 ++++++++---- smriprep/workflows/outputs.py | 6 +++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/smriprep/workflows/anatomical.py b/smriprep/workflows/anatomical.py index b4943275fd..78e19ad8bd 100644 --- a/smriprep/workflows/anatomical.py +++ b/smriprep/workflows/anatomical.py @@ -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([ @@ -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([ @@ -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, [ @@ -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', ): """ diff --git a/smriprep/workflows/outputs.py b/smriprep/workflows/outputs.py index 67cd236492..0396a8000c 100644 --- a/smriprep/workflows/outputs.py +++ b/smriprep/workflows/outputs.py @@ -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', ): """ @@ -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', ): """ @@ -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', ): """