Skip to content

Commit bd95dd8

Browse files
authored
Merge pull request #292 from nipreps/fix/coreg-connection
FIX: Remove duplicated connections
2 parents 8994800 + 296d8f8 commit bd95dd8

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

nibabies/config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,12 @@ class execution(_Config):
454454
@classmethod
455455
def init(cls):
456456
"""Create a new BIDS Layout accessible with :attr:`~execution.layout`."""
457+
# Convert string literal None to NoneType
458+
if cls.unique_labels:
459+
cls.unique_labels = [
460+
[sub, ses] if ses != 'None' else [sub, None] for sub, ses in cls.unique_labels
461+
]
462+
457463
if cls.fs_license_file and Path(cls.fs_license_file).is_file():
458464
os.environ["FS_LICENSE"] = str(cls.fs_license_file)
459465

nibabies/workflows/anatomical/base.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,8 @@ def init_infant_anat_wf(
365365
)
366366
# fmt:off
367367
wf.connect([
368-
(t1w_preproc_wf, brain_extraction_wf, [
369-
("outputnode.anat_preproc", "inputnode.in_t1w")]),
370368
(t2w_preproc_wf, brain_extraction_wf, [
371-
("outputnode.anat_preproc", "inputnode.in_t2w")]),
369+
("outputnode.anat_preproc", "inputnode.t2w_preproc")]),
372370
(brain_extraction_wf, coregistration_wf, [
373371
("outputnode.t2w_preproc", "inputnode.in_t2w"),
374372
("outputnode.out_mask", "inputnode.in_mask"),

nibabies/workflows/anatomical/brain_extraction.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def init_infant_brain_extraction_wf(
107107

108108
inputnode = pe.Node(niu.IdentityInterface(fields=["t2w_preproc"]), name="inputnode")
109109
outputnode = pe.Node(
110-
niu.IdentityInterface(fields=["t2w_brain", "out_mask", "out_probmap"]),
110+
niu.IdentityInterface(fields=["t2w_preproc", "t2w_brain", "out_mask", "out_probmap"]),
111111
name="outputnode",
112112
)
113113

@@ -182,9 +182,9 @@ def init_infant_brain_extraction_wf(
182182
workflow.connect([
183183
(inputnode, final_n4, [("t2w_preproc", "input_image")]),
184184
# 1. Massage T2w
185-
(inputnode, mrg_t2w, [("in_t2w", "in1")]),
186-
(inputnode, lap_t2w, [("in_t2w", "op1")]),
187-
(inputnode, map_mask_t2w, [("in_t2w", "reference_image")]),
185+
(inputnode, mrg_t2w, [("t2w_preproc", "in1")]),
186+
(inputnode, lap_t2w, [("t2w_preproc", "op1")]),
187+
(inputnode, map_mask_t2w, [("t2w_preproc", "reference_image")]),
188188
(bin_regmask, refine_mask, [("out_file", "in_file")]),
189189
(refine_mask, fixed_masks, [("out_file", "in4")]),
190190
(lap_t2w, norm_lap_t2w, [("output_image", "in_file")]),
@@ -241,7 +241,7 @@ def init_infant_brain_extraction_wf(
241241
# fmt:off
242242
workflow.connect([
243243
(clip_tmpl, init_aff, [("out_file", "fixed_image")]),
244-
(inputnode, init_aff, [("in_t2w", "moving_image")]),
244+
(inputnode, init_aff, [("t2w_preproc", "moving_image")]),
245245
(init_aff, norm, [("output_transform", "initial_moving_transform")]),
246246
])
247247
# fmt:on

nibabies/workflows/anatomical/registration.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,6 @@ def init_coregistration_wf(
203203
("reverse_invert_flags", "invert_transform_flags")]),
204204
(map_mask, thr_mask, [("output_image", "in_file")]),
205205
(map_mask, final_n4, [("output_image", "weight_image")]),
206-
(final_n4, apply_mask, [("output_image", "in_file")]),
207-
(final_n4, outputnode, [("output_image", "t1w_preproc")]),
208206
(thr_mask, outputnode, [("out_mask", "t1w_mask")]),
209207
(thr_mask, apply_mask, [("out_mask", "in_mask")]),
210208
])

0 commit comments

Comments
 (0)