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.Shape
Nested classes/interfaces inherited from interface inra.ijpb.morphology.Strel3D
Strel3D.Shape
-
Field Summary
Fields inherited from interface inra.ijpb.morphology.Strel
BACKGROUND, FOREGROUND
Fields inherited from interface inra.ijpb.morphology.Strel3D
BACKGROUND, FOREGROUND
-
Method Summary
Modifier and Type Method Description static DiskStrel
fromDiameter(int diam)
Creates a structuring element with a circular shape of the given diameter.static DiskStrel
fromRadius(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.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.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.DiskStrel
reverse()
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, opening
Methods inherited from class inra.ijpb.morphology.strel.AbstractStrel
addBorder, cropBorder, getChannelName, getMask3D, getShifts3D, setChannelName
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
Methods inherited from interface inra.ijpb.morphology.strel.InPlaceStrel3D
inPlaceDilation, inPlaceErosion
Methods inherited from interface inra.ijpb.morphology.Strel
closing, dilation, erosion, getChannelName, opening, setChannelName
Methods 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:Strel
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. -
getMask
public int[][] getMask()Description copied from interface:Strel
Returns 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:Strel
Returns the offset in the mask. The first value corresponds to the shift in the x direction. -
getShifts
public int[][] getShifts()Description copied from interface:Strel
Returns 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:InPlaceStrel
The reverse structuring element of an InPlaceStrel is also an InPlaceStrel.- Specified by:
reverse
in interfaceInPlaceStrel
- Specified by:
reverse
in interfaceInPlaceStrel3D
- Specified by:
reverse
in interfaceStrel
- Specified by:
reverse
in 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:
inPlaceDilation
in 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:
inPlaceErosion
in interfaceInPlaceStrel
- Parameters:
image
- the image to process
-