Package inra.ijpb.morphology.strel
Class CuboidStrel
java.lang.Object
inra.ijpb.algo.AlgoStub
inra.ijpb.morphology.strel.AbstractStrel3D
inra.ijpb.morphology.strel.AbstractSeparableStrel3D
inra.ijpb.morphology.strel.CuboidStrel
- All Implemented Interfaces:
Algo,AlgoListener,SeparableStrel3D,Strel3D
public class CuboidStrel extends AbstractSeparableStrel3D
A cuboid structuring element, obtained by decomposition into linear
structuring elements (that can have different sizes) along each dimension.
- Author:
- David Legland
- See Also:
CubeStrel,EllipsoidStrel,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 -
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 CuboidStrelfromDiameter(int diam)Creates a new cube-shape structuring element with the specified diameter (equal to cube side length).static CuboidStrelfromDiameterList(int diamX, int diamY, int diamZ)Creates a 3D structuring element with a cuboid shape and different sizes depending on direction.static CuboidStrelfromRadius(int radius)Creates a new cube-shape structuring element with the specified radius (such that cube side length equals 2 * radius + 1).static CuboidStrelfromRadiusList(int radiusX, int radiusY, int radiusZ)Creates a 3D structuring element with a cuboid shape and different sizes depending on direction.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.CuboidStrelreverse()Returns a cuboidal structuring element with same size, but offset located symmetrically with respect to structuring element center.Methods inherited from class inra.ijpb.morphology.strel.AbstractSeparableStrel3D
algoProgressChanged, algoStatusChanged, closing, dilation, erosion, openingMethods 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.Strel3D
showProgress, showProgress
-
Method Details
-
fromDiameter
Creates a new cube-shape structuring element with the specified diameter (equal to cube side length). All the dimensions of the resulting Cuboid are equal.- Parameters:
diam- the side length of the cube- Returns:
- a new 3D cuboid structuring element
-
fromRadius
Creates a new cube-shape structuring element with the specified radius (such that cube side length equals 2 * radius + 1). All the dimensions of the resulting Cuboid are equal.- Parameters:
radius- the "radius" of the cube- Returns:
- a new 3D cuboid structuring element
-
fromRadiusList
Creates a 3D structuring element with a cuboid shape and different sizes depending on direction.- Parameters:
radiusX- radius in x directionradiusY- radius in y directionradiusZ- radius in z direction- Returns:
- a new 3D cuboidal structuring element
-
fromDiameterList
Creates a 3D structuring element with a cuboid shape and different sizes depending on direction.- Parameters:
diamX- diameter in x directiondiamY- diameter in y directiondiamZ- diameter in z direction- Returns:
- a new 3D cuboidal structuring element
-
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:Strel3DReturns 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:Strel3DReturns 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:Strel3DReturns 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:Strel3DReturns 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 cuboidal structuring element with same size, but offset located symmetrically with respect to structuring element center.- Returns:
- the reversed version of this strel
-