superdsm.preprocess

class superdsm.preprocess.Preprocessing

Bases: Stage

Implements the computation of the intensity offsets (see Convex energy minimization).

This stage requires g_raw for input (the input image) and produces y for output (the offset image intensities). Refer to Inputs and outputs for more information on the available inputs and outputs.

Hyperparameters

The following hyperparameters can be used to control this pipeline stage:

preprocess/sigma1

The scale of the Gaussian filter used for denoising. Defaults to \(\sqrt{2}\).

preprocess/sigma2

The scale of the Gaussian filter \(\mathcal G_\sigma\), which is used to determine the intensity offsets \(\tau_x\) (see Convex energy minimization). Defaults to \(40\), or to AF_sigma2 × scale if configured automatically (and AF_sigma2 defaults to 1).

preprocess/offset_clip

Corresponds to \(\tau_\text{max}\) in Supplemental Material 1. Defaults to \(3\).

preprocess/lower_clip_mean

If True, intensity offsets \(\tau_x\) smaller than the mean image intensity are set to the mean image intensity. Defaults to False.

ENABLED_BY_DEFAULT = True
configure_ex(scale, radius, diameter)

Automatically computes the default configuration entries which are dependent on the scale of the objects in an image, using explicit values for the expected radius and diameter of the objects.

Parameters:
  • scale – The average scale of objects in the image.

  • radius – The average radius of objects in the image.

  • diameter – The average diameter of objects in the image.

Returns:

Dictionary of configuration entries of the form:

{
    'key': (factor, default_user_factor),
}

Each hyperparameter key is associated with a new hyperparameter AF_key. The value of the hyperparameter key will be computed as the product of factor and the value of the AF_key hyperparameter, which defaults to default_user_factor. The value given for factor is usually scale, radius, diameter, or a polynomial thereof. Another dictionary may be provided as a third component of the tuple, which can specify a type, min, and max values.

process(input_data, cfg, out, log_root_dir)

Runs this pipeline stage.

Parameters:
  • input_data – Dictionary of the inputs declared by this stage.

  • cfg – The hyperparameters to be used by this stage.

  • out – An instance of an Output sub-class, 'muted' if no output should be produced, or None if the default output should be used.

  • log_root_dir – Path of directory where log files will be written, or None if no log files should be written.

Returns:

Dictionary of the outputs declared by this stage.