ResampleBloodTACStep =================================================== .. py:class:: petpal.pipelines.preproc_steps.ResampleBloodTACStep(input_raw_blood_tac_path: str, input_image_path: str, out_tac_path: str, lin_fit_thresh_in_mins=30.0, rescale_constant: float = 37000.0) Bases: :py:obj:`petpal.pipelines.steps_base.FunctionBasedStep` A step in a processing pipeline for resampling blood Time Activity Curves (TACs) based on PET image timings. This class facilitates the resampling of blood TACs to match the scanner's time frames, providing properties and methods for handling the input and output paths, as well as the resampling thresholds. This class uses :func:`resample_blood_data_on_scanner_times` to perform the resampling. :ivar raw_blood_tac_path: Path to the input raw blood TAC file. :vartype raw_blood_tac_path: str :ivar input_image_path: Path to the 4D-PET image file. :vartype input_image_path: str :ivar resampled_tac_path: Path where the resampled TAC will be saved. :vartype resampled_tac_path: str :ivar lin_fit_thresh_in_mins: Threshold in minutes for linear fitting. :vartype lin_fit_thresh_in_mins: float Initializes a ResampleBloodTACStep with specified parameters. :param input_raw_blood_tac_path: Path to the input raw blood TAC file. :type input_raw_blood_tac_path: str :param input_image_path: Path to the PET image file. :type input_image_path: str :param out_tac_path: Path where the resampled TAC will be saved. :type out_tac_path: str :param lin_fit_thresh_in_mins: Threshold in minutes for linear fitting. :type lin_fit_thresh_in_mins: float .. py:method:: __repr__() Provides an unambiguous string representation of the ResampleBloodTACStep instance. :returns: *str* -- A string representation showing how the instance can be recreated. .. py:property:: raw_blood_tac_path Gets the path to the input raw blood TAC file. :returns: *str* -- The path to the input raw blood TAC file. .. py:property:: input_image_path Gets the path to the PET image file. :returns: *str* -- The path to the PET image file. .. py:property:: resampled_tac_path Gets the path where the resampled TAC will be saved. :returns: *str* -- The path where the resampled TAC will be saved. .. 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, suffix='blood', ext='.tsv', **extra_desc) Infers the output file path for resampled TAC based on the input raw blood TAC path. :param out_dir: Directory where the outputs will be saved. :type out_dir: str :param der_type: Type of derivatives. :param suffix: Suffix for the output files. Defaults to 'blood'. :type suffix: str, optional :param ext: Extension for the output files. Defaults to '.tsv'. :type ext: str, optional :param \*\*extra_desc: Additional descriptive parameters. .. py:method:: default_resample_blood_tac_on_scanner_times() :classmethod: Provides a class method to create an instance with default parameters. All paths are set to empty-strings and the fitting threshold is set to 30 minutes. :returns: *ResampleBloodTACStep* -- 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)