Interface MeasurementStrategy

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface MeasurementStrategy
A strategy for handling measurements between objects being merged. Usually, it is safe to ignore, but if a pipeline creates objects and adds measurements before handling merges between tiles, then it is useful to consider how the measurements of each object will be passed to the output object. The default implementations assume that the measurement names are identical across all objects; to this end only the names of the measurements of the first object are queried.
  • Field Details

    • IGNORE

      static final MeasurementStrategy IGNORE
      The default and previous strategy: ignore and discard.
    • USE_FIRST

      static final MeasurementStrategy USE_FIRST
      Assign the measurements of the first object to the output object.
    • MEAN

      static final MeasurementStrategy MEAN
      Calculate the mean of each measurement and pass these to the output object.
    • WEIGHTED_MEAN

      static final MeasurementStrategy WEIGHTED_MEAN
      Calculate a mean weighted by object area and pass this to the output object.
    • MEDIAN

      static final MeasurementStrategy MEDIAN
      Calculate the median of each measurement and pass these to the output object.
    • RANDOM

      static final MeasurementStrategy RANDOM
      Choose an object at random and use the measurements from this object.
    • USE_BIGGEST

      static final MeasurementStrategy USE_BIGGEST
      Use the measurements of the largest object by area, length or number of points.
    • MAX

      static final MeasurementStrategy MAX
      Calculate the maximum of each measurement and pass these to the output object.
    • MIN

      static final MeasurementStrategy MIN
      Calculate the minimum of each measurement and pass these to the output object.
  • Method Details

    • mergeMeasurements

      void mergeMeasurements(List<? extends PathObject> pathObjects, MeasurementList outputList)
      Merge the measurements for a set of input objects to a single measurement list. This should operate by adding the calculated measurements to the measurement list passed in as second argument.
      Parameters:
      pathObjects - the input objects
      outputList - the container that output measurements should be stored in