Class DefaultROIComparator

java.lang.Object
qupath.lib.roi.DefaultROIComparator
All Implemented Interfaces:
Comparator<ROI>

public class DefaultROIComparator extends Object implements Comparator<ROI>
Default comparator to enable ROIs to be sorted in a more predictable manner.

The aim is to help sorted lists to sort first on ROI location (time, z, channel, y coordinate, then x) and afterwards on ROI type.

Author:
Pete Bankhead
  • Constructor Details

    • DefaultROIComparator

      public DefaultROIComparator()
  • Method Details

    • compare

      public int compare(ROI o1, ROI o2)
      Specified by:
      compare in interface Comparator<ROI>
    • getInstance

      public static Comparator<ROI> getInstance()
      Get a static instance of this comparator, to avoid needing to construct it.
      Returns: