Package qupath.lib.objects.utils
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.
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final MeasurementStrategy
The default and previous strategy: ignore and discard.static final MeasurementStrategy
Calculate the maximum of each measurement and pass these to the output object.static final MeasurementStrategy
Calculate the mean of each measurement and pass these to the output object.static final MeasurementStrategy
Calculate the median of each measurement and pass these to the output object.static final MeasurementStrategy
Calculate the minimum of each measurement and pass these to the output object.static final MeasurementStrategy
Choose an object at random and use the measurements from this object.static final MeasurementStrategy
Use the measurements of the largest object by area, length or number of points.static final MeasurementStrategy
Assign the measurements of the first object to the output object.static final MeasurementStrategy
Calculate a mean weighted by object area and pass this to the output object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
mergeMeasurements
(List<? extends PathObject> pathObjects, MeasurementList outputList) Merge the measurements for a set of input objects to a single measurement list.
-
Field Details
-
IGNORE
The default and previous strategy: ignore and discard. -
USE_FIRST
Assign the measurements of the first object to the output object. -
MEAN
Calculate the mean of each measurement and pass these to the output object. -
WEIGHTED_MEAN
Calculate a mean weighted by object area and pass this to the output object. -
MEDIAN
Calculate the median of each measurement and pass these to the output object. -
RANDOM
Choose an object at random and use the measurements from this object. -
USE_BIGGEST
Use the measurements of the largest object by area, length or number of points. -
MAX
Calculate the maximum of each measurement and pass these to the output object. -
MIN
Calculate the minimum of each measurement and pass these to the output object.
-
-
Method Details
-
mergeMeasurements
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 objectsoutputList
- the container that output measurements should be stored in
-