Class DelaunayTools.Subdivision

java.lang.Object
qupath.lib.analysis.DelaunayTools.Subdivision
Enclosing class:
DelaunayTools

public static class DelaunayTools.Subdivision extends Object
Helper class for extracting information from a Delaunay triangulation computed from PathObjects.
  • Method Details

    • getImagePlane

      public ImagePlane getImagePlane()
      Get the ImagePlane for this subdivision. Because the subdivision is 2D, all object ROIs are expected to belong to the same plane.
      Returns:
    • getVoronoiFaces

      public Map<PathObject,Geometry> getVoronoiFaces()
      Get a map of Voronoi faces as JTS Geometry objects.
      Returns:
      See Also:
    • getVoronoiROIs

      public Map<PathObject,ROI> getVoronoiROIs(Geometry clip)
      Get a map of Voronoi faces, convered to ROI objects.
      Parameters:
      clip - optional region used to clip the total extent of the ROIs
      Returns:
      See Also:
    • getPathObjects

      public Collection<PathObject> getPathObjects()
      Get all the objects associated with this subdivision.
      Returns:
    • getNearestNeighbor

      public PathObject getNearestNeighbor(PathObject pathObject)
      Get the nearest neighbor for the specified object.
      Parameters:
      pathObject - the object whose neighbor is requested
      Returns:
      the nearest neighbor, or null if no neighbor can be found
    • getNearestNeighbor

      public PathObject getNearestNeighbor(PathObject pathObject, BiPredicate<PathObject,PathObject> predicate)
      Get the nearest neighbor for the specified object, filtered by a predicate.
      Parameters:
      pathObject - the object whose neighbor is requested
      predicate - predicate used to establish weather two objects may be considered neighbors
      Returns:
      the nearest neighbor, or null if no neighbor can be found
    • getFilteredNeighbors

      public List<PathObject> getFilteredNeighbors(PathObject pathObject, BiPredicate<PathObject,PathObject> predicate)
      Get a list of neighbors for a specified object, filtering out objects that do not meet specified criteria.
      Parameters:
      pathObject - object for which the neighbors are requested
      predicate - predicate that determines if two objects may be considered neighbors
      Returns:
      list of neighbors
    • getNeighbors

      public List<PathObject> getNeighbors(PathObject pathObject)
      Get all neighbors for a specified object.
      Parameters:
      pathObject - object for which neighbors are requested
      Returns:
      list of neighbors
    • getFilteredNeighbors

      public Map<PathObject,List<PathObject>> getFilteredNeighbors(BiPredicate<PathObject,PathObject> predicate)
      Get a list of neighbors for all objects, filtering out objects that do not meet specified criteria. The filter may be used, for example, to impose a distance or classification threshold.
      Parameters:
      predicate - predicate that determines if two objects may be considered neighbors
      Returns:
      map in which keys correspond to objects and values represent all corresponding (filtered) neighbors
    • getAllNeighbors

      public Map<PathObject,List<PathObject>> getAllNeighbors()
      Get a list of neighbors for all objects.
      Returns:
      map in which keys correspond to objects and values represent all corresponding neighbors
    • getClusters

      public List<Collection<PathObject>> getClusters(BiPredicate<PathObject,PathObject> predicate)
      Get clusters of connected objects, where connections are made between neighboring objects that meet the specified predicate.
      Parameters:
      predicate - predicate used to determine if two otherwise neighboring objects are considered connected
      Returns:
      a list of clusters, where each cluster is a collection of connected objects