|
35 | 35 | from ..interfaces import DerivativesDataSink
|
36 | 36 | from ..interfaces.templateflow import TemplateFlowSelect
|
37 | 37 |
|
| 38 | +if ty.TYPE_CHECKING: |
| 39 | + from niworkflows.utils.spaces import SpatialReferences |
| 40 | + |
38 | 41 | BIDS_TISSUE_ORDER = ('GM', 'WM', 'CSF')
|
39 | 42 |
|
40 | 43 |
|
41 |
| -def init_anat_reports_wf(*, spaces, freesurfer, output_dir, name='anat_reports_wf'): |
| 44 | +def init_anat_reports_wf(*, spaces, freesurfer, output_dir, sloppy=False, name='anat_reports_wf'): |
42 | 45 | """
|
43 | 46 | Set up a battery of datasinks to store reports in the right location.
|
44 | 47 |
|
@@ -131,7 +134,7 @@ def init_anat_reports_wf(*, spaces, freesurfer, output_dir, name='anat_reports_w
|
131 | 134 | # fmt:on
|
132 | 135 |
|
133 | 136 | if spaces._cached is not None and spaces.cached.references:
|
134 |
| - template_iterator_wf = init_template_iterator_wf(spaces=spaces) |
| 137 | + template_iterator_wf = init_template_iterator_wf(spaces=spaces, sloppy=sloppy) |
135 | 138 | t1w_std = pe.Node(
|
136 | 139 | ApplyTransforms(
|
137 | 140 | dimension=3,
|
@@ -1112,7 +1115,12 @@ def init_anat_second_derivatives_wf(
|
1112 | 1115 | return workflow
|
1113 | 1116 |
|
1114 | 1117 |
|
1115 |
| -def init_template_iterator_wf(*, spaces, name='template_iterator_wf'): |
| 1118 | +def init_template_iterator_wf( |
| 1119 | + *, |
| 1120 | + spaces: 'SpatialReferences', |
| 1121 | + sloppy: bool = False, |
| 1122 | + name='template_iterator_wf' |
| 1123 | +): |
1116 | 1124 | """Prepare the necessary components to resample an image to a template space
|
1117 | 1125 |
|
1118 | 1126 | This produces a workflow with an unjoined iterable named "spacesource".
|
@@ -1160,7 +1168,7 @@ def init_template_iterator_wf(*, spaces, name='template_iterator_wf'):
|
1160 | 1168 | run_without_submitting=True,
|
1161 | 1169 | )
|
1162 | 1170 | select_tpl = pe.Node(
|
1163 |
| - TemplateFlowSelect(resolution=1), name='select_tpl', run_without_submitting=True |
| 1171 | + TemplateFlowSelect(resolution=2 if sloppy else 1), name='select_tpl', run_without_submitting=True |
1164 | 1172 | )
|
1165 | 1173 |
|
1166 | 1174 | # fmt:off
|
|
0 commit comments