TACAnalysisStepMixin#

class petpal.pipelines.kinetic_modeling_steps.TACAnalysisStepMixin(input_tac_path: str, roi_tacs_dir: str, output_directory: str, output_prefix: str, is_ref_tac_based_model: bool, **kwargs)#

Bases: petpal.pipelines.steps_base.StepsAPI

A mixin class for TAC analysis steps.

This class manages initialization and properties related to TAC paths, directories, and output configurations. It provides methods to infer output paths and prefixes based on input TAC paths.

Variables:
  • input_tac_path (str) – Path to the input TAC file. Doubles as the path to a reference tac if appropriate.

  • roi_tacs_dir (str) – Directory containing the ROI TAC files to be analyzed.

  • output_directory (str) – Directory where output files will be saved.

  • output_prefix (str) – Prefix for the output files.

  • is_ref_tac_based_model (bool) – Indicates if the model is reference TAC-based.

Initializes the TACAnalysisStepMixin with specified parameters.

Parameters:
  • input_tac_path (str) – Path to the input TAC file.

  • roi_tacs_dir (str) – Directory containing the ROI TAC files.

  • output_directory (str) – Directory where output files will be saved.

  • output_prefix (str) – Prefix for the output files.

  • is_ref_tac_based_model (bool) – Indicates if the model is reference TAC-based.

  • **kwargs – Additional keyword arguments to be included in initialization.

property input_tac_path: str#

Gets the path to the input TAC file.

Returns:

str – Path to the input TAC file.

property reference_tac_path: str#

Gets the path to the reference TAC file.

Returns:

str – Path to the reference TAC file.

property tacs_dir: str#

Gets the directory containing the TAC files to be analyzed.

Returns:

str – Directory containing the TAC files to be analyzed.

property roi_tacs_dir: str#

Gets the directory containing the ROI TAC files to be analyzed.

Returns:

str – Directory containing the ROI TAC files to be analyzed.

property output_directory: str#

Gets the directory where output files will be saved.

Returns:

str – Directory where output files will be saved.

property output_prefix: str#

Gets the prefix for the output files. Usually something like sub-XXXX_ses-XX if BIDS compliant output.

Returns:

str – Prefix for the output files.

property out_path_and_prefix#

Gets the tuple of output directory and prefix.

Returns:

tuple – A tuple containing output directory and prefix.

infer_prefix_from_input_tac_path()#

Infers the output prefix based on the input/reference TAC file path. Gets the subject and session from the path if possible.

infer_output_directory_from_input_tac_path(out_dir: str, der_type: str = 'km')#

Infers the output directory based on the input/reference TAC file path. Gets the subject and session from the path is possible.

Parameters:
  • out_dir (str) – Root output directory.

  • der_type (str) – Type of derivatives. Defaults to ‘km’.

infer_outputs_from_inputs(out_dir: str, der_type, suffix=None, ext=None, **extra_desc)#

Infers the output directory and prefix based on the input/reference TAC file path. Gets the subject and session from the path is possible.

Parameters:
  • out_dir (str) – Root output directory.

  • der_type (str) – Type of derivatives.

  • suffix (str, optional) – Suffix for the output files.

  • ext (str, optional) – Extension for the output files.

  • **extra_desc – Additional descriptive parameters.

set_input_as_output_from(*sending_steps) None#

Sets the input parameters based on the output from a specified sending step.

Parameters:

sending_step (PreprocStepType) – The step from which to derive the input parameters.

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