Class DelaunayTriangulation

java.lang.Object
qupath.opencv.features.DelaunayTriangulation
All Implemented Interfaces:
PathObjectConnectionGroup

public class DelaunayTriangulation extends Object implements PathObjectConnectionGroup
Compute Delaunay triangulation using OpenCV.
Author:
Pete Bankhead
  • Constructor Details

    • DelaunayTriangulation

      public DelaunayTriangulation(List<PathObject> pathObjects, double pixelWidth, double pixelHeight, double distanceThresholdPixels, boolean limitByClass)
      Compute Delaunay triangulation - optionally omitting links above a fixed distance.
      Parameters:
      pathObjects -
      pixelWidth -
      pixelHeight -
      distanceThresholdPixels - - Note, this is in *pixels* (and not scaled according to pixelWidth & pixelHeight)
      limitByClass -
  • Method Details

    • getConnectedObjects

      public List<PathObject> getConnectedObjects(PathObject pathObject)
      Description copied from interface: PathObjectConnectionGroup
      Get all the connections to a specified PathObject stored in this group.

      If containsObject(pathObject) returns null, this will return an empty list (and not null).

      Specified by:
      getConnectedObjects in interface PathObjectConnectionGroup
      Parameters:
      pathObject -
      Returns:
    • getPathObjects

      public Collection<PathObject> getPathObjects()
      Description copied from interface: PathObjectConnectionGroup
      Get an unmodifiable collection containing all the PathObjects contained within this group.
      Specified by:
      getPathObjects in interface PathObjectConnectionGroup
      Returns:
    • getConnectedNodes

      @Deprecated public Collection<double[]> getConnectedNodes(Collection<PathObject> pathObjects, Collection<double[]> connections)
      Deprecated.
      Get connected nodes. Returned as a list where pairs are consecutive, i.e. get(i) links to get(i+1) (although get(i+1) doesn't necessarily link to get(i+2)...)
      Parameters:
      pathObjects -
      connections -
      Returns:
    • getConnectedNodes

      public Collection<PathObject> getConnectedNodes(PathObject pathObject, Collection<PathObject> list)
      Get all the PathObjects immediately connected to the specified object, adding the points into a collection (or creating a new one).
      Parameters:
      pathObject -
      list -
      Returns:
    • getConnectedClusters

      public List<Set<PathObject>> getConnectedClusters()
      Get a list of PathObjects that are connected to each other in this triangulation. Warning: This list is recomputed on every call, therefore references should be cached by the caller if necessary to avoid too much recomputation.
      Returns:
    • addClusterMeasurements

      public void addClusterMeasurements()
      Compute mean measurements from clustering all connected objects.
    • addNodeMeasurements

      public void addNodeMeasurements()
      Add Delaunay measurements to each pathObject.
    • containsObject

      public boolean containsObject(PathObject pathObject)
      Description copied from interface: PathObjectConnectionGroup
      Returns true if the specified PathObject is contained within this group.
      Specified by:
      containsObject in interface PathObjectConnectionGroup
      Parameters:
      pathObject -
      Returns: