PCAGuidedIDIFMixin#

class petpal.pipelines.pca_guided_idif_steps.PCAGuidedIDIFMixin(input_image_path: str, mask_image_path: str, output_tac_path: str, num_pca_components: int, verbose: bool)#

Bases: petpal.pipelines.steps_base.StepsAPI

Mixin class to provide shared functionality for PCA-guided IDIF pipeline steps.

This class is designed to standardize and extend functionality across various PCA-guided IDIF calculation steps. It handles input and output path management, configuration initialization, and helps define the relationships between preprocessing pipeline steps.

Inheritance:

Inherits from the StepsAPI base class.

Variables:
  • init_kwargs (dict) – A dictionary containing initial configuration parameters.

  • call_kwargs (dict) – A dictionary containing runtime call-specific parameters.

  • input_image_path (str) – Path to the input 4D-PET image.

  • mask_image_path (str) – Path to the mask image in the same space as 4D-PET image.

  • output_tac_path (str) – Path where output TAC data will be saved.

  • num_pca_components (int) – Number of PCA components to compute.

  • verbose (bool) – Whether to show detailed diagnostic output or not.

  • name (str) – Name of the pipeline step (default is “pca_guided_idif_base”).

property input_image_path#
property mask_image_path#
property output_tac_path: str#
property num_pca_components#
property verbose#
set_input_as_output_from(*sending_steps: petpal.pipelines.preproc_steps.ImageToImageStep) None#

Sets the input image paths based on the output paths from other steps in the pipeline.

The first sending step will set the input image path, and the second sending step will set the second image path.

Parameters:

sending_steps (tuple[ImageToImageStep]) – Two pipeline steps whose outputs will be used as the input image path and second image input path.

Raises:

AssertionError – If the number of provided sending steps is not exactly two.

infer_outputs_from_inputs(out_dir: str, der_type: str = 'tacs', suffix: str = 'tac', ext: str = '.tsv', **extra_desc)#

Infers the output array path based on the inputs and specified parameters.

This method generates a BIDS-like derivatives filepath for the output based on the subject and session IDs extracted from the input image path.

Parameters:
  • out_dir (str) – Directory where the output array will be saved.

  • der_type (str, optional) – Type of derivative. Will set the sub-directory in out_dir. Defaults to ‘tacs’.

  • suffix (str, optional) – Suffix for the output filename. Defaults to ‘tac’.

  • ext (str, optional) – File extension for the output file. Defaults to ‘.tsv’.

  • **extra_desc – Additional descriptive parameters for the output filename.

abstractmethod execute(*args, **kwargs)#
__call__(*args, **kwargs)#