Package qupath.lib.analysis
Class DelaunayTools.Subdivision
java.lang.Object
qupath.lib.analysis.DelaunayTools.Subdivision
- Enclosing class:
DelaunayTools
Helper class for extracting information from a Delaunay triangulation computed from PathObjects.
-
Method Summary
Modifier and TypeMethodDescriptionGet a list of neighbors for all objects.getClusters
(BiPredicate<PathObject, PathObject> predicate) Get clusters of connected objects, where connections are made between neighboring objects that meet the specified predicate.getFilteredNeighbors
(BiPredicate<PathObject, PathObject> predicate) Get a list of neighbors for all objects, filtering out objects that do not meet specified criteria.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.Get theImagePlane
for this subdivision.getNearestNeighbor
(PathObject pathObject) Get the nearest neighbor for the specified object.getNearestNeighbor
(PathObject pathObject, BiPredicate<PathObject, PathObject> predicate) Get the nearest neighbor for the specified object, filtered by a predicate.getNeighbors
(PathObject pathObject) Get all neighbors for a specified object.Get all the objects associated with this subdivision.Get a map of Voronoi faces as JTSGeometry
objects.getVoronoiROIs
(Geometry clip) Get a map of Voronoi faces, convered toROI
objects.
-
Method Details
-
getImagePlane
Get theImagePlane
for this subdivision. Because the subdivision is 2D, all object ROIs are expected to belong to the same plane.- Returns:
-
getVoronoiFaces
Get a map of Voronoi faces as JTSGeometry
objects.- Returns:
- See Also:
-
getVoronoiROIs
Get a map of Voronoi faces, convered toROI
objects.- Parameters:
clip
- optional region used to clip the total extent of the ROIs- Returns:
- See Also:
-
getPathObjects
Get all the objects associated with this subdivision.- Returns:
-
getNearestNeighbor
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 requestedpredicate
- 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 requestedpredicate
- predicate that determines if two objects may be considered neighbors- Returns:
- list of neighbors
-
getNeighbors
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
Get a list of neighbors for all objects.- Returns:
- map in which keys correspond to objects and values represent all corresponding neighbors
-
getClusters
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
-