Class OrientedLineStrel

java.lang.Object
All Implemented Interfaces:
Algo, Strel, Strel3D

public class OrientedLineStrel
extends AbstractStrel
implements Strel
A linear structuring element, defined by a length and an orientation.
Author:
David Legland
  • Nested Class Summary

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

    Strel.Shape

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

    Strel3D.Shape
  • Field Summary

    Fields inherited from interface inra.ijpb.morphology.Strel

    BACKGROUND, FOREGROUND

    Fields inherited from interface inra.ijpb.morphology.Strel3D

    BACKGROUND, FOREGROUND
  • Constructor Summary

    Constructors
    Constructor Description
    OrientedLineStrel​(double length, double angleInDegrees)
    Creates an new instance of linear structuring element.
  • Method Summary

    Modifier and Type Method Description
    ij.process.ImageProcessor closing​(ij.process.ImageProcessor image)
    Performs a morphological closing of the input image with this structuring element, and returns the result in a new ImageProcessor.
    ij.process.ImageProcessor dilation​(ij.process.ImageProcessor image)
    Performs a morphological dilation of the input image with this structuring element, and returns the result in a new ImageProcessor.
    ij.process.ImageProcessor erosion​(ij.process.ImageProcessor image)
    Performs an morphological erosion of the input image with this structuring element, and returns the result in a new ImageProcessor.
    int[][] getMask()
    Returns the structuring element as a mask.
    int[] getOffset()
    Returns the offset in the mask.
    int[][] getShifts()
    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.
    ij.process.ImageProcessor opening​(ij.process.ImageProcessor image)
    Performs a morphological opening of the input image with this structuring element, and returns the result in a new ImageProcessor.
    Strel reverse()
    Returns this structuring element, as oriented line structuring elements are symmetric by definition.

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

    closing, dilation, erosion, getChannelName, getMask3D, getShifts3D, opening, setChannelName

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

    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.Strel

    getChannelName, setChannelName

    Methods inherited from interface inra.ijpb.morphology.Strel3D

    closing, dilation, erosion, getMask3D, getShifts3D, opening, showProgress, showProgress
  • Constructor Details

    • OrientedLineStrel

      public OrientedLineStrel​(double length, double angleInDegrees)
      Creates an new instance of linear structuring element. The number of pixels composing the line may differ from the specified length due to rounding effects.
      Parameters:
      length - the (approximate) length of the structuring element.
      angleInDegrees - the angle with the horizontal of the structuring element
  • Method Details

    • getSize

      public int[] getSize()
      Returns the size of the structuring element, as an array of size in each direction.
      Specified by:
      getSize in interface Strel
      Specified by:
      getSize in interface Strel3D
      Returns:
      the size of the structuring element
    • getMask

      public int[][] getMask()
      Returns the structuring element as a mask. Each value is either 0 or 255.
      Specified by:
      getMask in interface Strel
      Returns:
      the mask of the structuring element
    • getOffset

      public int[] getOffset()
      Returns the offset in the mask.
      Specified by:
      getOffset in interface Strel
      Specified by:
      getOffset in interface Strel3D
      Returns:
      the offset in the mask
    • getShifts

      public int[][] getShifts()
      Returns the structuring element as a set of shifts.
      Specified by:
      getShifts in interface Strel
      Returns:
      a set of shifts
    • dilation

      public ij.process.ImageProcessor dilation​(ij.process.ImageProcessor image)
      Description copied from interface: Strel
      Performs a morphological dilation of the input image with this structuring element, and returns the result in a new ImageProcessor.
      Specified by:
      dilation in interface Strel
      Parameters:
      image - the input image
      Returns:
      the result of dilation with this structuring element
      See Also:
      Strel.erosion(ij.process.ImageProcessor), Strel.closing(ij.process.ImageProcessor), Strel.opening(ij.process.ImageProcessor)
    • erosion

      public ij.process.ImageProcessor erosion​(ij.process.ImageProcessor image)
      Description copied from interface: Strel
      Performs an morphological erosion of the input image with this structuring element, and returns the result in a new ImageProcessor.
      Specified by:
      erosion in interface Strel
      Parameters:
      image - the input image
      Returns:
      the result of erosion with this structuring element
      See Also:
      Strel.dilation(ij.process.ImageProcessor), Strel.closing(ij.process.ImageProcessor), Strel.opening(ij.process.ImageProcessor)
    • closing

      public ij.process.ImageProcessor closing​(ij.process.ImageProcessor image)
      Description copied from interface: Strel
      Performs a morphological closing of the input image with this structuring element, and returns the result in a new ImageProcessor. The closing is equivalent in performing a dilation followed by an erosion with the reversed structuring element.
      Specified by:
      closing in interface Strel
      Parameters:
      image - the input image
      Returns:
      the result of closing with this structuring element
      See Also:
      Strel.dilation(ij.process.ImageProcessor), Strel.erosion(ij.process.ImageProcessor), Strel.opening(ij.process.ImageProcessor), Strel.reverse()
    • opening

      public ij.process.ImageProcessor opening​(ij.process.ImageProcessor image)
      Description copied from interface: Strel
      Performs a morphological opening of the input image with this structuring element, and returns the result in a new ImageProcessor. The opening is equivalent in performing an erosion followed by a dilation with the reversed structuring element.
      Specified by:
      opening in interface Strel
      Parameters:
      image - the input image
      Returns:
      the result of opening with this structuring element
      See Also:
      Strel.dilation(ij.process.ImageProcessor), Strel.erosion(ij.process.ImageProcessor), Strel.closing(ij.process.ImageProcessor), Strel.reverse()
    • reverse

      public Strel reverse()
      Returns this structuring element, as oriented line structuring elements are symmetric by definition.
      Specified by:
      reverse in interface Strel
      Specified by:
      reverse in interface Strel3D
      Returns:
      the reversed structuring element