forked from aramis-lab/clinica
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] Fix some issues around the usage of
Tracer
and `SUVRReference…
…Region` (aramis-lab#1280)
- Loading branch information
1 parent
1183c61
commit e562e13
Showing
6 changed files
with
69 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
from clinica.pipelines.engine import Pipeline | ||
from clinica.utils.pet import ReconstructionMethod, Tracer | ||
from clinica.utils.stream import log_and_raise | ||
|
||
|
||
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) | ||
from clinica.utils.exceptions import ClinicaPipelineConfigurationError | ||
|
||
if "acq_label" not in self.parameters: | ||
log_and_raise( | ||
"Missing compulsory 'acq_label' key in pipeline parameter.", | ||
ClinicaPipelineConfigurationError, | ||
) | ||
self.parameters["acq_label"] = Tracer(self.parameters["acq_label"]) | ||
if "reconstruction_method" in self.parameters: | ||
if self.parameters["reconstruction_method"]: | ||
self.parameters["reconstruction_method"] = ReconstructionMethod( | ||
self.parameters["reconstruction_method"] | ||
) | ||
else: | ||
self.parameters["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) | ||
return bids_pet_nii( | ||
self.parameters["acq_label"], self.parameters["reconstruction_method"] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters