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 producesy
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 (andAF_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 toFalse
.
- 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 hyperparameterAF_key
. The value of the hyperparameterkey
will be computed as the product offactor
and the value of theAF_key
hyperparameter, which defaults todefault_user_factor
. The value given forfactor
is usuallyscale
,radius
,diameter
, or a polynomial thereof. Another dictionary may be provided as a third component of the tuple, which can specify atype
,min
, andmax
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, orNone
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.