Class LinearDiagUpStrel

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

public class LinearDiagUpStrel
extends AbstractInPlaceStrel
A diagonal linear structuring element of a given length, with direction vector (+1,-1) in image coordinate system. Provides methods for fast in place erosion and dilation.
Author:
David Legland
See Also:
LinearHorizontalStrel, LinearVerticalStrel, LinearDiagDownStrel
  • Constructor Details

    • LinearDiagUpStrel

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

      public LinearDiagUpStrel​(int size, int offset)
      Creates a new diagonal 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 LinearDiagUpStrel fromDiameter​(int diam)
      Creates a new line-shape structuring element with the specified diameter (equal to the orthogonal length of the line).
      Parameters:
      diam - the orthogonal diameter of the line
      Returns:
      a new linear structuring element
    • fromRadius

      public static final LinearDiagUpStrel 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 LinearDiagUpStrel reverse()
      Returns a linear diagonal line with same size and offset equal to size-offset.
      Returns:
      the reversed structuring element
      See Also:
      Strel.reverse()