Blur
Bases: IntensityTransform
Blur an image using a Gaussian filter.
The standard deviations \((\sigma_1, \sigma_2, \sigma_3)\) of the Gaussian kernel along each spatial axis are independently sampled from the given range. Sigmas are specified in mm and internally converted to voxels using the image spacing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
std
|
float | tuple[float, float]
|
Standard deviation of the Gaussian kernel in mm.
A scalar \(x\) means \(\sigma_i = x\) for every axis
(deterministic).
A 2-tuple \((a, b)\) means
\(\sigma_i \sim \mathcal{U}(a, b)\).
A 6-tuple \((a_1, b_1, a_2, b_2, a_3, b_3)\) means
\(\sigma_i \sim \mathcal{U}(a_i, b_i)\) independently.
A |
0.0
|
**kwargs
|
Any
|
See |
{}
|
Examples:
Source code in src/torchio/transforms/intensity/blur.py
invertible
property
Whether this transform can be inverted.
forward(data)
Apply the transform.
The output type always matches the input type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Any
|
Input data to transform. |
required |
Source code in src/torchio/transforms/transform.py
inverse(params)
Return a transform that undoes this one.
Override in invertible subclasses. The returned transform, when applied, reverses the effect of the forward pass with the given parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
dict[str, Any]
|
The parameters recorded in the forward pass. |
required |
Returns:
| Type | Description |
|---|---|
Transform
|
A new |
Source code in src/torchio/transforms/transform.py
to_hydra()
Export as a Hydra-compatible config dict.
Returns a dict with _target_ set to the fully qualified
class name and only non-default field values included.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dict suitable for |
Source code in src/torchio/transforms/transform.py
make_params(batch)
Sample per-axis standard deviations (per element when batched).
Source code in src/torchio/transforms/intensity/blur.py
apply_transform(batch, params)
Apply Gaussian smoothing to each selected image.