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 WatershedEncodingThe encoding used for the direction-vectors. -
Constructor Summary
ConstructorsConstructorDescriptionEncodedVoxels(Voxels<UnsignedIntBuffer> voxels) Creates a newEncodedVoxelsinstance. -
Method Summary
Modifier and TypeMethodDescriptionintcalculateConnectedComponentID(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.booleanChecks if there are any temporary encoded values in the voxels.booleanisConnectedComponentIDCode(int code) Checks if the given code represents a connected component ID.booleanisDirectionChainCode(int code) Checks if the given code represents a direction chain code.booleanisMinima(int code) Checks if the given code represents a minima.booleanisPlateau(int code) Checks if the given code represents a plateau.booleanisTemporary(int code) Checks if the given code represents a temporary value.booleanisUnvisited(int code) Checks if the given code represents an unvisited value.voidpointListAtFirstPoint(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.voidSets the encoded value for a specific point.voidsetPointConnectedComponentID(Point3i point, int connectedComponentID) Sets the connected component ID for a specific point.voidsetPointDirection(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 newEncodedVoxelsinstance.- 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
EncodedIntBufferfor 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
Point3iwith 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
Extentof the voxels
-
voxels
The voxels containing encoded information.
-