Package inra.ijpb.morphology.directional
Class OrientedLineStrel
java.lang.Object
inra.ijpb.algo.AlgoStub
inra.ijpb.morphology.strel.AbstractStrel3D
inra.ijpb.morphology.strel.AbstractStrel
inra.ijpb.morphology.directional.OrientedLineStrel
public class OrientedLineStrel extends AbstractStrel implements Strel
A linear structuring element, defined by a length and an orientation.
- 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 -
Constructor Summary
Constructors Constructor Description OrientedLineStrel(double length, double angleInDegrees)Creates an new instance of linear structuring element. -
Method Summary
Modifier and Type Method Description ij.process.ImageProcessorclosing(ij.process.ImageProcessor image)Performs a morphological closing on the input image, by applying first a dilation, then an erosion with the reversed structuring element.ij.process.ImageProcessordilation(ij.process.ImageProcessor image)Implements a default algorithm for dilation, that consists in iterating over the neighbors of each pixel to compute the maximum value.ij.process.ImageProcessorerosion(ij.process.ImageProcessor image)Implements a default algorithm for erosion, that consists in iterating over the neighbors of each pixel to compute the minimum value.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.ij.process.ImageProcessoropening(ij.process.ImageProcessor image)Performs a morphological opening on the input image, by applying first an erosion, then a dilation with the reversed structuring element.Strelreverse()Returns this structuring element, as oriented line structuring elements are symmetric by definition.Methods inherited from class inra.ijpb.morphology.strel.AbstractStrel
addBorder, closing, cropBorder, dilation, erosion, getChannelName, getMask3D, getShifts3D, opening, 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
getChannelName, setChannelNameMethods inherited from interface inra.ijpb.morphology.Strel3D
closing, dilation, erosion, getMask3D, getShifts3D, opening, showProgress, showProgress
-
Constructor Details
-
OrientedLineStrel
public OrientedLineStrel(double length, double angleInDegrees)Creates an new instance of linear structuring element. The number of pixels composing the line may differ from the specified length due to rounding effects.- Parameters:
length- the (approximate) length of the structuring element.angleInDegrees- the angle with the horizontal of the structuring element
-
-
Method Details
-
getSize
public int[] getSize()Returns the size of the structuring element, as an array of size in each direction. -
getMask
public int[][] getMask()Returns the structuring element as a mask. Each value is either 0 or 255. -
getOffset
public int[] getOffset()Returns the offset in the mask. -
getShifts
public int[][] getShifts()Returns the structuring element as a set of shifts. -
dilation
public ij.process.ImageProcessor dilation(ij.process.ImageProcessor image)Description copied from class:AbstractStrelImplements 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 interfaceStrel- Overrides:
dilationin classAbstractStrel- Parameters:
image- the input image- Returns:
- the result of dilation with this structuring element
- See Also:
Strel.getShifts(),AbstractStrel.erosion(ImageProcessor)
-
erosion
public ij.process.ImageProcessor erosion(ij.process.ImageProcessor image)Description copied from class:AbstractStrelImplements 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 interfaceStrel- Overrides:
erosionin classAbstractStrel- Parameters:
image- the input image- Returns:
- the result of erosion with this structuring element
- See Also:
Strel.getShifts(),AbstractStrel.dilation(ImageProcessor)
-
closing
public ij.process.ImageProcessor closing(ij.process.ImageProcessor image)Description copied from class:AbstractStrelPerforms a morphological closing on the input image, by applying first a dilation, then an erosion with the reversed structuring element.- Specified by:
closingin interfaceStrel- Overrides:
closingin classAbstractStrel- Parameters:
image- the input image- Returns:
- the result of closing with this structuring element
- See Also:
AbstractStrel.dilation(ij.process.ImageProcessor),AbstractStrel.erosion(ij.process.ImageProcessor),AbstractStrel.opening(ij.process.ImageProcessor),Strel3D.reverse()
-
opening
public ij.process.ImageProcessor opening(ij.process.ImageProcessor image)Description copied from class:AbstractStrelPerforms a morphological opening on the input image, by applying first an erosion, then a dilation with the reversed structuring element.- Specified by:
openingin interfaceStrel- Overrides:
openingin classAbstractStrel- Parameters:
image- the input image- Returns:
- the result of opening with this structuring element
- See Also:
AbstractStrel.dilation(ij.process.ImageProcessor),AbstractStrel.erosion(ij.process.ImageProcessor),AbstractStrel.closing(ij.process.ImageProcessor),Strel3D.reverse()
-
reverse
Returns this structuring element, as oriented line structuring elements are symmetric by definition.
-