Class CubeStrel

All Implemented Interfaces:
Algo, AlgoListener, SeparableStrel3D, Strel3D

public class CubeStrel
extends AbstractSeparableStrel3D
A cubic structuring element, obtained by decomposition into linear structuring elements with the same size along each dimension.
Author:
David Legland
See Also:
BallStrel, LinearHorizontalStrel, LinearVerticalStrel, LinearDepthStrel3D
  • Constructor Details

    • CubeStrel

      public CubeStrel​(int size)
      Creates a new cubic structuring element of a given size.
      Parameters:
      size - the length of each side of the cube
    • CubeStrel

      public CubeStrel​(int size, int offset)
      Creates a new cubic structuring element of a given size and with a given offset.
      Parameters:
      size - the length of each side of the cube
      offset - the position of the reference pixel in each direction
  • Method Details

    • fromDiameter

      public static final CubeStrel fromDiameter​(int diam)
      Creates a new cube-shape structuring element with the specified diameter (equal to cube side length).
      Parameters:
      diam - the side length of the cube
      Returns:
      a new CubeStrel instance
    • fromRadius

      public static final CubeStrel fromRadius​(int radius)
      Creates a new cube-shape structuring element with the specified radius (such that cube side length equals 2 * radius + 1).
      Parameters:
      radius - the "radius" of the cube
      Returns:
      a new CubeStrel instance
    • decompose

      public java.util.Collection<InPlaceStrel3D> decompose()
      Returns a collection of three linear-shape structuring element, along each principal direction.
      Returns:
      a collection of three in place structuring elements
      See Also:
      SeparableStrel.decompose()
    • getMask3D

      public int[][][] getMask3D()
      Description copied from interface: Strel3D
      Returns the structuring element as a mask. Each value is either 0 or 255. The first index corresponds to the z position, the second index to the y direction, and the third one to the x position.
      Returns:
      the mask of the structuring element
    • getOffset

      public int[] getOffset()
      Description copied from interface: Strel3D
      Returns the offset in the mask for each direction. The first value corresponds to the shift in the x direction.
      Returns:
      the offset in the mask
    • getShifts3D

      public int[][] getShifts3D()
      Description copied from interface: Strel3D
      Returns the structuring element as a set of shifts. The size of the result is N-by-3, where N is the number of elements of the structuring element. The first value corresponds to the shift in the x direction.
      Returns:
      a set of shifts
    • getSize

      public int[] getSize()
      Description copied from interface: Strel3D
      Returns the size of the structuring element, as an array of size in each direction. The first index corresponds to the number of pixels in the x direction.
      Returns:
      the size of the structuring element
    • reverse

      public CubeStrel reverse()
      Description copied from interface: SeparableStrel3D
      The reversed structuring element of a separable strel is also separable.
      Returns:
      the reversed structuring element