Class DelaunayTools.Builder

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

public static class DelaunayTools.Builder extends Object
Builder class to create a DelaunayTools.Subdivision based on Delaunay triangulation.
  • Method Details

    • calibration

      public DelaunayTools.Builder calibration(PixelCalibration cal)
      Specify pixel calibration, which is used to calibrate the x and y coordinates.
      Parameters:
      cal - the calibration to use
      Returns:
      this builder
    • centroids

      public DelaunayTools.Builder centroids()
      Specify that the triangulation should be based on ROI centroids.
      Returns:
      this builder
    • roiBounds

      public DelaunayTools.Builder roiBounds()
      Specify that the triangulation should be based on ROI boundary coordinates with the default densify factor.
      Returns:
      this builder
    • roiBounds

      public DelaunayTools.Builder roiBounds(double densify, double erosion)
      Specify that the triangulation should be based on ROI boundary coordinates with a specified densify factor.
      Parameters:
      densify - how much to 'densify' the coordinates; recommended default value is 4.0 (assuming uncalibrated pixels). Decreasing the value will give a denser (and slower) triangulation; this can achieve more accuracy but also lead to numerical problems. Try adjusting this value only if the default results in errors.
      erosion - amount to erode each Geometry in pixels. If non-zero, this can fix artifacts occurring at shared boundaries.
      Returns:
      this builder
    • preferNucleus

      public DelaunayTools.Builder preferNucleus(boolean prefer)
      Specify that the triangulation should be based on nucleus ROIs where possible (only affects cell objects).
      Parameters:
      prefer - if true, use the nucleus ROI for cell objects where possible
      Returns:
      this builder
    • coordinateExtractor

      public DelaunayTools.Builder coordinateExtractor(Function<PathObject,Collection<Coordinate>> coordinateExtractor)
      Specify a default method of extracting coordinates for triangulation from an object, rather than centroids or the ROI boundary.
      Parameters:
      coordinateExtractor - the custom coordinate extractor
      Returns:
      this builder
    • build

      public DelaunayTools.Subdivision build()
      Build the DelaunayTools.Subdivision with the current parameters.
      Returns: