learning.RandomGain#
- class bartorch.learning.RandomGain#
Bases:
RandomTransform,IntensityTransformMultiply every image of a subject by one random complex gain (
torchiotransform).The images hold complex values as real channels, laid out by
as_real():2 kchannels arekcomplex images, real parts first. The gain is \(e^{s} e^{i \varphi}\), with \(\varphi\) uniform inphaseand \(s\) uniform inlog_scale, the same for every image of the subject, so a degraded input and its reference stay consistent.torchio’s spatial transforms apply to the real and imaginary channels as they are; its other intensity transforms do not respect the complex structure.- Parameters:
phase (float or tuple of float, default=pi) – Range of \(\varphi\), in radians; a single value
dis(-d, d).log_scale (float or tuple of float, default=0.0) – Range of \(s\); a single value
dis(-d, d).**kwargs – Passed to
torchio.transforms.Transform.
- apply_transform()#
Apply the transform to a parsed subject.
- Args:
subject: Subject to be modified by the transform.
- Returns:
The transformed subject.