superdsm.preprocess
- class superdsm.preprocess.Preprocessing
Bases:
StageImplements the computation of the intensity offsets (see Convex energy minimization).
This stage requires
g_rawfor input (the input image) and producesyfor 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/sigma1The scale of the Gaussian filter used for denoising. Defaults to \(\sqrt{2}\).
preprocess/sigma2The 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 × scaleif configured automatically (andAF_sigma2defaults to 1).preprocess/offset_clipCorresponds to \(\tau_\text{max}\) in Supplemental Material 1. Defaults to \(3\).
preprocess/lower_clip_meanIf
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
keyis associated with a new hyperparameterAF_key. The value of the hyperparameterkeywill be computed as the product offactorand the value of theAF_keyhyperparameter, which defaults todefault_user_factor. The value given forfactoris usuallyscale,radius,diameter, or a polynomial thereof. Another dictionary may be provided as a third component of the tuple, which can specify atype,min, andmaxvalues.
- 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
Outputsub-class,'muted'if no output should be produced, orNoneif the default output should be used.log_root_dir – Path of directory where log files will be written, or
Noneif no log files should be written.
- Returns:
Dictionary of the outputs declared by this stage.