Object
EncodedVoxels

public final class EncodedVoxels extends Object
Represents voxels encoded with watershed-related information.

See ENCODING for the type of information stored in each voxel.

  • Field Details

    • ENCODING

      public static final WatershedEncoding ENCODING
      The encoding used for the direction-vectors.
  • Constructor Details

    • EncodedVoxels

      public EncodedVoxels(Voxels<UnsignedIntBuffer> voxels)
      Creates a new EncodedVoxels instance.
      Parameters:
      voxels - The voxels containing encoded information.
  • Method Details

    • setPoint

      public void setPoint(Point3i point, int code)
      Sets the encoded value for a specific point.
      Parameters:
      point - the 3D point to set
      code - the encoded value to set
    • setPointConnectedComponentID

      public void setPointConnectedComponentID(Point3i point, int connectedComponentID)
      Sets the connected component ID for a specific point.
      Parameters:
      point - the 3D point to set
      connectedComponentID - the ID of the connected component
    • setPointDirection

      public void setPointDirection(Point3i point, int xChange, int yChange, int zChange)
      Sets the direction for a specific point.
      Parameters:
      point - the 3D point to set
      xChange - change in x direction
      yChange - change in y direction
      zChange - change in z direction
    • pointListAtFirstPoint

      public void pointListAtFirstPoint(List<Point3i> points)
      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

      public EncodedIntBuffer getPixelsForPlane(int z)
      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

      public List<Point3i> getTemporary()
      Gets a list of points with temporary encoded values.
      Returns:
      a list of Point3i with temporary values
    • setOfConnectedComponentIDs

      public Set<Integer> setOfConnectedComponentIDs()
      Gets a set of all connected component IDs in the voxels.
      Returns:
      a set of integer IDs representing connected components
    • calculateConnectedComponentID

      public int calculateConnectedComponentID(Point3i point, int firstChainCode)
      Calculates the connected component ID for a given point and initial chain code.
      Parameters:
      point - the starting point
      firstChainCode - 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

      public Extent extent()
      Gets the extent of the voxels.
      Returns:
      the Extent of the voxels
    • voxels

      public Voxels<UnsignedIntBuffer> voxels()
      The voxels containing encoded information.