Menu

Module providing common Brain MRI Augmentation Methods for PyTorch.

Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the gallery for the big picture.

class brainrise.spatial.RandomAffine(rotation=10, translation=10, zoom=0.2, order=3, dist='uniform', seed=None)[source]

Random affine transformation.

The affine translation & rotation parameters are drawn from a lognormal distribution - small movements are assumed to occur more often and large movements less frequently - or from a uniform distribution.

__init__(rotation=10, translation=10, zoom=0.2, order=3, dist='uniform', seed=None)[source]

Init class.

Parameters

rotation : float or 2-uplet, default 10

the rotation in degrees of the simulated movements. Larger values generate more distorted images.

translation : float or 2-uplet, default 10

the translation in voxel of the simulated movements. Larger values generate more distorted images.

zoom : float, default 0.2

the zooming magnitude. Larger values generate more distorted images.

order : int, default 3

the order of the spline interpolation in the range [0, 5].

dist : str, default ‘uniform’

the sampling distribution: ‘uniform’ or ‘lognormal’.

seed : int, default None

seed to control random number generator.

Follow us

© 2023, brainrise developers