Class Cross3DStrel

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

public class Cross3DStrel
extends AbstractStrel3D
3D structuring element representing a 3x3x3 cross, that considers the center voxel together with the six orthogonal neighbors.
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
    Cross3DStrel()
    Create a new instance of this structuring element.
  • Method Summary

    Modifier and Type Method Description
    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 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.
    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.
    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.
    Strel3D reverse()
    Returns a reversed (i.e. symmetric wrt the origin) version of this structuring element.

    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
  • Constructor Details

    • Cross3DStrel

      public Cross3DStrel()
      Create a new instance of this structuring element.
  • Method Details

    • 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()
      Description copied from interface: Strel3D
      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.
      Returns:
      the reversed structuring element
    • dilation

      public ij.ImageStack dilation​(ij.ImageStack image)
      Description copied from class: AbstractStrel3D
      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
      Overrides:
      dilation in class AbstractStrel3D
      Parameters:
      image - the input image
      Returns:
      the result of dilation with this structuring element
      See Also:
      Strel3D.getShifts3D(), AbstractStrel3D.erosion(ImageStack)
    • erosion

      public ij.ImageStack erosion​(ij.ImageStack image)
      Description copied from class: AbstractStrel3D
      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
      Overrides:
      erosion in class AbstractStrel3D
      Parameters:
      image - the input image
      Returns:
      the result of erosion with this structuring element
      See Also:
      Strel3D.getShifts3D(), AbstractStrel3D.dilation(ImageStack)
    • closing

      public ij.ImageStack closing​(ij.ImageStack image)
      Description copied from class: AbstractStrel3D
      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
      Overrides:
      closing in class AbstractStrel3D
      Parameters:
      image - the input image
      Returns:
      the result of closing with this structuring element
      See Also:
      AbstractStrel3D.dilation(ImageStack), AbstractStrel3D.erosion(ImageStack), AbstractStrel3D.opening(ImageStack), Strel3D.reverse()
    • opening

      public ij.ImageStack opening​(ij.ImageStack image)
      Description copied from class: AbstractStrel3D
      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
      Overrides:
      opening in class AbstractStrel3D
      Parameters:
      image - the input image
      Returns:
      the result of closing with this structuring element
      See Also:
      AbstractStrel3D.dilation(ImageStack), AbstractStrel3D.erosion(ImageStack), AbstractStrel3D.closing(ImageStack), Strel3D.reverse()