surfa.transform.random_affine#

surfa.transform.random_affine(translation_range=0, rotation_range=0, scale_range=1, shear_range=0, ndim=3, degrees=True, **kwargs)#

Draw a random affine from ranges of transform components. Affine will be identity by default.

Parameters
  • translation_range (float scalar or array) – Range to sample translation parameters from. Scalar values define the max deviation from 0.0, while a 2-element array defines the (min, max) range.

  • rotation_range (scalar or array) – Range to sample rotation parameters from. Scalar values define the max deviation from 0.0, while a 2-element array defines the (min, max) range.

  • scale_range (scalar or array) – Range to sample scale parameters from. Scalar values define the max deviation from 1.0, while a 2-element array defines the (min, max) range.

  • shear_range (scalar or array) – Range to sample shear parameters from. Scalar values define the max deviation from 0.0, while a 2-element array defines the (min, max) range.

  • ndim (int) – Dimensionality of target transform.

  • degrees (bool) – Define rotation in degrees instead of radians.

  • **kwargs – Keyword arguments that are passed to Affine constructor.

Returns

Random affine transform.

Return type

Affine