PerturbationChain

Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

class PerturbationChain(steps: Sequence[ImagePerturbation])[source]

Bases: object

Apply several image perturbations in sequence to one subject.

Parameters:

steps – Perturbations applied in the given order; each receives the output of the previous one. At least one step is required.

__init__(steps: Sequence[ImagePerturbation]) → None[source]
property spec: Spec

Return the composite specification used for provenance.

__call__(subject: Subject, *, rng: Generator) → Subject[source]

Return a copy of subject with every step applied in order.

Parameters:
  • subject – Subject to perturb.

  • rng – Random generator shared by all stochastic steps, so one seed defines the whole simulated retest.

Returns:

The perturbed subject copy.