Package inra.ijpb.morphology.strel
Class CubeStrel
java.lang.Object
inra.ijpb.algo.AlgoStub
inra.ijpb.morphology.strel.AbstractStrel3D
inra.ijpb.morphology.strel.AbstractSeparableStrel3D
inra.ijpb.morphology.strel.CubeStrel
- All Implemented Interfaces:
Algo
,AlgoListener
,SeparableStrel3D
,Strel3D
public class CubeStrel extends AbstractSeparableStrel3D
A cubic structuring element, obtained by decomposition into linear
structuring elements with the same size along each dimension.
- Author:
- David Legland
- See Also:
BallStrel
,LinearHorizontalStrel
,LinearVerticalStrel
,LinearDepthStrel3D
-
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
-
Method Summary
Modifier and Type Method Description java.util.Collection<InPlaceStrel3D>
decompose()
Returns a collection of three linear-shape structuring element, along each principal direction.static CubeStrel
fromDiameter(int diam)
Creates a new cube-shape structuring element with the specified diameter (equal to cube side length).static CubeStrel
fromRadius(int radius)
Creates a new cube-shape structuring element with the specified radius (such that cube side length equals 2 * radius + 1).int[][][]
getMask3D()
Returns the structuring element as a mask.int[]
getOffset()
Returns the offset in the mask for each direction.int[][]
getShifts3D()
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.CubeStrel
reverse()
The reversed structuring element of a separable strel is also separable.Methods inherited from class inra.ijpb.morphology.strel.AbstractSeparableStrel3D
algoProgressChanged, algoStatusChanged, closing, dilation, erosion, opening
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.Strel3D
showProgress, showProgress
-
Constructor Details
-
CubeStrel
public CubeStrel(int size)Creates a new cubic structuring element of a given size.- Parameters:
size
- the length of each side of the cube
-
CubeStrel
public CubeStrel(int size, int offset)Creates a new cubic structuring element of a given size and with a given offset.- Parameters:
size
- the length of each side of the cubeoffset
- the position of the reference pixel in each direction
-
-
Method Details
-
fromDiameter
Creates a new cube-shape structuring element with the specified diameter (equal to cube side length).- Parameters:
diam
- the side length of the cube- Returns:
- a new CubeStrel instance
-
fromRadius
Creates a new cube-shape structuring element with the specified radius (such that cube side length equals 2 * radius + 1).- Parameters:
radius
- the "radius" of the cube- Returns:
- a new CubeStrel instance
-
decompose
Returns a collection of three linear-shape structuring element, along each principal direction.- Returns:
- a collection of three in place structuring elements
- See Also:
SeparableStrel.decompose()
-
getMask3D
public int[][][] getMask3D()Description copied from interface:Strel3D
Returns the structuring element as a mask. Each value is either 0 or 255. The first index corresponds to the z position, the second index to the y direction, and the third one to the x position.- Returns:
- the mask of the structuring element
-
getOffset
public int[] getOffset()Description copied from interface:Strel3D
Returns the offset in the mask for each direction. The first value corresponds to the shift in the x direction.- Returns:
- the offset in the mask
-
getShifts3D
public int[][] getShifts3D()Description copied from interface:Strel3D
Returns the structuring element as a set of shifts. The size of the result is N-by-3, 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:Strel3D
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
Description copied from interface:SeparableStrel3D
The reversed structuring element of a separable strel is also separable.- Returns:
- the reversed structuring element
-