Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] Move PETSurface pipeline to new clinica.pipelines.pet module #1237

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion clinica/pipelines/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
machine_learning,
machine_learning_spatial_svm,
pet,
pet_surface,
statistics_surface,
statistics_volume,
statistics_volume_correction,
Expand Down
2 changes: 1 addition & 1 deletion clinica/pipelines/pet/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import linear, volume
from . import linear, surface, volume
1 change: 1 addition & 0 deletions clinica/pipelines/pet/surface/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import cli, longitudinal_cli
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def cli(

from clinica.utils.ux import print_end_pipeline

from .pet_surface_pipeline import PetSurface
from .pipeline import PetSurface

parameters = {
"acq_label": acq_label,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
"version": ">=12"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def cli(

from clinica.utils.ux import print_end_pipeline

from .pet_surface_pipeline import PetSurface
from .pipeline import PetSurface

parameters = {
"acq_label": acq_label,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,21 +189,24 @@ def _build_input_node_longitudinal(self):
self.parameters["acq_label"],
skip_question=self.parameters["skip_question"],
)

# fmt: off
self.connect(
[
(read_parameters_node, self.input_node, [("pet", "pet"),
("orig_nu", "orig_nu"),
("white_surface_left", "white_surface_left"),
("white_surface_right", "white_surface_right"),
("destrieux_left", "destrieux_left"),
("destrieux_right", "destrieux_right"),
("desikan_left", "desikan_left"),
("desikan_right", "desikan_right")])
(
read_parameters_node,
self.input_node,
[
("pet", "pet"),
("orig_nu", "orig_nu"),
("white_surface_left", "white_surface_left"),
("white_surface_right", "white_surface_right"),
("destrieux_left", "destrieux_left"),
("destrieux_right", "destrieux_right"),
("desikan_left", "desikan_left"),
("desikan_right", "desikan_right"),
],
)
]
)
# fmt: on

def _build_input_node_cross_sectional(self):
import nipype.interfaces.utility as nutil
Expand Down Expand Up @@ -320,21 +323,24 @@ def _build_input_node_cross_sectional(self):
self.parameters["acq_label"],
skip_question=self.parameters["skip_question"],
)

# fmt: off
self.connect(
[
(read_parameters_node, self.input_node, [("pet", "pet"),
("orig_nu", "orig_nu"),
("white_surface_left", "white_surface_left"),
("white_surface_right", "white_surface_right"),
("destrieux_left", "destrieux_left"),
("destrieux_right", "destrieux_right"),
("desikan_left", "desikan_left"),
("desikan_right", "desikan_right")])
(
read_parameters_node,
self.input_node,
[
("pet", "pet"),
("orig_nu", "orig_nu"),
("white_surface_left", "white_surface_left"),
("white_surface_right", "white_surface_right"),
("destrieux_left", "destrieux_left"),
("destrieux_right", "destrieux_right"),
("desikan_left", "desikan_left"),
("desikan_right", "desikan_right"),
],
)
]
)
# fmt: on

def _build_output_node(self):
"""Build and connect an output node to the pipeline."""
Expand All @@ -355,7 +361,7 @@ def _build_core_nodes(self):
import nipype.interfaces.utility as niu
import nipype.pipeline.engine as npe

import clinica.pipelines.pet_surface.pet_surface_utils as utils
from clinica.pipelines.pet.surface.workflows import get_wf

full_pipe = npe.MapNode(
niu.Function(
Expand All @@ -380,7 +386,7 @@ def _build_core_nodes(self):
"is_longitudinal",
],
output_names=[],
function=utils.get_wf,
function=get_wf,
),
name="full_pipeline_mapnode",
iterfield=[
Expand Down Expand Up @@ -413,6 +419,7 @@ def _build_core_nodes(self):
os.path.dirname(os.path.realpath(__file__)),
"..",
"..",
"..",
"resources",
"label_conversion_gtmsegmentation.csv",
)
Expand All @@ -421,20 +428,21 @@ def _build_core_nodes(self):
os.path.dirname(os.path.realpath(__file__))
)
full_pipe.inputs.is_longitudinal = self.parameters["longitudinal"]

# Connection
# ==========
# fmt: off
self.connect(
[
(self.input_node, full_pipe, [("pet", "pet"),
("white_surface_left", "white_surface_left"),
("white_surface_right", "white_surface_right"),
("orig_nu", "orig_nu"),
("destrieux_left", "destrieux_left"),
("destrieux_right", "destrieux_right"),
("desikan_left", "desikan_left"),
("desikan_right", "desikan_right")])
(
self.input_node,
full_pipe,
[
("pet", "pet"),
("white_surface_left", "white_surface_left"),
("white_surface_right", "white_surface_right"),
("orig_nu", "orig_nu"),
("destrieux_left", "destrieux_left"),
("destrieux_right", "destrieux_right"),
("desikan_left", "desikan_left"),
("desikan_right", "desikan_right"),
],
)
]
)
# fmt: off
Loading
Loading