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 andStringvalues.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.doublegetNumericValue(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.booleanisNumericMeasurement(String name) Query whether a named measurement returns a numeric value only.booleanisStringMeasurement(String name) Query whether a named measurement returns aStringvalue only.voidsetImageData(ImageData<?> imageData, Collection<? extends PathObject> pathObjects) Set theImageDataand a collection of objects to measure.static voidsetPixelLayer(ImageData<BufferedImage> imageData, ImageServer<BufferedImage> layerServer) Set anImageServeras a property in theImageData.voidsetPredicate(Predicate<? super PathObject> predicate) Set a predicate used to filter the rows of the table.voidUpdate 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, waitMethods 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 theImageDataand 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 anImageServeras a property in theImageData. This is intended for use as a temporary (non-persistent) property, used byObservableMeasurementTableDatato 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 aStringvalue 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:PathTableDataGet the names of all numeric measurements.- Specified by:
getMeasurementNamesin interfacePathTableData<PathObject>- Returns:
- See Also:
-
getDoubleValues
Description copied from interface:PathTableDataGet all double values for all items.- Specified by:
getDoubleValuesin interfacePathTableData<PathObject>- Parameters:
column-- Returns:
-
getNumericValue
Description copied from interface:PathTableDataGet the numeric value from an item for the specific measurement.- Specified by:
getNumericValuein interfacePathTableData<PathObject>- Parameters:
pathObject-column-- Returns:
-
getItems
Description copied from interface:PathTableDataGet internal list of the items used to provide measurements.- Specified by:
getItemsin 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:PathTableDataReturn an ordered list of all names, including both numeric measurements andStringvalues.- Specified by:
getAllNamesin interfacePathTableData<PathObject>- Returns:
- See Also:
-
getStringValue
Description copied from interface:PathTableDataGet a string representation of the value.For this method, numbers should be formatted according to the
Locale.- Specified by:
getStringValuein 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:PathTableDataGet a string value, converting to a fixed number of decimal places if the column is numeric.- Specified by:
getStringValuein interfacePathTableData<PathObject>- Parameters:
pathObject-column-decimalPlaces-- Returns:
-
getMetadataNames
Get the names of all columns corresponding to metadata (String) values.- Returns:
-
getBackingList()