SynthShapes.filters
MinimumFilter3D
Bases: Module
A module to apply a minimum filter to 3D volumes using 3x3x3 patches.
| PARAMETER | DESCRIPTION |
|---|---|
kernel_size
|
Size of the neighborhood from which the minimum is computed. Must be an odd number, typically 3 for a 3x3x3 filter.
TYPE:
|
Source code in SynthShapes/filters.py
forward
Apply the minimum filter to an input 3D volume.
| PARAMETER | DESCRIPTION |
|---|---|
volume
|
Input 4D tensor representing the volume. Should be of shape [batch_size, channels, depth, height, width].
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tensor
|
Output 4D tensor after applying the minimum filter. Shape matches the input shape. |
Source code in SynthShapes/filters.py
GaussianSmoothing3D
Bases: Module
A module to apply Gaussian smoothing to 3D volumes using 3D convolution.
This class extends nn.Module to handle 3D data, applying a Gaussian
smoothing filter across the input tensor using a 3D kernel.
| PARAMETER | DESCRIPTION |
|---|---|
kernel_size
|
Size of the Gaussian kernel. Must be an odd number, typically 3 or 5.
TYPE:
|
sigma
|
Standard deviation of the Gaussian kernel.
TYPE:
|
Source code in SynthShapes/filters.py
forward
Apply the Gaussian smoothing filter to an input 3D volume.
| PARAMETER | DESCRIPTION |
|---|---|
volume
|
Input 4D tensor representing the volume. Should be of shape [batch_size, channels, depth, height, width].
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tensor
|
Output 4D tensor after applying Gaussian smoothing. Shape matches the input shape. |
Source code in SynthShapes/filters.py
create_gaussian_kernel
Create the 3D Gaussian kernel.
| PARAMETER | DESCRIPTION |
|---|---|
kernel_size
|
Size of Gaussian kernel.
TYPE:
|
sigma
|
Standard deviation of the Gaussian kernel.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tensor
|
5D tensor representing the 3D Gaussian kernel for use in conv3d. |