TACsFromSegmentationStep ======================================================= .. py:class:: petpal.pipelines.preproc_steps.TACsFromSegmentationStep(input_image_path: str, segmentation_image_path: str, segmentation_label_map_path: str, out_tacs_dir: str, out_tacs_prefix: str, verbose=False) Bases: :py:obj:`petpal.pipelines.steps_base.FunctionBasedStep` A step in a processing pipeline for generating Time Activity Curves (TACs) from segmented images. This class is specialized for handling the input and output paths related to TAC generation, extending the :class:`FunctionBasedStep` with specific properties and methods for TACs. The class uses :func:`write_tacs` which uses segmentation information to generate ROI TACs, and write them to disk. :ivar input_image_path: Path to the input image. :vartype input_image_path: str :ivar segmentation_image_path: Path to the segmentation image. :vartype segmentation_image_path: str :ivar segmentation_label_map_path: Path to the segmentation label map. :vartype segmentation_label_map_path: str :ivar out_tacs_dir: Directory where the output TACs will be saved. :vartype out_tacs_dir: str :ivar out_tacs_prefix: Prefix for the output TACs. :vartype out_tacs_prefix: str :ivar verbose: Verbosity flag, default is False. :vartype verbose: bool Initializes a TACsFromSegmentationStep with specified parameters. :param input_image_path: Path to the input image. :type input_image_path: str :param segmentation_image_path: Path to the segmentation image. :type segmentation_image_path: str :param segmentation_label_map_path: Path to the segmentation label map. :type segmentation_label_map_path: str :param out_tacs_dir: Directory where the output TACs will be saved. :type out_tacs_dir: str :param out_tacs_prefix: Prefix for the output TACs. :type out_tacs_prefix: str :param verbose: Verbosity flag, default is False. :type verbose: bool .. py:method:: __repr__() Provides an unambiguous string representation of the TACsFromSegmentationStep instance. :returns: *str* -- A string representation showing how the instance can be recreated. .. py:property:: segmentation_image_path Gets the path to the segmentation image. :returns: *str* -- The path to the segmentation image. .. py:property:: segmentation_label_map_path Gets the path to the segmentation label map. :returns: *str* -- The path to the segmentation label map. .. py:property:: out_tacs_dir Gets the directory where the output TACs will be saved. :returns: *str* -- The output directory path. .. py:property:: out_tacs_prefix Gets the prefix for the output TACs. :returns: *str* -- The prefix for the output TACs. .. py:property:: out_path_and_prefix Gets the output directory path and prefix as a tuple. :returns: *tuple* -- A tuple containing the output directory path and prefix. .. py:property:: input_image_path Gets the path to the input image. :returns: *str* -- The path to the input image. .. py:method:: set_input_as_output_from(*sending_steps) Sets the input image path based on the output from a specified sending step. :param sending_step: The step from which to derive the input image path. .. py:method:: infer_outputs_from_inputs(out_dir: str, der_type: str, suffix: str = None, ext: str = None, **extra_desc) Infers output directory and prefix for TACs based on the input image path. :param out_dir: Directory where the outputs will be saved. :type out_dir: str :param der_type: Type of derivatives. :type der_type: str :param suffix: Suffix for the output files. Defaults to None. :type suffix: str, optional :param ext: Extension for the output files. Defaults to None. :type ext: str, optional :param \*\*extra_desc: Additional descriptive parameters. .. py:method:: default_write_tacs_from_segmentation_rois(**overrides) :classmethod: Provides a class method to create an instance with default parameters. All paths are set to empty strings, and `verbose=False`. :returns: *TACsFromSegmentationStep* -- A new instance with default parameters. .. py:method:: get_function_args_not_set_in_kwargs() -> ArgsDict Retrieves arguments of the function that are not set in the keyword arguments. :returns: *ArgsDict* -- A dictionary of function arguments that have not been set in the keyword arguments. .. py:method:: get_empty_default_kwargs() -> list Identifies arguments that have not been provided and lack default values. :returns: *list* -- A list of argument names that have no default values and are not provided. .. py:method:: validate_kwargs_for_non_default_have_been_set() -> None Validates that all mandatory arguments have been provided. :raises RuntimeError: If any mandatory arguments are missing. .. py:method:: execute() Executes the function with the provided arguments and keyword arguments. :raises The function may raise any exceptions that its implementation can throw.: .. py:method:: generate_kwargs_from_args() -> ArgsDict Converts positional arguments into keyword arguments. :returns: *ArgsDict* -- A dictionary where positional arguments are mapped to their corresponding parameter names. .. py:method:: __str__() Returns a detailed string representation of the FunctionBasedStep instance. :returns: *str* -- A string describing the step, including its name, function, arguments, and keyword arguments. .. py:method:: all_args_non_empty_strings() Checks if all positional arguments are non-empty strings. :returns: *bool* -- True if all positional arguments are non-empty strings, False otherwise. .. py:method:: all_kwargs_non_empty_strings() Checks if all keyword arguments are non-empty strings. :returns: *bool* -- True if all keyword arguments are non-empty strings, False otherwise. .. py:method:: can_potentially_run() Determines if the step can potentially be executed based on argument validation. Very simply checks if all arguments and keyword arguments are non-empty strings. :returns: *bool* -- True if the step can potentially run, False otherwise. .. py:method:: __call__(*args, **kwargs)