Class LinearDepthStrel3D

All Implemented Interfaces:
Algo, InPlaceStrel3D, Strel3D

public class LinearDepthStrel3D
extends AbstractInPlaceStrel3D
An horizontal linear structuring element of a given length. Provides methods for fast in place erosion and dilation.
Author:
David Legland
See Also:
LinearVerticalStrel, LinearDiagUpStrel, LinearDiagDownStrel
  • Nested Class Summary

    Nested classes/interfaces inherited from interface inra.ijpb.morphology.Strel3D

    Strel3D.Shape
  • Field Summary

    Fields inherited from interface inra.ijpb.morphology.Strel3D

    BACKGROUND, FOREGROUND
  • Constructor Summary

    Constructors
    Constructor Description
    LinearDepthStrel3D​(int size)
    Creates a new horizontal linear structuring element of a given size.
    LinearDepthStrel3D​(int size, int offset)
    Creates a new horizontal linear structuring element of a given size and with a given offset.
  • Method Summary

    Modifier and Type Method Description
    static LinearDepthStrel3D fromDiameter​(int diam)
    Creates a new line-shape structuring element with the specified diameter (equal to the length of the line).
    static LinearDepthStrel3D fromRadius​(int radius)
    Creates a new line-shape structuring element with the specified radius (such that orthogonal diameter equals 2*radius+1).
    int[][][] getMask3D()
    Returns the structuring element as a mask.
    int[] getOffset()
    Returns the offset in the mask for each direction.
    int[][] getShifts3D()
    Returns the structuring element as a set of shifts.
    int[] getSize()
    Returns the size of the structuring element, as an array of size in each direction.
    void inPlaceDilation​(ij.ImageStack stack)
    Performs dilation of the stack given as argument, and stores the result in the same image.
    void inPlaceErosion​(ij.ImageStack stack)
    Performs erosion of the image given as argument, and stores the result in the same image.
    LinearDepthStrel3D reverse()
    Returns a linear horizontal line with same size and offset equal to size-offset-1.

    Methods inherited from class inra.ijpb.morphology.strel.AbstractInPlaceStrel3D

    closing, dilation, erosion, opening

    Methods inherited from class inra.ijpb.morphology.strel.AbstractStrel3D

    addBorder, cropBorder, showProgress, showProgress

    Methods inherited from class inra.ijpb.algo.AlgoStub

    addAlgoListener, removeAlgoListener

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface inra.ijpb.algo.Algo

    addAlgoListener, removeAlgoListener

    Methods inherited from interface inra.ijpb.morphology.Strel3D

    showProgress, showProgress
  • Constructor Details

    • LinearDepthStrel3D

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

      public LinearDepthStrel3D​(int size, int offset)
      Creates a new horizontal 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 LinearDepthStrel3D 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 Z direction
      Returns:
      a new linear structuring element
    • fromRadius

      public static final LinearDepthStrel3D 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.ImageStack stack)
      Description copied from interface: InPlaceStrel3D
      Performs dilation of the stack given as argument, and stores the result in the same image.
      Parameters:
      stack - the input image stack to dilate
    • inPlaceErosion

      public void inPlaceErosion​(ij.ImageStack stack)
      Description copied from interface: InPlaceStrel3D
      Performs erosion of the image given as argument, and stores the result in the same image.
      Parameters:
      stack - the input image stack to erode
    • 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 LinearDepthStrel3D reverse()
      Returns a linear horizontal line with same size and offset equal to size-offset-1.
      Returns:
      the reversed structuring element
      See Also:
      Strel.reverse()