Class EllipsoidStrel

java.lang.Object
inra.ijpb.algo.AlgoStub
inra.ijpb.morphology.strel.AbstractStrel3D
inra.ijpb.morphology.strel.EllipsoidStrel
All Implemented Interfaces:
Algo, Strel3D

public class EllipsoidStrel
extends AbstractStrel3D
A 3D structuring element with an ellipsoidal shape, oriented along the three main axes of the image.
Author:
dlegland
See Also:
BallStrel
  • 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
  • Method Summary

    Modifier and Type Method Description
    ij.ImageStack dilation​(ij.ImageStack image)
    Performs dilation with a ball structuring element by calling the ImageJ Filters3D.filter method, using Filters3D.MAX option.
    ij.ImageStack erosion​(ij.ImageStack image)
    Performs erosion with a ball structuring element by calling the ImageJ Filters3D.filter method, using Filters3D.MIN option.
    static EllipsoidStrel fromDiameter​(double diam)
    Creates a structuring element with an ellipsoidal shape of the given diameter.
    static EllipsoidStrel fromDiameterList​(double diamX, double diamY, double diamZ)
    Creates a structuring element with an ellipsoidal shape from a list of three diameters.
    static EllipsoidStrel fromRadius​(double radius)
    Creates a structuring element with an ellipsoidal shape of the given radius.
    static EllipsoidStrel fromRadiusList​(double radiusX, double radiusY, double radiusZ)
    Creates a structuring element with an ellipsoidal shape from a list of three radius.
    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.
    Strel3D reverse()
    Returns this instance, as an ellipsoid is symmetric.

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

    addBorder, closing, cropBorder, opening, 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
  • Method Details

    • fromRadius

      public static final EllipsoidStrel fromRadius​(double radius)
      Creates a structuring element with an ellipsoidal shape of the given radius.
      Parameters:
      radius - the radius of the structuring element, in pixels
      Returns:
      a new structuring element with spherical shape and specified radius
    • fromRadiusList

      public static final EllipsoidStrel fromRadiusList​(double radiusX, double radiusY, double radiusZ)
      Creates a structuring element with an ellipsoidal shape from a list of three radius.
      Parameters:
      radiusX - the radius along the X-axis
      radiusY - the radius along the Y-axis
      radiusZ - the radius along the Z-axis
      Returns:
      a new structuring element with ellipsoid shape
    • fromDiameter

      public static final EllipsoidStrel fromDiameter​(double diam)
      Creates a structuring element with an ellipsoidal shape of the given diameter.
      Parameters:
      diam - the diameter of the structuring element, in pixels
      Returns:
      a new structuring element with spherical shape and specified diameter
    • fromDiameterList

      public static final EllipsoidStrel fromDiameterList​(double diamX, double diamY, double diamZ)
      Creates a structuring element with an ellipsoidal shape from a list of three diameters.
      Parameters:
      diamX - the diameter along the X-axis
      diamY - the diameter along the Y-axis
      diamZ - the diameter along the Z-axis
      Returns:
      a new structuring element with ellipsoid shape
    • 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
    • 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
    • reverse

      public Strel3D reverse()
      Returns this instance, as an ellipsoid is symmetric.
      Returns:
      this instance of EllipsoidStrel
    • dilation

      public ij.ImageStack dilation​(ij.ImageStack image)
      Performs dilation with a ball structuring element by calling the ImageJ Filters3D.filter method, using Filters3D.MAX option.
      Specified by:
      dilation in interface Strel3D
      Overrides:
      dilation in class AbstractStrel3D
      Parameters:
      image - the 3D stack to process
      Returns:
      the result of the dilation
      See Also:
      Strel3D.getShifts3D(), AbstractStrel3D.erosion(ImageStack)
    • erosion

      public ij.ImageStack erosion​(ij.ImageStack image)
      Performs erosion with a ball structuring element by calling the ImageJ Filters3D.filter method, using Filters3D.MIN option.
      Specified by:
      erosion in interface Strel3D
      Overrides:
      erosion in class AbstractStrel3D
      Parameters:
      image - the 3D stack to process
      Returns:
      the result of the erosion
      See Also:
      Strel3D.getShifts3D(), AbstractStrel3D.dilation(ImageStack)