Package inra.ijpb.morphology.strel
Class LinearDiagDownStrel
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.LinearDiagDownStrel
- All Implemented Interfaces:
Algo
,Strel
,InPlaceStrel
,InPlaceStrel3D
,Strel3D
public class LinearDiagDownStrel extends AbstractInPlaceStrel
A diagonal linear structuring element of a given length, with direction
vector (+1,+1) in image coordinate system.
Provides methods for fast in place erosion and dilation.
- Author:
- David Legland
- See Also:
LinearHorizontalStrel
,LinearVerticalStrel
,LinearDiagUpStrel
-
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
-
Constructor Summary
Constructors Constructor Description LinearDiagDownStrel(int size)
Creates a new diagonal linear structuring element of a given size.LinearDiagDownStrel(int size, int offset)
Creates a new diagonal linear structuring element of a given size and with a given offset. -
Method Summary
Modifier and Type Method Description static LinearDiagDownStrel
fromDiameter(int diam)
Creates a new line-shape structuring element with the specified diameter (equal to the orthogonal length of the line).static LinearDiagDownStrel
fromRadius(int radius)
Creates a new line-shape structuring element with the specified radius (such that orthogonal diameter equals 2*radius+1).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 dilation of the image given as argument, and stores the result in the same image.void
inPlaceErosion(ij.process.ImageProcessor image)
Performs erosion of the image given as argument, and stores the result in the same image.LinearDiagDownStrel
reverse()
Returns a linear diagonal line with same size and offset equal to size-offset.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
getChannelName, setChannelName
Methods inherited from interface inra.ijpb.morphology.Strel3D
getMask3D, getShifts3D, showProgress, showProgress
-
Constructor Details
-
LinearDiagDownStrel
public LinearDiagDownStrel(int size)Creates a new diagonal linear structuring element of a given size.- Parameters:
size
- the number of pixels in this structuring element
-
LinearDiagDownStrel
public LinearDiagDownStrel(int size, int offset)Creates a new diagonal linear structuring element of a given size and with a given offset.- Parameters:
size
- the number of pixels in this structuring elementoffset
- the position of the reference pixel (between 0 and size-1)
-
-
Method Details
-
fromDiameter
Creates a new line-shape structuring element with the specified diameter (equal to the orthogonal length of the line).- Parameters:
diam
- the orthogonal diameter of the line- Returns:
- a new linear structuring element
-
fromRadius
Creates a new line-shape structuring element with the specified radius (such that orthogonal diameter equals 2*radius+1).- Parameters:
radius
- the radius of the line, such that line length equals 2*radius+1- Returns:
- a new linear structuring element
-
inPlaceDilation
public void inPlaceDilation(ij.process.ImageProcessor image)Description copied from interface:InPlaceStrel
Performs dilation of the image given as argument, and stores the result in the same image.- Parameters:
image
- the input image to dilate
-
inPlaceErosion
public void inPlaceErosion(ij.process.ImageProcessor image)Description copied from interface:InPlaceStrel
Performs erosion of the image given as argument, and stores the result in the same image.- Parameters:
image
- the input image to erode
-
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.- Returns:
- the mask of the structuring element
-
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.- Returns:
- the offset in the mask
-
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.- Returns:
- a set of shifts
-
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.- Returns:
- the size of the structuring element
-
reverse
Returns a linear diagonal line with same size and offset equal to size-offset.- Returns:
- the reversed structuring element
- See Also:
Strel.reverse()
-