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.
-
Field Summary
FieldsFields inherited from interface qupath.lib.gui.measure.PathTableData
DEFAULT_DECIMAL_PLACES, DEFAULT_DELIMITER
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn an ordered list of all names, including both numeric measurements andString
values.Access all the objects used to generate the table.Deprecated.double[]
getDoubleValues
(String column) Get all double values for all items.getHelpText
(String column) Get help text for a measurement if available, or null if no help text is found.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 item 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
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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface qupath.lib.gui.measure.PathTableData
getRowStrings, getRowStrings, getRowStrings
-
Field Details
-
NAME_OBJECT_ID
The name used for the Object ID column
-
-
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. This effectively filters the contents ofgetBackingList()
when returninggetItems()
.- Parameters:
predicate
- the filter to apply
-
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:
- See Also:
-
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 item 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
Deprecated.v0.6.0 use insteadgetBackingList()
Access the underlying entries, for which getEntries provides a filtered view.- Returns:
- a list of all objects used to create the table
-
getBackingList
Access all the objects used to generate the table. This contains all the objects passed tosetImageData(ImageData, Collection)
and may be longer than the list returned bygetItems()
if a predicate has been applied.- Returns:
- the list of objects
- Since:
- v0.6.0
-
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:
- See Also:
-
getStringValue
Description copied from interface:PathTableData
Get a string representation of the value.For this method, numbers should be formatted according to the
Locale
.- Specified by:
getStringValue
in interfacePathTableData<PathObject>
- Parameters:
pathObject
-column
-- Returns:
-
getHelpText
Get help text for a measurement if available, or null if no help text is found.- Parameters:
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:
-
getBackingList()