Skip to content

Commit ab36915

Browse files
authored
Merge pull request #1305 from poldracklab/fix/structural_reference
[FIX] Create template from one usable T1w image
2 parents 26e0f44 + 3e55760 commit ab36915

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

fmriprep/workflows/anatomical.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
from ..engine import Workflow
4646
from ..interfaces import (
47-
DerivativesDataSink, MakeMidthickness, FSInjectBrainExtracted,
47+
DerivativesDataSink, StructuralReference, MakeMidthickness, FSInjectBrainExtracted,
4848
FSDetectInputs, NormalizeSurf, GiftiNameSource, TemplateDimensions, Conform,
4949
ConcatAffines, RefineBrainMask,
5050
)
@@ -521,15 +521,16 @@ def _get_first(in_list):
521521
N4BiasFieldCorrection(dimension=3, copy_header=True),
522522
iterfield='input_image', name='n4_correct',
523523
n_procs=1) # n_procs=1 for reproducibility
524+
# StructuralReference is fs.RobustTemplate if > 1 volume, copying otherwise
524525
t1_merge = pe.Node(
525-
fs.RobustTemplate(auto_detect_sensitivity=True,
526-
initial_timepoint=1, # For deterministic behavior
527-
intensity_scaling=True, # 7-DOF (rigid + intensity)
528-
subsample_threshold=200,
529-
fixed_timepoint=not longitudinal,
530-
no_iteration=not longitudinal,
531-
transform_outputs=True,
532-
),
526+
StructuralReference(auto_detect_sensitivity=True,
527+
initial_timepoint=1, # For deterministic behavior
528+
intensity_scaling=True, # 7-DOF (rigid + intensity)
529+
subsample_threshold=200,
530+
fixed_timepoint=not longitudinal,
531+
no_iteration=not longitudinal,
532+
transform_outputs=True,
533+
),
533534
mem_gb=2 * num_t1w - 1,
534535
name='t1_merge')
535536

0 commit comments

Comments
 (0)