Class EncodedVoxels
Object
EncodedVoxels
Represents voxels encoded with watershed-related information.
See ENCODING
for the type of information stored in each voxel.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final WatershedEncoding
The encoding used for the direction-vectors. -
Constructor Summary
ConstructorsConstructorDescriptionEncodedVoxels
(Voxels<UnsignedIntBuffer> voxels) Creates a newEncodedVoxels
instance. -
Method Summary
Modifier and TypeMethodDescriptionint
calculateConnectedComponentID
(Point3i point, int firstChainCode) Calculates the connected component ID for a given point and initial chain code.extent()
Gets the extent of the voxels.getPixelsForPlane
(int z) Gets the encoded int buffer for a specific plane.Gets a list of points with temporary encoded values.boolean
Checks if there are any temporary encoded values in the voxels.boolean
isConnectedComponentIDCode
(int code) Checks if the given code represents a connected component ID.boolean
isDirectionChainCode
(int code) Checks if the given code represents a direction chain code.boolean
isMinima
(int code) Checks if the given code represents a minima.boolean
isPlateau
(int code) Checks if the given code represents a plateau.boolean
isTemporary
(int code) Checks if the given code represents a temporary value.boolean
isUnvisited
(int code) Checks if the given code represents an unvisited value.void
pointListAtFirstPoint
(List<Point3i> points) Sets all points in a list to point at the first point (the root point) in the list.Gets a set of all connected component IDs in the voxels.void
Sets the encoded value for a specific point.void
setPointConnectedComponentID
(Point3i point, int connectedComponentID) Sets the connected component ID for a specific point.void
setPointDirection
(Point3i point, int xChange, int yChange, int zChange) Sets the direction for a specific point.voxels()
The voxels containing encoded information.
-
Field Details
-
ENCODING
The encoding used for the direction-vectors.
-
-
Constructor Details
-
EncodedVoxels
Creates a newEncodedVoxels
instance.- Parameters:
voxels
- The voxels containing encoded information.
-
-
Method Details
-
setPoint
Sets the encoded value for a specific point.- Parameters:
point
- the 3D point to setcode
- the encoded value to set
-
setPointConnectedComponentID
Sets the connected component ID for a specific point.- Parameters:
point
- the 3D point to setconnectedComponentID
- the ID of the connected component
-
setPointDirection
Sets the direction for a specific point.- Parameters:
point
- the 3D point to setxChange
- change in x directionyChange
- change in y directionzChange
- change in z direction
-
pointListAtFirstPoint
Sets all points in a list to point at the first point (the root point) in the list.- Parameters:
points
- the list of points to set
-
getPixelsForPlane
Gets the encoded int buffer for a specific plane.- Parameters:
z
- the z-coordinate of the plane- Returns:
- the
EncodedIntBuffer
for the specified plane
-
hasTemporary
public boolean hasTemporary()Checks if there are any temporary encoded values in the voxels.- Returns:
- true if temporary values exist, false otherwise
-
getTemporary
Gets a list of points with temporary encoded values.- Returns:
- a list of
Point3i
with temporary values
-
setOfConnectedComponentIDs
Gets a set of all connected component IDs in the voxels.- Returns:
- a set of integer IDs representing connected components
-
calculateConnectedComponentID
Calculates the connected component ID for a given point and initial chain code.- Parameters:
point
- the starting pointfirstChainCode
- the initial chain code- Returns:
- the encoded connected component ID
-
isPlateau
public boolean isPlateau(int code) Checks if the given code represents a plateau.- Parameters:
code
- the encoded value to check- Returns:
- true if the code represents a plateau, false otherwise
-
isMinima
public boolean isMinima(int code) Checks if the given code represents a minima.- Parameters:
code
- the encoded value to check- Returns:
- true if the code represents a minima, false otherwise
-
isTemporary
public boolean isTemporary(int code) Checks if the given code represents a temporary value.- Parameters:
code
- the encoded value to check- Returns:
- true if the code represents a temporary value, false otherwise
-
isUnvisited
public boolean isUnvisited(int code) Checks if the given code represents an unvisited value.- Parameters:
code
- the encoded value to check- Returns:
- true if the code represents an unvisited value, false otherwise
-
isDirectionChainCode
public boolean isDirectionChainCode(int code) Checks if the given code represents a direction chain code.- Parameters:
code
- the encoded value to check- Returns:
- true if the code represents a direction chain code, false otherwise
-
isConnectedComponentIDCode
public boolean isConnectedComponentIDCode(int code) Checks if the given code represents a connected component ID.- Parameters:
code
- the encoded value to check- Returns:
- true if the code represents a connected component ID, false otherwise
-
extent
Gets the extent of the voxels.- Returns:
- the
Extent
of the voxels
-
voxels
The voxels containing encoded information.
-