Class LinearVerticalStrel

All Implemented Interfaces:
Algo, Strel, InPlaceStrel, InPlaceStrel3D, Strel3D

public class LinearVerticalStrel
extends AbstractInPlaceStrel
A vertical linear structuring element of a given length. Provides methods for fast in place erosion and dilation.
Author:
David Legland
See Also:
LinearHorizontalStrel, LinearDiagUpStrel, LinearDiagDownStrel
  • Constructor Details

    • LinearVerticalStrel

      public LinearVerticalStrel​(int size)
      Creates a new vertical linear structuring element of a given size.
      Parameters:
      size - the number of pixels in this structuring element
    • LinearVerticalStrel

      public LinearVerticalStrel​(int size, int offset)
      Creates a new vertical linear structuring element of a given size and with a given offset.
      Parameters:
      size - the number of pixels in this structuring element
      offset - the position of the reference pixel (between 0 and size-1)
  • Method Details

    • fromDiameter

      public static final LinearVerticalStrel fromDiameter​(int diam)
      Creates a new line-shape structuring element with the specified diameter (equal to the length of the line).
      Parameters:
      diam - the length of the line along the Y direction
      Returns:
      a new linear structuring element
    • fromRadius

      public static final LinearVerticalStrel fromRadius​(int radius)
      Creates a new line-shape structuring element with the specified radius (such that orthogonal diameter equals 2*radius+1).
      Parameters:
      radius - the radius of the line, such that line length equals 2*radius+1
      Returns:
      a new linear structuring element
    • inPlaceDilation

      public void inPlaceDilation​(ij.process.ImageProcessor image)
      Description copied from interface: InPlaceStrel
      Performs dilation of the image given as argument, and stores the result in the same image.
      Parameters:
      image - the input image to dilate
    • inPlaceErosion

      public void inPlaceErosion​(ij.process.ImageProcessor image)
      Description copied from interface: InPlaceStrel
      Performs erosion of the image given as argument, and stores the result in the same image.
      Parameters:
      image - the input image to erode
    • getMask

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

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

      public int[][] getShifts()
      Description copied from interface: Strel
      Returns the structuring element as a set of shifts. The size of the result is N-by-2, 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: Strel
      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 LinearVerticalStrel reverse()
      Returns a linear vertical line with same size and offset equal to size-offset-1.
      Returns:
      the reversed structuring element
      See Also:
      Strel.reverse()