Package qupath.lib.gui.measure
Class ObservableMeasurementTableData
java.lang.Object
qupath.lib.gui.measure.ObservableMeasurementTableData
- All Implemented Interfaces:
PathTableData<PathObject>
A table data model to supply observable measurements of PathObjects.
This includes dynamically-calculated summaries.
- Author:
- Pete Bankhead
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateNumericMeasurement
(PathObject pathObject, String column) Deprecated.createStringMeasurement
(PathObject pathObject, String column) Deprecated.Return an ordered list of all names, including both numeric measurements andString
values.Access the underlying entries, for which getEntries provides a filtered view.double[]
getDoubleValues
(String column) Get all double values for all items.getItems()
Get internal list of the items used to provide measurements.Get the names of all numeric measurements.Get the names of all columns corresponding to metadata (String) values.double
getNumericValue
(PathObject pathObject, String column) Get the numeric value from an object for the specific measurement.static ImageServer
<BufferedImage> getPixelLayer
(ImageData<?> imageData) Request the pixel layer from anImageData
.getStringValue
(PathObject pathObject, String column) Get a string representation of the value.getStringValue
(PathObject pathObject, String column, int decimalPlaces) Get a string value, converting to a fixed number of decimal places if the column is numeric.boolean
isNumericMeasurement
(String name) Query whether a named measurement returns a numeric value only.boolean
isStringMeasurement
(String name) Query whether a named measurement returns aString
value only.void
Refresh the measurement values.void
setImageData
(ImageData<?> imageData, Collection<? extends PathObject> pathObjects) Set theImageData
and a collection of objects to measure.static void
setPixelLayer
(ImageData<BufferedImage> imageData, ImageServer<BufferedImage> layerServer) Set anImageServer
as a property in theImageData
.void
setPredicate
(Predicate<? super PathObject> predicate) Set a predicate used to filter the rows of the table.void
Update the entire measurement list for the current objects.
-
Field Details
-
NAME_OBJECT_ID
The name used for the Object ID column- See Also:
-
-
Constructor Details
-
ObservableMeasurementTableData
public ObservableMeasurementTableData()
-
-
Method Details
-
setImageData
Set theImageData
and a collection of objects to measure.- Parameters:
imageData
- theImageData
, required to determine many dynamic measurementspathObjects
- the objects to measure ('rows' in the table)
-
setPixelLayer
public static void setPixelLayer(ImageData<BufferedImage> imageData, ImageServer<BufferedImage> layerServer) Set anImageServer
as a property in theImageData
. This is intended for use as a temporary (non-persistent) property, used byObservableMeasurementTableData
to create live measurements.Note that this method is subject to change (in location and behavior).
- Parameters:
imageData
-layerServer
- server to return the pixel layer data; if null, the property will be removed
-
getPixelLayer
Request the pixel layer from anImageData
.Note that this method is subject to change (in location and behavior).
- Parameters:
imageData
-- Returns:
-
updateMeasurementList
public void updateMeasurementList()Update the entire measurement list for the current objects.- See Also:
-
setPredicate
Set a predicate used to filter the rows of the table.- Parameters:
predicate
-
-
refreshEntries
public void refreshEntries()Refresh the measurement values. -
createNumericMeasurement
Deprecated.Create a specific numeric measurement.Warning! This binding is not guaranteed to update its value automatically upon changes to the underlying object or data.
- Parameters:
pathObject
-column
-- Returns:
-
createStringMeasurement
Deprecated.Create a specific String measurement.Warning! This binding is not guaranteed to update its value automatically upon changes to the underlying object or data.
- Parameters:
pathObject
-column
-- Returns:
-
isStringMeasurement
Query whether a named measurement returns aString
value only.- Parameters:
name
- the measurement name- Returns:
- true if the measurement returns a String (only), false otherwise
-
isNumericMeasurement
Query whether a named measurement returns a numeric value only.- Parameters:
name
- the measurement name- Returns:
- true if the measurement returns a number, false otherwise
-
getMeasurementNames
Description copied from interface:PathTableData
Get the names of all numeric measurements.- Specified by:
getMeasurementNames
in interfacePathTableData<PathObject>
- Returns:
-
getDoubleValues
Description copied from interface:PathTableData
Get all double values for all items.- Specified by:
getDoubleValues
in interfacePathTableData<PathObject>
- Parameters:
column
-- Returns:
-
getNumericValue
Description copied from interface:PathTableData
Get the numeric value from an object for the specific measurement.- Specified by:
getNumericValue
in interfacePathTableData<PathObject>
- Parameters:
pathObject
-column
-- Returns:
-
getItems
Description copied from interface:PathTableData
Get internal list of the items used to provide measurements.- Specified by:
getItems
in interfacePathTableData<PathObject>
- Returns:
-
getBackingListEntries
Access the underlying entries, for which getEntries provides a filtered view.- Returns:
-
getAllNames
Description copied from interface:PathTableData
Return an ordered list of all names, including both numeric measurements andString
values.- Specified by:
getAllNames
in interfacePathTableData<PathObject>
- Returns:
-
getStringValue
Description copied from interface:PathTableData
Get a string representation of the value. For this method, numbers should be formatted according to theLocale
.- Specified by:
getStringValue
in interfacePathTableData<PathObject>
- Parameters:
pathObject
-column
-- Returns:
-
getStringValue
Description copied from interface:PathTableData
Get a string value, converting to a fixed number of decimal places if the column is numeric.- Specified by:
getStringValue
in interfacePathTableData<PathObject>
- Parameters:
pathObject
-column
-decimalPlaces
-- Returns:
-
getMetadataNames
Get the names of all columns corresponding to metadata (String) values.- Returns:
-