Package inra.ijpb.morphology.strel
Class DiskStrel
java.lang.Object
inra.ijpb.algo.AlgoStub
inra.ijpb.morphology.strel.AbstractStrel3D
inra.ijpb.morphology.strel.AbstractStrel
inra.ijpb.morphology.strel.AbstractInPlaceStrel
inra.ijpb.morphology.strel.DiskStrel
- All Implemented Interfaces:
Algo,Strel,InPlaceStrel,InPlaceStrel3D,Strel3D
public class DiskStrel extends AbstractInPlaceStrel implements InPlaceStrel
Disk structuring element. This class is a wrapper for the ImageJ native
RankFilters() method, that uses disk neighborhood.
- Author:
- David Legland
-
Nested Class Summary
Nested classes/interfaces inherited from interface inra.ijpb.morphology.Strel
Strel.ShapeNested classes/interfaces inherited from interface inra.ijpb.morphology.Strel3D
Strel3D.Shape -
Field Summary
Fields inherited from interface inra.ijpb.morphology.Strel
BACKGROUND, FOREGROUNDFields inherited from interface inra.ijpb.morphology.Strel3D
BACKGROUND, FOREGROUND -
Method Summary
Modifier and Type Method Description static DiskStrelfromDiameter(int diam)Creates a structuring element with a circular shape of the given diameter.static DiskStrelfromRadius(int radius)Creates a structuring element with a circular shape of the given radius.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.voidinPlaceDilation(ij.process.ImageProcessor image)Performs in-place dilation with a disk structuring element by calling the ImageJ native RankFilters algorithm, using RankFilters.MAX option.voidinPlaceErosion(ij.process.ImageProcessor image)Performs in-place erosion with a disk structuring element by calling the ImageJ native RankFilters algorithm, using RankFilters.MIN option.DiskStrelreverse()The reverse structuring element of an InPlaceStrel is also an InPlaceStrel.Methods inherited from class inra.ijpb.morphology.strel.AbstractInPlaceStrel
closing, closing, dilation, dilation, erosion, erosion, inPlaceDilation, inPlaceErosion, opening, openingMethods inherited from class inra.ijpb.morphology.strel.AbstractStrel
addBorder, cropBorder, getChannelName, getMask3D, getShifts3D, setChannelNameMethods inherited from class inra.ijpb.morphology.strel.AbstractStrel3D
addBorder, cropBorder, showProgress, showProgressMethods 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, removeAlgoListenerMethods inherited from interface inra.ijpb.morphology.strel.InPlaceStrel3D
inPlaceDilation, inPlaceErosionMethods inherited from interface inra.ijpb.morphology.Strel
closing, dilation, erosion, getChannelName, opening, setChannelNameMethods inherited from interface inra.ijpb.morphology.Strel3D
closing, dilation, erosion, getMask3D, getShifts3D, opening, showProgress, showProgress
-
Method Details
-
fromRadius
Creates a structuring element with a circular shape of the given radius.- Parameters:
radius- the radius of the structuring element, in pixels- Returns:
- a new structuring element with disk shape and specified radius
-
fromDiameter
Creates a structuring element with a circular shape of the given diameter. The diameter is converted to a radius with following relation:radius = (diameter - 1) / 2- Parameters:
diam- the diameter of the structuring element, in pixels- Returns:
- a new structuring element with disk shape and specified diameter
-
getSize
public int[] getSize()Description copied from interface:StrelReturns 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. -
getMask
public int[][] getMask()Description copied from interface:StrelReturns 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. -
getOffset
public int[] getOffset()Description copied from interface:StrelReturns the offset in the mask. The first value corresponds to the shift in the x direction. -
getShifts
public int[][] getShifts()Description copied from interface:StrelReturns 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. -
reverse
Description copied from interface:InPlaceStrelThe reverse structuring element of an InPlaceStrel is also an InPlaceStrel.- Specified by:
reversein interfaceInPlaceStrel- Specified by:
reversein interfaceInPlaceStrel3D- Specified by:
reversein interfaceStrel- Specified by:
reversein interfaceStrel3D- Returns:
- the reversed structuring element
-
inPlaceDilation
public void inPlaceDilation(ij.process.ImageProcessor image)Performs in-place dilation with a disk structuring element by calling the ImageJ native RankFilters algorithm, using RankFilters.MAX option.- Specified by:
inPlaceDilationin interfaceInPlaceStrel- Parameters:
image- the image to process
-
inPlaceErosion
public void inPlaceErosion(ij.process.ImageProcessor image)Performs in-place erosion with a disk structuring element by calling the ImageJ native RankFilters algorithm, using RankFilters.MIN option.- Specified by:
inPlaceErosionin interfaceInPlaceStrel- Parameters:
image- the image to process
-