superdsm.pipeline

class superdsm.pipeline.LoadInput

Bases: Stage

Loads the input image into the pipeline.

The loaded image g_raw is made available as an input to the subsequent pipeline stages. However, if config['histological'] == True (i.e. the hyperparameter histological is set to True), then g_raw is converted to a brightness-inverse intensity image, and the original image is provided as g_rgb to the stages of the pipeline.

In addition, g_raw is normalized so that the intensities range from 0 to 1.

g_raw = None
inputs: Collection[str] = ['input_id']

List of fields read by this stage.

outputs: Collection[str] = ['g_raw', 'g_rgb']

List of fields produced by this stage.

process(input_id, pipeline, config, status=None)

Processes the input fields of this stage of the pipeline.

This method implements a stage of the pipeline with the provided inputs and configuration parameters. It then returns the outputs produced by the stage.

Parameters:
  • pipeline – The pipeline object that this stage is a part of.

  • config – The hyperparameters to be used for this stage.

  • status – A status object to report the progress of the computations.

  • **inputs – The fields of the pipeline read by this stage. Each key-value pair represents an input field and the corresponding value.

Returns:

A dictionary containing the outputs of this stage. Each key-value pair in the dictionary represents an output field and the corresponding value.

Raises:

NotImplementedError – If the method is not implemented by the subclass.

class superdsm.pipeline.Pipeline(*args, **kwargs)

Bases: Pipeline

configure(base_config, input_id, *args, img=None, **kwargs)

Automatically adopts hyperparameters by applying linear adoptation rules.

The hyperparameters are configured by the create_config_entry() function, and the arguments (rules) are determined by calling stage.configure() for each stage.

Parameters:
  • base_config – The base hyperparameters to be used (not modified).

  • input_id – The identifier of the input data to adopt the hyperparameters for.

  • *args – Sequential arguments passed to stage.configure().

  • **kwargs – Keyword arguments passed to stage.configure().

Returns:

The adopted hyperparameters.

process_image(g_raw, base_config, *args, **kwargs)