Interface Strel

All Superinterfaces:
Algo, Strel3D
All Known Subinterfaces:
InPlaceStrel, SeparableStrel
All Known Implementing Classes:
AbstractInPlaceStrel, AbstractSeparableStrel, AbstractStrel, ChamferStrel, Cross3x3Strel, DiamondStrel, DiskStrel, LinearDiagDownStrel, LinearDiagUpStrel, LinearHorizontalStrel, LinearVerticalStrel, OctagonStrel, OrientedLineStrel, SquareStrel

public interface Strel
extends Strel3D
Interface for planar structuring elements.

  // Creates a 5x5 square structuring element
  Strel strel = Strel.Shape.SQUARE.fromRadius(2);
  // applies dilation on current image
  ImageProcessor image = IJ.getImage().getProcessor();
  ImageProcessor dilated = strel.dilation(image);
  // Display results
  new ImagePlus("dilated", dilated).show();
 
Author:
David Legland
  • Nested Class Summary

    Nested Classes
    Modifier and Type Interface Description
    static class  Strel.Shape
    An enumeration of the different possible structuring element shapes.
  • Field Summary

    Fields
    Modifier and Type Field Description
    static int BACKGROUND
    Default value for background pixels.
    static int FOREGROUND
    Default value for foreground pixels.
  • 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.
    java.lang.String getChannelName()
    Returns the name of the channel currently processed, or null by default.
    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 a reversed (i.e. symmetric wrt the origin) version of this structuring element.
    void setChannelName​(java.lang.String channelName)
    Sets the name of the currently processed channel, for process monitoring.

    Methods inherited from interface inra.ijpb.algo.Algo

    addAlgoListener, removeAlgoListener

    Methods inherited from interface inra.ijpb.morphology.Strel3D

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

    • BACKGROUND

      static final int BACKGROUND
      Default value for background pixels.
      See Also:
      Constant Field Values
    • FOREGROUND

      static final int FOREGROUND
      Default value for foreground pixels.
      See Also:
      Constant Field Values
  • Method Details

    • getSize

      int[] getSize()
      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.
      Specified by:
      getSize in interface Strel3D
      Returns:
      the size of the structuring element
    • getMask

      int[][] getMask()
      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

      int[] getOffset()
      Returns the offset in the mask. The first value corresponds to the shift in the x direction.
      Specified by:
      getOffset in interface Strel3D
      Returns:
      the offset in the mask
    • getShifts

      int[][] getShifts()
      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
    • reverse

      Strel reverse()
      Returns a reversed (i.e. symmetric wrt the origin) version of this structuring element. Implementations can return more specialized type depending on the implemented interfaces.
      Specified by:
      reverse in interface Strel3D
      Returns:
      the reversed structuring element
    • dilation

      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.
      Parameters:
      image - the input image
      Returns:
      the result of dilation with this structuring element
      See Also:
      erosion(ij.process.ImageProcessor), closing(ij.process.ImageProcessor), opening(ij.process.ImageProcessor)
    • erosion

      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.
      Parameters:
      image - the input image
      Returns:
      the result of erosion with this structuring element
      See Also:
      dilation(ij.process.ImageProcessor), closing(ij.process.ImageProcessor), opening(ij.process.ImageProcessor)
    • closing

      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. The closing is equivalent in performing a dilation followed by an erosion with the reversed structuring element.
      Parameters:
      image - the input image
      Returns:
      the result of closing with this structuring element
      See Also:
      dilation(ij.process.ImageProcessor), erosion(ij.process.ImageProcessor), opening(ij.process.ImageProcessor), reverse()
    • opening

      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. The opening is equivalent in performing an erosion followed by a dilation with the reversed structuring element.
      Parameters:
      image - the input image
      Returns:
      the result of opening with this structuring element
      See Also:
      dilation(ij.process.ImageProcessor), erosion(ij.process.ImageProcessor), closing(ij.process.ImageProcessor), reverse()
    • setChannelName

      void setChannelName​(java.lang.String channelName)
      Sets the name of the currently processed channel, for process monitoring.
      Parameters:
      channelName - the name of the currently processed channel
    • getChannelName

      java.lang.String getChannelName()
      Returns the name of the channel currently processed, or null by default.
      Returns:
      the name of the currently processed channel