|
18 | 18 | N4BiasFieldCorrection,
|
19 | 19 | ThresholdImage,
|
20 | 20 | )
|
21 |
| -from nipype.interfaces.ants.utils import AI, ResampleImageBySpacing |
| 21 | +from nipype.interfaces.ants.utils import AI |
22 | 22 |
|
23 | 23 | from ..utils.misc import get_template_specs
|
24 | 24 | from ..utils.connections import pop_file as _pop
|
25 | 25 |
|
26 | 26 | # niworkflows
|
27 |
| -from ..interfaces.nibabel import ApplyMask |
28 | 27 | from ..interfaces.ants import ImageMath
|
29 | 28 | from ..interfaces.fixes import (
|
30 | 29 | FixHeaderRegistration as Registration,
|
31 | 30 | FixHeaderApplyTransforms as ApplyTransforms,
|
32 | 31 | )
|
33 |
| -from ..interfaces.nibabel import Binarize |
| 32 | +from ..interfaces.images import RegridToZooms |
| 33 | +from ..interfaces.nibabel import ApplyMask, Binarize |
34 | 34 |
|
35 | 35 |
|
36 | 36 | ATROPOS_MODELS = {
|
@@ -221,15 +221,9 @@ def init_brain_extraction_wf(
|
221 | 221 | iterfield=["input_image"],
|
222 | 222 | )
|
223 | 223 |
|
224 |
| - res_tmpl = pe.Node( |
225 |
| - ResampleImageBySpacing(out_spacing=(4, 4, 4), apply_smoothing=True), |
226 |
| - name="res_tmpl", |
227 |
| - ) |
228 |
| - res_tmpl.inputs.input_image = tpl_target_path |
229 |
| - res_target = pe.Node( |
230 |
| - ResampleImageBySpacing(out_spacing=(4, 4, 4), apply_smoothing=True), |
231 |
| - name="res_target", |
232 |
| - ) |
| 224 | + res_tmpl = pe.Node(RegridToZooms(in_file=tpl_target_path, zooms=(4, 4, 4), smooth=True), |
| 225 | + name="res_tmpl") |
| 226 | + res_target = pe.Node(RegridToZooms(zooms=(4, 4, 4), smooth=True), name="res_target") |
233 | 227 |
|
234 | 228 | lap_tmpl = pe.Node(ImageMath(operation="Laplacian", op2="1.5 1"), name="lap_tmpl")
|
235 | 229 | lap_tmpl.inputs.op1 = tpl_target_path
|
@@ -337,9 +331,9 @@ def init_brain_extraction_wf(
|
337 | 331 | (inputnode, norm, [("in_mask", fixed_mask_trait)]),
|
338 | 332 | (inputnode, map_brainmask, [(("in_files", _pop), "reference_image")]),
|
339 | 333 | (trunc, inu_n4, [("output_image", "input_image")]),
|
340 |
| - (inu_n4, res_target, [(("output_image", _pop), "input_image")]), |
341 |
| - (res_tmpl, init_aff, [("output_image", "fixed_image")]), |
342 |
| - (res_target, init_aff, [("output_image", "moving_image")]), |
| 334 | + (inu_n4, res_target, [(("output_image", _pop), "in_file")]), |
| 335 | + (res_tmpl, init_aff, [("out_file", "fixed_image")]), |
| 336 | + (res_target, init_aff, [("out_file", "moving_image")]), |
343 | 337 | (init_aff, norm, [("output_transform", "initial_moving_transform")]),
|
344 | 338 | (norm, map_brainmask, [
|
345 | 339 | ("reverse_transforms", "transforms"),
|
|
0 commit comments