Package qupath.opencv.ml.pixel
Class PixelClassificationMeasurementManager
java.lang.Object
qupath.opencv.ml.pixel.PixelClassificationMeasurementManager
Helper class to compute area-based measurements for regions of interest based on pixel classification.
- 
Constructor SummaryConstructorsConstructorDescriptionPixelClassificationMeasurementManager(ImageServer<BufferedImage> classifierServer) Constructor.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanaddMeasurements(Collection<? extends PathObject> objectsToMeasure, String measurementID) Add measurements to specified objectsprotected intMake a semi-educated guess as to an appropriate number of threads to use.getCachedMeasurementValue(PathObject pathObject, String name) Get the value of a single measurement for a specified PathObject if all tiles are cached, otherwise return null.getCachedMeasurementValue(ROI roi, String name) Get the value of a single measurement for a specified ROI if all tiles are cached, otherwise return null.Get the names of all measurements that may be returned.getMeasurementValue(PathObject pathObject, String name) Get the value of a single measurement for a specified PathObject, computing it if it is unavailable.getMeasurementValue(PathObject pathObject, String name, boolean cachedOnly) Deprecated.getMeasurementValue(ROI roi, String name) Get the value of a single measurement for a specified ROI, computing it if it is unavailable.getMeasurementValue(ROI roi, String name, boolean cachedOnly) Deprecated.protected intstatic doubleGet a suitable threshold assuming a raster contains probability values.
- 
Constructor Details- 
PixelClassificationMeasurementManagerConstructor.- Parameters:
- classifierServer- the server for which measurements will be made.
 
 
- 
- 
Method Details- 
getMeasurementValue@Deprecated public Number getMeasurementValue(PathObject pathObject, String name, boolean cachedOnly) Deprecated.Get the measurement value for this object.- Parameters:
- pathObject- the PathObject to measure
- name- the measurement name
- cachedOnly- if true, return null if the measurement cannot be determined from cached tiles
- Returns:
 
- 
getCachedMeasurementValueGet the value of a single measurement for a specified PathObject if all tiles are cached, otherwise return null.- Parameters:
- pathObject-
- name-
- Returns:
- See Also:
 
- 
getMeasurementValueGet the value of a single measurement for a specified PathObject, computing it if it is unavailable.- Parameters:
- pathObject-
- name-
- Returns:
- See Also:
 
- 
getMeasurementValueDeprecated.Get the measurement value for this ROI.- Parameters:
- roi- the ROI to measure
- name- the measurement name
- cachedOnly- if true, return null if the measurement cannot be determined from cached tiles
- Returns:
 
- 
getCachedMeasurementValueGet the value of a single measurement for a specified ROI if all tiles are cached, otherwise return null.- Parameters:
- roi-
- name-
- Returns:
- See Also:
 
- 
getMeasurementValueGet the value of a single measurement for a specified ROI, computing it if it is unavailable.- Parameters:
- roi-
- name-
- Returns:
- See Also:
 
- 
addMeasurementspublic boolean addMeasurements(Collection<? extends PathObject> objectsToMeasure, String measurementID) Add measurements to specified objects- Parameters:
- objectsToMeasure- the objects to measure.
- measurementID- identifier that is prepended to measurement names, to make these identifiable later (optional; may be null)
- Returns:
- true if measurements were added, false otherwise
- Since:
- v0.5.0
 
- 
getMeasurementNamesGet the names of all measurements that may be returned.- Returns:
 
- 
calculatePreferredParallelismprotected int calculatePreferredParallelism()Make a semi-educated guess as to an appropriate number of threads to use. We lack much information about the image and pixel classifier, so this should be a fairly pessimistic guess.- Returns:
 
- 
getPoolSizePropprotected int getPoolSizeProp()
- 
getProbabilityThresholdGet a suitable threshold assuming a raster contains probability values. This is determined from the TransferType. For integer types this is 127.5, otherwise it is 0.5.- Parameters:
- raster-
- Returns:
 
 
- 
getMeasurementValue(PathObject, String)orgetCachedMeasurementValue(PathObject, String)instead