Class AbstractStrel3D

java.lang.Object
inra.ijpb.algo.AlgoStub
inra.ijpb.morphology.strel.AbstractStrel3D
All Implemented Interfaces:
Algo, Strel3D
Direct Known Subclasses:
AbstractInPlaceStrel3D, AbstractSeparableStrel3D, AbstractStrel, BallStrel, ChamferStrel3D, Cross3DStrel, EllipsoidStrel, ExtrudedStrel

public abstract class AbstractStrel3D
extends AlgoStub
implements Strel3D
Implementation basis for 3D structuring elements
Author:
David Legland
  • 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
    AbstractStrel3D()  
  • Method Summary

    Modifier and Type Method Description
    ij.ImageStack addBorder​(ij.ImageStack image)
    Adds a border around the image, to avoid edge effects when performing morphological closing or opening.
    ij.ImageStack closing​(ij.ImageStack image)
    Performs a morphological closing on the input stack, by applying first a dilation, then an erosion with the reversed structuring element.
    ij.ImageStack cropBorder​(ij.ImageStack image)
    Retrieve the portion of image that corresponds to the original image before adding border.
    ij.ImageStack dilation​(ij.ImageStack image)
    Implements a default algorithm for dilation, that consists in iterating over the neighbors of each pixel to compute the maximum value.
    ij.ImageStack erosion​(ij.ImageStack image)
    Implements a default algorithm for erosion, that consists in iterating over the neighbors of each pixel to compute the minimum value.
    ij.ImageStack opening​(ij.ImageStack image)
    Performs a morphological opening on the input stack, by applying first an erosion, then a dilation with the reversed structuring element.
    boolean showProgress()
    Returns a boolean flag indicating whether or not this structuring element should display its progress or not
    void showProgress​(boolean b)
    Specifies if this structuring element should display its progress.

    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

    getMask3D, getOffset, getShifts3D, getSize, reverse
  • Constructor Details

    • AbstractStrel3D

      public AbstractStrel3D()
  • Method Details

    • addBorder

      public ij.ImageStack addBorder​(ij.ImageStack image)
      Adds a border around the image, to avoid edge effects when performing morphological closing or opening. The size of the border is determined by Strel size and offset. Replicated border strategy is used to expand image.
      Parameters:
      image - the image to pad
      Returns:
      the image with border extended.
      See Also:
      cropBorder(ImageStack)
    • cropBorder

      public ij.ImageStack cropBorder​(ij.ImageStack image)
      Retrieve the portion of image that corresponds to the original image before adding border. The crop parameters are retrieved from strel size and offset. This method works together with the addBorder method. In practice, we retrieve the input image if we perform the following:
      
       ImageStack result = strel3d.cropBorder(strel3d.addBorder(inputImage));
       
      Parameters:
      image - the image to crop
      Returns:
      the image with strel padding removed.
      See Also:
      addBorder(ImageStack)
    • showProgress

      public boolean showProgress()
      Description copied from interface: Strel3D
      Returns a boolean flag indicating whether or not this structuring element should display its progress or not
      Specified by:
      showProgress in interface Strel3D
      Returns:
      a boolean flag with value true if progress should be displayed
    • showProgress

      public void showProgress​(boolean b)
      Description copied from interface: Strel3D
      Specifies if this structuring element should display its progress.
      Specified by:
      showProgress in interface Strel3D
      Parameters:
      b - a boolean flag with value true if progress should be displayed
    • dilation

      public ij.ImageStack dilation​(ij.ImageStack image)
      Implements a default algorithm for dilation, that consists in iterating over the neighbors of each pixel to compute the maximum value. The neighbors are obtained via the getShifts() method.
      Specified by:
      dilation in interface Strel3D
      Parameters:
      image - the input image
      Returns:
      the result of dilation with this structuring element
      See Also:
      Strel3D.getShifts3D(), erosion(ImageStack)
    • erosion

      public ij.ImageStack erosion​(ij.ImageStack image)
      Implements a default algorithm for erosion, that consists in iterating over the neighbors of each pixel to compute the minimum value. The neighbors are obtained via the getShifts() method.
      Specified by:
      erosion in interface Strel3D
      Parameters:
      image - the input image
      Returns:
      the result of erosion with this structuring element
      See Also:
      Strel3D.getShifts3D(), dilation(ImageStack)
    • closing

      public ij.ImageStack closing​(ij.ImageStack image)
      Performs a morphological closing on the input stack, by applying first a dilation, then an erosion with the reversed structuring element.
      Specified by:
      closing in interface Strel3D
      Parameters:
      image - the input image
      Returns:
      the result of closing with this structuring element
      See Also:
      dilation(ImageStack), erosion(ImageStack), opening(ImageStack), Strel3D.reverse()
    • opening

      public ij.ImageStack opening​(ij.ImageStack image)
      Performs a morphological opening on the input stack, by applying first an erosion, then a dilation with the reversed structuring element.
      Specified by:
      opening in interface Strel3D
      Parameters:
      image - the input image
      Returns:
      the result of closing with this structuring element
      See Also:
      dilation(ImageStack), erosion(ImageStack), closing(ImageStack), Strel3D.reverse()