Skip to content

Commit ec29954

Browse files
committed
FIX: Remove derivative processing from preproc workflow, do not regrid
1 parent 9734973 commit ec29954

File tree

1 file changed

+3
-35
lines changed

1 file changed

+3
-35
lines changed

nibabies/workflows/anatomical/preproc.py

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
def init_anat_preproc_wf(
77
*,
88
bspline_fitting_distance: int = 200,
9-
precomputed_mask: bool = False,
10-
precomputed_aseg: bool = False,
119
name: str = "anat_preproc_wf",
1210
) -> LiterateWorkflow:
1311
"""Polish up raw anatomical data.
@@ -32,15 +30,15 @@ def init_anat_preproc_wf(
3230
"""
3331
from nipype.interfaces.ants import DenoiseImage, N4BiasFieldCorrection
3432
from niworkflows.interfaces.header import ValidateImage
35-
from niworkflows.interfaces.nibabel import IntensityClip, RegridToZooms
33+
from niworkflows.interfaces.nibabel import IntensityClip
3634

3735
wf = LiterateWorkflow(name=name)
3836
inputnode = pe.Node(
39-
niu.IdentityInterface(fields=["in_anat", "in_mask", "in_aseg"]),
37+
niu.IdentityInterface(fields=["in_anat"]),
4038
name="inputnode",
4139
)
4240
outputnode = pe.Node(
43-
niu.IdentityInterface(fields=["anat_preproc", "anat_mask", "anat_aseg"]),
41+
niu.IdentityInterface(fields=["anat_preproc"]),
4442
name="outputnode",
4543
)
4644

@@ -61,32 +59,8 @@ def init_anat_preproc_wf(
6159
),
6260
name="n4_correct",
6361
)
64-
6562
final_clip = pe.Node(IntensityClip(p_min=5.0, p_max=99.5), name="final_clip")
6663

67-
if precomputed_mask:
68-
validate_mask = pe.Node(ValidateImage(), name="validate_mask")
69-
regrid_mask = pe.Node(RegridToZooms(), name="regrid_mask")
70-
# fmt:off
71-
wf.connect([
72-
(inputnode, validate_mask, [("in_mask", "in_file")]),
73-
(validate_mask, regrid_mask, [("out_file", "in_file")]),
74-
(final_clip, regrid_mask, [(("out_file", _get_zooms), "zooms")]),
75-
(regrid_mask, outputnode, [("out_file", "anat_mask")]),
76-
])
77-
# fmt:on
78-
if precomputed_aseg:
79-
validate_aseg = pe.Node(ValidateImage(), name="validate_aseg")
80-
regrid_aseg = pe.Node(RegridToZooms(), name="regrid_aseg")
81-
# fmt:off
82-
wf.connect([
83-
(inputnode, validate_aseg, [("in_aseg", "in_file")]),
84-
(validate_aseg, regrid_aseg, [("out_file", "in_file")]),
85-
(final_clip, regrid_aseg, [(("out_file", _get_zooms), "zooms")]),
86-
(regrid_aseg, outputnode, [("out_file", "anat_aseg")]),
87-
])
88-
# fmt:on
89-
9064
# fmt:off
9165
wf.connect([
9266
(inputnode, validate, [("in_anat", "in_file")]),
@@ -98,9 +72,3 @@ def init_anat_preproc_wf(
9872
])
9973
# fmt:on
10074
return wf
101-
102-
103-
def _get_zooms(in_file):
104-
import nibabel as nb
105-
106-
return tuple(nb.load(in_file).header.get_zooms()[:3])

0 commit comments

Comments
 (0)