Class CuboidStrel

All Implemented Interfaces:
Algo, AlgoListener, SeparableStrel3D, Strel3D

public class CuboidStrel
extends AbstractSeparableStrel3D
A cuboid structuring element, obtained by decomposition into linear structuring elements (that can have different sizes) along each dimension.
Author:
David Legland
See Also:
CubeStrel, EllipsoidStrel, LinearHorizontalStrel, LinearVerticalStrel, LinearDepthStrel3D
  • Method Details

    • fromDiameter

      public static final CuboidStrel fromDiameter​(int diam)
      Creates a new cube-shape structuring element with the specified diameter (equal to cube side length). All the dimensions of the resulting Cuboid are equal.
      Parameters:
      diam - the side length of the cube
      Returns:
      a new 3D cuboid structuring element
    • fromRadius

      public static final CuboidStrel fromRadius​(int radius)
      Creates a new cube-shape structuring element with the specified radius (such that cube side length equals 2 * radius + 1). All the dimensions of the resulting Cuboid are equal.
      Parameters:
      radius - the "radius" of the cube
      Returns:
      a new 3D cuboid structuring element
    • fromRadiusList

      public static final CuboidStrel fromRadiusList​(int radiusX, int radiusY, int radiusZ)
      Creates a 3D structuring element with a cuboid shape and different sizes depending on direction.
      Parameters:
      radiusX - radius in x direction
      radiusY - radius in y direction
      radiusZ - radius in z direction
      Returns:
      a new 3D cuboidal structuring element
    • fromDiameterList

      public static final CuboidStrel fromDiameterList​(int diamX, int diamY, int diamZ)
      Creates a 3D structuring element with a cuboid shape and different sizes depending on direction.
      Parameters:
      diamX - diameter in x direction
      diamY - diameter in y direction
      diamZ - diameter in z direction
      Returns:
      a new 3D cuboidal structuring element
    • 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 CuboidStrel reverse()
      Returns a cuboidal structuring element with same size, but offset located symmetrically with respect to structuring element center.
      Returns:
      the reversed version of this strel