Skip to content

Commit d2de7ba

Browse files
committed
RF: Remove third mask since SyN is currently 2 steps
1 parent d32bcdc commit d2de7ba

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

sdcflows/workflows/fit/syn.py

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"""
2424
Estimating the susceptibility distortions without fieldmaps.
2525
"""
26+
2627
from nipype.pipeline import engine as pe
2728
from nipype.interfaces import utility as niu
2829
from nipype.interfaces.base import Undefined
@@ -120,7 +121,6 @@ def init_syn_sdc_wf(
120121
FixHeaderRegistration as Registration,
121122
)
122123
from niworkflows.interfaces.nibabel import (
123-
Binarize,
124124
IntensityClip,
125125
RegridToZooms,
126126
)
@@ -174,7 +174,6 @@ def init_syn_sdc_wf(
174174
name="warp_dir",
175175
)
176176
warp_dir.inputs.nlevels = 2
177-
atlas_msk = pe.Node(Binarize(thresh_low=atlas_threshold), name="atlas_msk")
178177
anat_dilmsk = pe.Node(BinaryDilation(), name="anat_dilmsk")
179178
amask2epi = pe.Node(
180179
ApplyTransforms(interpolation="MultiLabel", transforms="identity"),
@@ -211,7 +210,7 @@ def init_syn_sdc_wf(
211210
)
212211

213212
fixed_masks = pe.Node(
214-
niu.Merge(3),
213+
niu.Merge(2),
215214
name="fixed_masks",
216215
mem_gb=DEFAULT_MEMORY_MIN_GB,
217216
run_without_submitting=True,
@@ -223,9 +222,7 @@ def init_syn_sdc_wf(
223222

224223
# SyN Registration Core
225224
syn = pe.Node(
226-
Registration(
227-
from_file=data.load(f"sd_syn{'_sloppy' * sloppy}.json")
228-
),
225+
Registration(from_file=data.load(f"sd_syn{'_sloppy' * sloppy}.json")),
229226
name="syn",
230227
n_procs=omp_nthreads,
231228
)
@@ -236,9 +233,7 @@ def init_syn_sdc_wf(
236233
syn.inputs.args = "--write-interval-volumes 2"
237234

238235
# Extract the corresponding fieldmap in Hz
239-
extract_field = pe.Node(
240-
DisplacementsField2Fieldmap(), name="extract_field"
241-
)
236+
extract_field = pe.Node(DisplacementsField2Fieldmap(), name="extract_field")
242237

243238
unwarp = pe.Node(ApplyCoeffsField(jacobian=False), name="unwarp")
244239

@@ -267,14 +262,6 @@ def init_syn_sdc_wf(
267262
if sloppy:
268263
bs_filter.inputs.zooms_min = 4.0
269264

270-
if sd_prior:
271-
workflow.connect([
272-
(inputnode, atlas_msk, [("sd_prior", "in_file")]),
273-
(atlas_msk, fixed_masks, [("out_mask", "in3")]),
274-
]) # fmt:skip
275-
else:
276-
workflow.connect(inputnode, "anat_mask", fixed_masks, "in3")
277-
278265
workflow.connect([
279266
(inputnode, readout_time, [(("epi_ref", _pop), "in_file"),
280267
(("epi_ref", _pull), "metadata")]),
@@ -504,7 +491,9 @@ def _remove_first_mask(in_file):
504491
mem_gb=DEFAULT_MEMORY_MIN_GB,
505492
run_without_submitting=True,
506493
)
507-
transform_list.inputs.in3 = data.load("fmap_atlas_2_MNI152NLin2009cAsym_affine.mat")
494+
transform_list.inputs.in3 = data.load(
495+
"fmap_atlas_2_MNI152NLin2009cAsym_affine.mat"
496+
)
508497
prior2epi = pe.Node(
509498
ApplyTransforms(
510499
invert_transform_flags=[True, False, False],

0 commit comments

Comments
 (0)