diff --git a/clinica/pipelines/engine.py b/clinica/pipelines/engine.py index 8786bd9d6..42f059ee4 100644 --- a/clinica/pipelines/engine.py +++ b/clinica/pipelines/engine.py @@ -1001,28 +1001,3 @@ def _check_custom_dependencies(self) -> None: @abc.abstractmethod def _check_pipeline_parameters(self) -> None: """Check pipeline parameters.""" - - -class PETPipeline(Pipeline): - def _check_pipeline_parameters(self) -> None: - """Check pipeline parameters.""" - if "acq_label" not in self.parameters.keys(): - raise KeyError("Missing compulsory acq_label key in pipeline parameter.") - self.parameters.setdefault("reconstruction_method", None) - - def _get_pet_scans_query(self) -> dict: - """Return the query to retrieve PET scans.""" - from clinica.utils.input_files import bids_pet_nii - from clinica.utils.pet import ReconstructionMethod, Tracer - - pet_tracer = None - if self.parameters["acq_label"] is not None: - pet_tracer = Tracer(self.parameters["acq_label"]) - - reconstruction_method = None - if self.parameters["reconstruction_method"] is not None: - reconstruction_method = ReconstructionMethod( - self.parameters["reconstruction_method"] - ) - - return bids_pet_nii(pet_tracer, reconstruction_method) diff --git a/clinica/pipelines/pet/__init__.py b/clinica/pipelines/pet/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/clinica/pipelines/pet/engine.py b/clinica/pipelines/pet/engine.py new file mode 100644 index 000000000..92ab264a6 --- /dev/null +++ b/clinica/pipelines/pet/engine.py @@ -0,0 +1,26 @@ +from clinica.pipelines.engine import Pipeline + + +class PETPipeline(Pipeline): + def _check_pipeline_parameters(self) -> None: + """Check pipeline parameters.""" + if "acq_label" not in self.parameters.keys(): + raise KeyError("Missing compulsory acq_label key in pipeline parameter.") + self.parameters.setdefault("reconstruction_method", None) + + def _get_pet_scans_query(self) -> dict: + """Return the query to retrieve PET scans.""" + from clinica.utils.input_files import bids_pet_nii + from clinica.utils.pet import ReconstructionMethod, Tracer + + pet_tracer = None + if self.parameters["acq_label"] is not None: + pet_tracer = Tracer(self.parameters["acq_label"]) + + reconstruction_method = None + if self.parameters["reconstruction_method"] is not None: + reconstruction_method = ReconstructionMethod( + self.parameters["reconstruction_method"] + ) + + return bids_pet_nii(pet_tracer, reconstruction_method) diff --git a/clinica/pipelines/pet_linear/pet_linear_pipeline.py b/clinica/pipelines/pet_linear/pet_linear_pipeline.py index 6b1809c0d..82962d58d 100644 --- a/clinica/pipelines/pet_linear/pet_linear_pipeline.py +++ b/clinica/pipelines/pet_linear/pet_linear_pipeline.py @@ -4,7 +4,7 @@ from nipype import config -from clinica.pipelines.engine import PETPipeline +from clinica.pipelines.pet.engine import PETPipeline cfg = dict(execution={"parameterize_dirs": False}) config.update_config(cfg) diff --git a/clinica/pipelines/pet_surface/pet_surface_pipeline.py b/clinica/pipelines/pet_surface/pet_surface_pipeline.py index 51f6f0780..71e9292b0 100644 --- a/clinica/pipelines/pet_surface/pet_surface_pipeline.py +++ b/clinica/pipelines/pet_surface/pet_surface_pipeline.py @@ -1,6 +1,6 @@ from typing import List -from clinica.pipelines.engine import PETPipeline +from clinica.pipelines.pet.engine import PETPipeline class PetSurface(PETPipeline): diff --git a/clinica/pipelines/pet_volume/pet_volume_pipeline.py b/clinica/pipelines/pet_volume/pet_volume_pipeline.py index 50804e8cb..0f76c0992 100644 --- a/clinica/pipelines/pet_volume/pet_volume_pipeline.py +++ b/clinica/pipelines/pet_volume/pet_volume_pipeline.py @@ -2,7 +2,7 @@ from nipype import config -from clinica.pipelines.engine import PETPipeline +from clinica.pipelines.pet.engine import PETPipeline # Use hash instead of parameters for iterables folder names # Otherwise path will be too long and generate OSError