Note

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

nidl.transforms.volume.augmentation.RandomGaussianSharpen

class nidl.transforms.volume.augmentation.RandomGaussianSharpen(sigma1=(0.5, 1.0), sigma2=0.5, alpha=(10.0, 30.0), **kwargs)[source]

Bases: VolumeTransform

Random unsharp masking of a 3d volume:

b_1 = G_{\sigma_1} * x, \quad b_2 = G_{\sigma_2} * b_1, \quad
x' = b_1 + \alpha (b_1 - b_2)

with G_\sigma a Gaussian filter (one \sigma per axis).

Reimplementation of MONAI’s RandGaussianSharpen [1] (Apache-2.0), with scipy’s Gaussian filter (reflected borders, as RandomGaussianBlur).

Parameters:
sigma1: (float, float), default=(0.5, 1.0)

Range of \sigma_1.

sigma2: float or (float, float), default=0.5

Range of \sigma_2; a float c means (c, \sigma_1).

alpha: (float, float), default=(10.0, 30.0)

Range of \alpha.

kwargs: dict

Keyword arguments.

References

[1]

Cardoso, M. J., et al., “MONAI: An open-source framework for deep learning in healthcare.” arXiv, 2022. https://arxiv.org/abs/2211.02701

__init__(sigma1=(0.5, 1.0), sigma2=0.5, alpha=(10.0, 30.0), **kwargs)[source]
apply_transform(data)[source]

Sharpen the volume.

Parameters:
data: np.ndarray or torch.Tensor

The input volume.

Returns:
data: np.ndarray or torch.Tensor

Sharpened volume, same type and shape as the input.