tidy3d.plugins.autograd.functions.grey_dilation

tidy3d.plugins.autograd.functions.grey_dilation#

class grey_dilation#

Bases:

Perform grey dilation on an array.

Parameters:
  • array (np.ndarray) – The input array to perform grey dilation on.

  • size (Union[Union[int, tuple[int, int]], None] = None) – The size of the structuring element. If None, structure must be provided. If a single integer is provided, a square structuring element is created. For 1D arrays, use a tuple (size, 1) or (1, size) for horizontal or vertical operations.

  • structure (Union[np.ndarray, None] = None) – The structuring element. If None, size must be provided. For 1D operations on 2D arrays, use a 2D structure with one dimension being 1.

  • mode (PaddingType = "reflect") – The padding mode to use.

  • maxval (float = 1e4) – Value to assume for infinite elements in the kernel.

Returns:

The result of the grey dilation operation.

Return type:

np.ndarray

Raises:

ValueError – If both size and structure are None, or if the structuring element has even dimensions.

Inherited Common Usage

fun(size=None, structure=None, *, mode='reflect', maxval=10000.0)#

Perform grey dilation on an array.

Parameters:
  • array (np.ndarray) – The input array to perform grey dilation on.

  • size (Union[Union[int, tuple[int, int]], None] = None) – The size of the structuring element. If None, structure must be provided. If a single integer is provided, a square structuring element is created. For 1D arrays, use a tuple (size, 1) or (1, size) for horizontal or vertical operations.

  • structure (Union[np.ndarray, None] = None) – The structuring element. If None, size must be provided. For 1D operations on 2D arrays, use a 2D structure with one dimension being 1.

  • mode (PaddingType = "reflect") – The padding mode to use.

  • maxval (float = 1e4) – Value to assume for infinite elements in the kernel.

Returns:

The result of the grey dilation operation.

Return type:

np.ndarray

Raises:

ValueError – If both size and structure are None, or if the structuring element has even dimensions.