Skip to content

Commit

Permalink
FIX: Connections for T1-only
Browse files Browse the repository at this point in the history
  • Loading branch information
mgxd committed Nov 8, 2023
1 parent 4b715c9 commit 6c38c07
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
15 changes: 9 additions & 6 deletions nibabies/workflows/anatomical/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,12 +463,10 @@ def init_infant_anat_wf(
# M-CRIB-S to dHCP42week (32k)
sphere_reg_wf = init_mcribs_sphere_reg_wf()

# fmt:off
wf.connect([
(t2w_template_wf, denoise_t2w, [('outputnode.anat_ref', 'input_image')]),
(denoise_t2w, surface_recon_wf, [('output_image', 'inputnode.t2w')]),
])
# fmt:on
]) # fmt:skip
if derivatives.aseg:
wf.connect(deriv_buffer, 't2w_aseg', surface_recon_wf, 'inputnode.ants_segs')
if derivatives.mask:
Expand Down Expand Up @@ -811,7 +809,7 @@ def init_infant_single_anat_wf(
if not recon_method:
return workflow

Check warning on line 810 in nibabies/workflows/anatomical/base.py

View check run for this annotation

Codecov / codecov/patch

nibabies/workflows/anatomical/base.py#L809-L810

Added lines #L809 - L810 were not covered by tests

elif recon_method == 'freesurfer':
if recon_method == 'freesurfer':
from smriprep.workflows.surfaces import init_surface_recon_wf

Check warning on line 813 in nibabies/workflows/anatomical/base.py

View check run for this annotation

Codecov / codecov/patch

nibabies/workflows/anatomical/base.py#L812-L813

Added lines #L812 - L813 were not covered by tests

surface_recon_wf = init_surface_recon_wf(omp_nthreads=omp_nthreads, hires=hires)
Expand Down Expand Up @@ -853,6 +851,12 @@ def init_infant_single_anat_wf(
else:
raise NotImplementedError

Check warning on line 852 in nibabies/workflows/anatomical/base.py

View check run for this annotation

Codecov / codecov/patch

nibabies/workflows/anatomical/base.py#L852

Added line #L852 was not covered by tests

if recon_method in ('freesurfer', 'infantfs'):
from smriprep.workflows.surfaces import init_sphere_reg_wf

Check warning on line 855 in nibabies/workflows/anatomical/base.py

View check run for this annotation

Codecov / codecov/patch

nibabies/workflows/anatomical/base.py#L854-L855

Added lines #L854 - L855 were not covered by tests

# fsaverage to fsLR
sphere_reg_wf = init_sphere_reg_wf()

Check warning on line 858 in nibabies/workflows/anatomical/base.py

View check run for this annotation

Codecov / codecov/patch

nibabies/workflows/anatomical/base.py#L858

Added line #L858 was not covered by tests

# Anatomical ribbon file using HCP signed-distance volume method
anat_ribbon_wf = init_anat_ribbon_wf()

Check warning on line 861 in nibabies/workflows/anatomical/base.py

View check run for this annotation

Codecov / codecov/patch

nibabies/workflows/anatomical/base.py#L861

Added line #L861 was not covered by tests

Expand All @@ -865,8 +869,7 @@ def init_infant_single_anat_wf(
("outputnode.anat_ref", "inputnode.t1w"),
]),
(mask_buffer, surface_recon_wf, [
("anat_brain", "inputnode.skullstripped_t1"),
("anat_mask", "inputnode.anat_mask")]),
("anat_brain", "inputnode.skullstripped_t1")]),
(anat_preproc_wf, surface_recon_wf, [
("outputnode.anat_preproc", "inputnode.corrected_t1")]),
(surface_recon_wf, outputnode, [
Expand Down
1 change: 0 additions & 1 deletion nibabies/workflows/anatomical/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ def init_anat_derivatives_wf(
# fmt:on

if num_t2w:

if not num_t1w:
raw_sources = pe.Node(niu.Function(function=_bids_relative), name="t2w_raw_sources")
raw_sources.inputs.bids_root = bids_root

Check warning on line 429 in nibabies/workflows/anatomical/outputs.py

View check run for this annotation

Codecov / codecov/patch

nibabies/workflows/anatomical/outputs.py#L426-L429

Added lines #L426 - L429 were not covered by tests
Expand Down

0 comments on commit 6c38c07

Please sign in to comment.