Skip to content

Commit 7188439

Browse files
mgxdeffigies
authored andcommitted
FIX: Ensure sloppy resolution is used
1 parent f30c2fd commit 7188439

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

smriprep/workflows/anatomical.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def init_anat_preproc_wf(
277277
omp_nthreads=omp_nthreads,
278278
skull_strip_fixed_seed=skull_strip_fixed_seed,
279279
)
280-
template_iterator_wf = init_template_iterator_wf(spaces=spaces)
280+
template_iterator_wf = init_template_iterator_wf(spaces=spaces, sloppy=sloppy)
281281
ds_std_volumes_wf = init_ds_anat_volumes_wf(
282282
bids_root=bids_root,
283283
output_dir=output_dir,
@@ -725,6 +725,7 @@ def init_anat_fit_wf(
725725
spaces=spaces,
726726
freesurfer=freesurfer,
727727
output_dir=output_dir,
728+
sloppy=sloppy,
728729
)
729730
# fmt:off
730731
workflow.connect([

smriprep/workflows/outputs.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@
3535
from ..interfaces import DerivativesDataSink
3636
from ..interfaces.templateflow import TemplateFlowSelect
3737

38+
if ty.TYPE_CHECKING:
39+
from niworkflows.utils.spaces import SpatialReferences
40+
3841
BIDS_TISSUE_ORDER = ('GM', 'WM', 'CSF')
3942

4043

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'):
4245
"""
4346
Set up a battery of datasinks to store reports in the right location.
4447
@@ -131,7 +134,7 @@ def init_anat_reports_wf(*, spaces, freesurfer, output_dir, name='anat_reports_w
131134
# fmt:on
132135

133136
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)
135138
t1w_std = pe.Node(
136139
ApplyTransforms(
137140
dimension=3,
@@ -1112,7 +1115,12 @@ def init_anat_second_derivatives_wf(
11121115
return workflow
11131116

11141117

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+
):
11161124
"""Prepare the necessary components to resample an image to a template space
11171125
11181126
This produces a workflow with an unjoined iterable named "spacesource".
@@ -1160,7 +1168,7 @@ def init_template_iterator_wf(*, spaces, name='template_iterator_wf'):
11601168
run_without_submitting=True,
11611169
)
11621170
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
11641172
)
11651173

11661174
# fmt:off

0 commit comments

Comments
 (0)