Class ObservableMeasurementTableData

java.lang.Object
qupath.lib.gui.measure.ObservableMeasurementTableData
All Implemented Interfaces:
PathTableData<PathObject>

public class ObservableMeasurementTableData extends Object implements PathTableData<PathObject>
A table data model to supply observable measurements of PathObjects.

This includes dynamically-calculated summaries.

Author:
Pete Bankhead
  • Field Details

  • Constructor Details

    • ObservableMeasurementTableData

      public ObservableMeasurementTableData()
  • Method Details

    • setImageData

      public void setImageData(ImageData<?> imageData, Collection<? extends PathObject> pathObjects)
      Set the ImageData and a collection of objects to measure.
      Parameters:
      imageData - the ImageData, required to determine many dynamic measurements
      pathObjects - the objects to measure ('rows' in the table)
    • setPixelLayer

      public static void setPixelLayer(ImageData<BufferedImage> imageData, ImageServer<BufferedImage> layerServer)
      Set an ImageServer as a property in the ImageData. This is intended for use as a temporary (non-persistent) property, used by ObservableMeasurementTableData 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

      public static ImageServer<BufferedImage> getPixelLayer(ImageData<?> imageData)
      Request the pixel layer from an ImageData.

      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

      public void setPredicate(Predicate<? super PathObject> predicate)
      Set a predicate used to filter the rows of the table.
      Parameters:
      predicate -
    • refreshEntries

      public void refreshEntries()
      Refresh the measurement values.
    • createNumericMeasurement

      @Deprecated public Binding<Number> createNumericMeasurement(PathObject pathObject, String column)
      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 public Binding<String> createStringMeasurement(PathObject pathObject, String column)
      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

      public boolean isStringMeasurement(String name)
      Query whether a named measurement returns a String value only.
      Parameters:
      name - the measurement name
      Returns:
      true if the measurement returns a String (only), false otherwise
    • isNumericMeasurement

      public boolean isNumericMeasurement(String name)
      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

      public ReadOnlyListWrapper<String> getMeasurementNames()
      Description copied from interface: PathTableData
      Get the names of all numeric measurements.
      Specified by:
      getMeasurementNames in interface PathTableData<PathObject>
      Returns:
    • getDoubleValues

      public double[] getDoubleValues(String column)
      Description copied from interface: PathTableData
      Get all double values for all items.
      Specified by:
      getDoubleValues in interface PathTableData<PathObject>
      Parameters:
      column -
      Returns:
    • getNumericValue

      public double getNumericValue(PathObject pathObject, String column)
      Description copied from interface: PathTableData
      Get the numeric value from an object for the specific measurement.
      Specified by:
      getNumericValue in interface PathTableData<PathObject>
      Parameters:
      pathObject -
      column -
      Returns:
    • getItems

      public ObservableList<PathObject> getItems()
      Description copied from interface: PathTableData
      Get internal list of the items used to provide measurements.
      Specified by:
      getItems in interface PathTableData<PathObject>
      Returns:
    • getBackingListEntries

      public ObservableList<PathObject> getBackingListEntries()
      Access the underlying entries, for which getEntries provides a filtered view.
      Returns:
    • getAllNames

      public List<String> getAllNames()
      Description copied from interface: PathTableData
      Return an ordered list of all names, including both numeric measurements and String values.
      Specified by:
      getAllNames in interface PathTableData<PathObject>
      Returns:
    • getStringValue

      public String getStringValue(PathObject pathObject, String column)
      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 interface PathTableData<PathObject>
      Parameters:
      pathObject -
      column -
      Returns:
    • getStringValue

      public String getStringValue(PathObject pathObject, String column, int decimalPlaces)
      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 interface PathTableData<PathObject>
      Parameters:
      pathObject -
      column -
      decimalPlaces -
      Returns:
    • getMetadataNames

      public ReadOnlyListWrapper<String> getMetadataNames()
      Get the names of all columns corresponding to metadata (String) values.
      Returns: