StepsAPI#
- class petpal.pipelines.steps_base.StepsAPI(skip_step: bool = False)#
StepsAPI provides an interface for defining steps in a processing pipeline.
This class outlines methods that allow input and output management between different steps, and perform inference of output files based on input data and given parameters.
- abstractmethod execute(*args, **kwargs)#
- abstractmethod set_input_as_output_from(*sending_steps)#
Sets the input of the current step as the output from a list of steps.
- Parameters:
*sending_steps – The previous steps from which the output will be used as input for the current step.
- Raises:
NotImplementedError – This method should be implemented by subclasses.
Notes
For a concrete example, take a look at:
TACsFromSegmentationStepImportant
If a step takes multiple input steps. the implementation will have a defined order for steps.
- abstractmethod infer_outputs_from_inputs(out_dir: str, der_type: str, suffix: str = None, ext: str = None, **extra_desc)#
Infers output files from input data based on the specified output directory, derivative type, optional suffix and extension, plus any extra descriptions.
- Parameters:
out_dir (str) – The directory where the output files will be saved.
der_type (str) – The type of derivative being produced.
suffix (str, optional) – An optional suffix for the output files.
ext (str, optional) – An optional extension for the output files.
**extra_desc – Additional keyword arguments for extra descriptions to be included.
- Raises:
NotImplementedError – This method should be implemented by subclasses.
Notes
For a concrete example, take a look at:
TACsFromSegmentationStep
- __call__(*args, **kwargs)#