Package inra.ijpb.morphology.strel
Class AbstractStrel3D
java.lang.Object
inra.ijpb.algo.AlgoStub
inra.ijpb.morphology.strel.AbstractStrel3D
- 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.ImageStackaddBorder(ij.ImageStack image)Adds a border around the image, to avoid edge effects when performing morphological closing or opening.ij.ImageStackclosing(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.ImageStackcropBorder(ij.ImageStack image)Retrieve the portion of image that corresponds to the original image before adding border.ij.ImageStackdilation(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.ImageStackerosion(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.ImageStackopening(ij.ImageStack image)Performs a morphological opening on the input stack, by applying first an erosion, then a dilation with the reversed structuring element.booleanshowProgress()Returns a boolean flag indicating whether or not this structuring element should display its progress or notvoidshowProgress(boolean b)Specifies if this structuring element should display its progress.Methods inherited from class inra.ijpb.algo.AlgoStub
addAlgoListener, removeAlgoListenerMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface inra.ijpb.algo.Algo
addAlgoListener, removeAlgoListener
-
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:Strel3DReturns a boolean flag indicating whether or not this structuring element should display its progress or not- Specified by:
showProgressin interfaceStrel3D- Returns:
- a boolean flag with value true if progress should be displayed
-
showProgress
public void showProgress(boolean b)Description copied from interface:Strel3DSpecifies if this structuring element should display its progress.- Specified by:
showProgressin interfaceStrel3D- 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 thegetShifts()method.- Specified by:
dilationin interfaceStrel3D- 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 thegetShifts()method.- Specified by:
erosionin interfaceStrel3D- 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:
closingin interfaceStrel3D- 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:
openingin interfaceStrel3D- Parameters:
image- the input image- Returns:
- the result of closing with this structuring element
- See Also:
dilation(ImageStack),erosion(ImageStack),closing(ImageStack),Strel3D.reverse()
-