cornucopia.noise
This module contains transforms that inject noise into an image.
GaussianNoiseFinalTransform
GaussianNoiseTransform
Bases: NonFinalTransform
Additive Gaussian noise
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma
|
float
|
Standard deviation |
0.1
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
returns |
[list or dict of] {'input', 'output', 'noise'}
|
Which tensors to return |
shared |
(channels, tensors, channels + tensors, '')
|
Add the exact same nosie to all channels/images |
RandomGaussianNoiseTransform
Bases: RandomizedTransform
Additive Gaussian noise with random standard deviation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma
|
Sampler | float
|
Distribution from which to sample the standard deviation.
If a |
0.1
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
returns |
[list or dict of] {'input', 'output', 'noise'}
|
Which tensors to return |
shared |
(channels, tensors, channels + tensors, '')
|
Use the same sd for all channels/tensors |
shared_noise |
(channels, tensors, channels + tensors, '', None)
|
Use the exact same noise for all channels/tensors |
ChiNoiseTransform
Bases: NonFinalTransform
Additive Noncentral Chi noise
(Rician is a special case with nb_channels = 2)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma
|
float
|
Standard deviation |
0.1
|
nb_channels
|
int
|
Number of independent channels |
2
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
returns |
[list or dict of] {'input', 'output', 'noise'}
|
Which tensors to return |
shared |
(channels, tensors, channels + tensors, '')
|
Add the exact same values to all channels/images |
RandomChiNoiseTransform
Bases: RandomizedTransform
Additive Chi noise with random standard deviation and channels
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma
|
Sampler | float
|
Distribution from which to sample the standard deviation.
If a |
0.1
|
nb_channels
|
Sampler | int
|
Distribution from which to sample the standard deviation.
If a |
8
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
returns |
[list or dict of] {'input', 'output', 'noise'}
|
Which tensors to return |
shared |
(channels, tensors, channels + tensors, '')
|
Use the same sd for all channels/tensors |
shared_noise |
(channels, tensors, channels + tensors, '', None)
|
Use the exact same noise for all channels/tensors |
GFactorFinalTransform
Bases: NonFinalTransform
Multiplicative noise with precomputed noise and g-factor
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
noisetrf
|
Transform
|
A transform that applies additive noise |
required |
gfactor
|
Transform
|
A transform that takes the noise as input and outputs a g-factor field |
required |
GFactorTransform
Bases: NonFinalTransform
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
noise
|
Transform
|
A transform that applies additive noise |
required |
shape
|
float
|
Number of control points |
5
|
vmin
|
float
|
Minimum g-factor |
0.5
|
vmax
|
float
|
Maximum g-factor |
1.5
|
order
|
int
|
Spline order |
3
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
returns |
[list or dict of] {'input', 'output', 'gfactor', 'noise', 'scalednoise'}
|
Which tensors to return |
shared |
(channels, tensors, channels + tensors, '')
|
Use the same field for all channels/tensors |
GammaNoiseFinalTransform
GammaNoiseTransform
Bases: NonFinalTransform
Multiplicative Gamma noise
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma
|
float
|
Standard deviation |
0.1
|
mean
|
float
|
Expected value |
1
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
returns |
[list or dict of] {'input', 'output', 'noise'}
|
Which tensors to return |
shared |
(channels, tensors, channels + tensors, '')
|
Use the exact same noise for all channels/tensors |
RandomGammaNoiseTransform
Bases: RandomizedTransform
Multiplicative Gamma noise with random standard deviation and mean
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sigma
|
Sampler or float
|
Distribution from which to sample the standard deviation.
If a |
0.1
|
mean
|
Sampler or float
|
Distribution from which to sample the mean.
If a |
Fixed(1.0)
|
Other Parameters:
| Name | Type | Description |
|---|---|---|
returns |
[list or dict of] {'input', 'output', 'noise'}
|
Which tensors to return |
shared |
(channels, tensors, channels + tensors, '')
|
Use the same sd for all channels/tensors |
shared_noise |
(channels, tensors, channels + tensors, '', None)
|
Use the exact same noise for all channels/tensors |