Class ConvexHullUtilities

Object
org.anchoranalysis.plugin.points.convexhull.ConvexHullUtilities

public class ConvexHullUtilities
extends Object
Utility methods for calculating convex hulls on 2D points.

Strongly influenced by http://rsb.info.nih.gov/ij/macros/ConvexHull.txt

  • Method Summary

    Modifier and Type Method Description
    static List<org.anchoranalysis.spatial.point.Point2i> convexHull2D​(List<org.anchoranalysis.spatial.point.Point2i> points)
    Apply a convex-hull algorithm to filter a set of points using the default minimum number of points.
    static List<org.anchoranalysis.spatial.point.Point2i> convexHull2D​(List<org.anchoranalysis.spatial.point.Point2i> points, int minNumberPoints)
    Apply a convex-hull algorithm to filter a set of points.
    static List<org.anchoranalysis.spatial.point.Point2i> pointsOnAllOutlines​(org.anchoranalysis.image.voxel.object.ObjectCollection objects)
    Get points on all outlines of a collection of objects.
    static List<org.anchoranalysis.spatial.point.Point2i> pointsOnOutline​(org.anchoranalysis.image.voxel.object.ObjectMask object)
    Get points on the outline of a single object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • convexHull2D

      public static List<org.anchoranalysis.spatial.point.Point2i> convexHull2D​(List<org.anchoranalysis.spatial.point.Point2i> points) throws org.anchoranalysis.core.exception.OperationFailedException
      Apply a convex-hull algorithm to filter a set of points using the default minimum number of points.
      Parameters:
      points - points to filter
      Returns:
      the filtered points on convex-hull if the minimum number of points exists, otherwise the input points unchanged
      Throws:
      org.anchoranalysis.core.exception.OperationFailedException - if the count variable becomes too high during calculation
    • convexHull2D

      public static List<org.anchoranalysis.spatial.point.Point2i> convexHull2D​(List<org.anchoranalysis.spatial.point.Point2i> points, int minNumberPoints) throws org.anchoranalysis.core.exception.OperationFailedException
      Apply a convex-hull algorithm to filter a set of points.

      Note the algorithm will return the input-points if there are too few points.

      Parameters:
      points - points to filter
      minNumberPoints - a minimum of number of points (before any convex hull filtering) that must be found
      Returns:
      the filtered points on convex-hull if the minimum number of points exists, otherwise the input points unchanged
      Throws:
      org.anchoranalysis.core.exception.OperationFailedException - if the count variable becomes too high during calculation
    • pointsOnAllOutlines

      public static List<org.anchoranalysis.spatial.point.Point2i> pointsOnAllOutlines​(org.anchoranalysis.image.voxel.object.ObjectCollection objects)
      Get points on all outlines of a collection of objects.
      Parameters:
      objects - the collection of objects
      Returns:
      a list of Point2i representing points on all outlines
    • pointsOnOutline

      public static List<org.anchoranalysis.spatial.point.Point2i> pointsOnOutline​(org.anchoranalysis.image.voxel.object.ObjectMask object) throws org.anchoranalysis.core.exception.CreateException
      Get points on the outline of a single object.
      Parameters:
      object - the object mask
      Returns:
      a list of Point2i representing points on the outline
      Throws:
      org.anchoranalysis.core.exception.CreateException - if there's an error creating the point list