Skip to content

Commit 5f16386

Browse files
committed
♻️ Just use longitudinal-template_space-longitudinal_desc-head_T1w instead of reorient
1 parent 4ba04c5 commit 5f16386

File tree

3 files changed

+5
-37
lines changed

3 files changed

+5
-37
lines changed

CPAC/longitudinal/wf/anat.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from networkx.classes.digraph import DiGraph
2323
from nipype import config as nipype_config
2424
from nipype.interfaces import fsl
25-
from nipype.interfaces.utility import IdentityInterface, Merge
25+
from nipype.interfaces.utility import Merge
2626

2727
from CPAC.longitudinal.preproc import subject_specific_template
2828
from CPAC.longitudinal.robust_template import mri_robust_template
@@ -454,9 +454,6 @@ def anat_longitudinal_wf(
454454
)
455455
raise ValueError(msg)
456456

457-
reorient_T1w = pe.Node(IdentityInterface(fields=[head_output]), "reorient_T1w")
458-
wf.connect(wholehead_template_node, head_output, reorient_T1w, head_output)
459-
460457
rpool.set_data(
461458
"longitudinal-template_space-longitudinal_desc-brain_T1w",
462459
brain_template_node,
@@ -473,14 +470,6 @@ def anat_longitudinal_wf(
473470
"",
474471
wholehead_template_node.name,
475472
)
476-
rpool.set_data(
477-
"longitudinal-template_space-longitudinal_desc-reorient_T1w",
478-
reorient_T1w,
479-
head_output,
480-
{},
481-
"",
482-
reorient_T1w.name,
483-
)
484473

485474
pipeline_blocks = [mask_longitudinal_T1w_brain]
486475
pipeline_blocks = build_T1w_registration_stack(
@@ -493,7 +482,6 @@ def anat_longitudinal_wf(
493482
"longitudinal-template_space-longitudinal_desc-brain_mask",
494483
"longitudinal-template_space-longitudinal_desc-brain_T1w",
495484
"longitudinal-template_space-longitudinal_desc-head_T1w",
496-
"longitudinal-template_space-longitudinal_desc-reorient_T1w",
497485
]
498486
rpool.gather_pipes(wf, config)
499487
wf = connect_pipeline(wf, config, rpool, pipeline_blocks)

CPAC/registration/longitudinal.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ def get_common_reg_inputs(
4848
"longitudinal-template_space-longitudinal_desc-brain_T1w"
4949
)
5050
input_head = strat_pool.node_data(
51-
[
52-
"longitudinal-template_space-longitudinal_desc-head_T1w",
53-
"longitudinal-template_space-longitudinal_desc-reorient_T1w",
54-
]
51+
"longitudinal-template_space-longitudinal_desc-head_T1w"
5552
)
5653
reference_mask = strat_pool.node_data(
5754
"longitudinal-template_space-longitudinal_desc-brain_mask"
@@ -82,10 +79,7 @@ def get_common_reg_inputs(
8279
"longitudinal-template_space-longitudinal_desc-brain_T1w"
8380
)
8481
t1w_template = strat_pool.node_data(
85-
[
86-
"longitudinal-template_space-longitudinal_desc-head_T1w",
87-
"longitudinal-template_space-longitudinal_desc-reorient_T1w",
88-
]
82+
"longitudinal-template_space-longitudinal_desc-head_T1w"
8983
)
9084
else:
9185
t1w_brain_template = strat_pool.node_data(

CPAC/registration/registration.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,6 @@ def bold_to_T1template_xfm_connector(
17041704
(
17051705
[
17061706
"desc-preproc_T1w",
1707-
"longitudinal-template_space-longitudinal_desc-reorient_T1w",
17081707
"longitudinal-template_space-longitudinal_desc-head_T1w",
17091708
],
17101709
[
@@ -1768,7 +1767,6 @@ def register_FSL_anat_to_template(wf, cfg, strat_pool, pipe_num, opt=None):
17681767
node, out = strat_pool.get_data(
17691768
[
17701769
"desc-preproc_T1w",
1771-
"longitudinal-template_space-longitudinal_desc-reorient_T1w",
17721770
"longitudinal-template_space-longitudinal_desc-head_T1w",
17731771
]
17741772
)
@@ -1801,7 +1799,6 @@ def register_FSL_anat_to_template(wf, cfg, strat_pool, pipe_num, opt=None):
18011799
(
18021800
[
18031801
"desc-preproc_T1w",
1804-
"longitudinal-template_space-longitudinal_desc-reorient_T1w",
18051802
"longitudinal-template_space-longitudinal_desc-head_T1w",
18061803
],
18071804
[
@@ -1850,7 +1847,6 @@ def register_symmetric_FSL_anat_to_template(wf, cfg, strat_pool, pipe_num, opt=N
18501847
node, out = strat_pool.get_data(
18511848
[
18521849
"desc-preproc_T1w",
1853-
"longitudinal-template_space-longitudinal_desc-reorient_T1w",
18541850
"longitudinal-template_space-longitudinal_desc-head_T1w",
18551851
]
18561852
)
@@ -1926,10 +1922,6 @@ def register_FSL_EPI_to_template(wf, cfg, strat_pool, pipe_num, opt=None):
19261922
return (wf, outputs)
19271923

19281924

1929-
def _gather_longitudinal_nodedata(strat_pool: "ResourcePool") -> tuple:
1930-
"""Gather common NodeData for longitudinal registration."""
1931-
1932-
19331925
@nodeblock(
19341926
name="register_ANTs_anat_to_template",
19351927
config=["registration_workflows", "anatomical_registration"],
@@ -1950,10 +1942,7 @@ def _gather_longitudinal_nodedata(strat_pool: "ResourcePool") -> tuple:
19501942
"desc-head_T1w",
19511943
"desc-preproc_T1w",
19521944
],
1953-
[
1954-
"longitudinal-template_space-longitudinal_desc-head_T1w",
1955-
"longitudinal-template_space-longitudinal_desc-reorient_T1w",
1956-
],
1945+
"longitudinal-template_space-longitudinal_desc-head_T1w",
19571946
"space-longitudinal_desc-head_T1w",
19581947
"space-longitudinal_desc-brain_T1w",
19591948
"space-longitudinal_desc-preproc_T1w",
@@ -2062,10 +2051,7 @@ def register_ANTs_anat_to_template(
20622051
"desc-head_T1w",
20632052
"desc-preproc_T1w",
20642053
],
2065-
[
2066-
"longitudinal-template_space-longitudinal_desc-head_T1w",
2067-
"longitudinal-template_space-longitudinal_desc-reorient_T1w",
2068-
],
2054+
"longitudinal-template_space-longitudinal_desc-head_T1w",
20692055
),
20702056
"T1w-template-symmetric",
20712057
"T1w-brain-template-symmetric",

0 commit comments

Comments
 (0)