Pipeline#

class zrad.preprocessing.pipeline.Pipeline(steps)[source]#

Run named preprocessing steps in sequence.

A pipeline chains small preprocessing objects that expose an apply method, for example resampling, ROI-mask construction, re-segmentation, and discretization. Each step receives the output of the previous step.

Parameters:

steps (iterable of tuple[str, object]) – Ordered preprocessing steps. Each item must be a (name, step) tuple, where name is a non-empty string and step exposes an apply method. Steps are applied in the order provided.

Methods

apply(data)

Apply all steps and return the transformed data.

get_params()

Return pipeline step parameters mapped by step name.

Pipeline.apply(data)[source]#

Apply all steps and return the transformed data.

Parameters:

data (object) – Initial input passed to the first preprocessing step.

Returns:

result – Output produced after all configured steps have been applied.

Return type:

object

Pipeline.get_params()[source]#

Return pipeline step parameters mapped by step name.

Returns:

params – Dictionary keyed by step name. Values are the result of each step’s get_params method, or an empty dictionary when unavailable.

Return type:

dict