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.

  • Field Details

    • NAME_OBJECT_ID

      public static final String NAME_OBJECT_ID
      The name used for the Object ID column
  • 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. This effectively filters the contents of getBackingList() when returning getItems().
      Parameters:
      predicate - the filter to apply
    • 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:
      See Also:
    • 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 item 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

      @Deprecated public ObservableList<PathObject> getBackingListEntries()
      Deprecated.
      v0.6.0 use instead getBackingList()
      Access the underlying entries, for which getEntries provides a filtered view.
      Returns:
      a list of all objects used to create the table
    • getBackingList

      public ObservableList<PathObject> getBackingList()
      Access all the objects used to generate the table. This contains all the objects passed to setImageData(ImageData, Collection) and may be longer than the list returned by getItems() if a predicate has been applied.
      Returns:
      the list of objects
      Since:
      v0.6.0
    • 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:
      See Also:
    • 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:
    • getHelpText

      public String getHelpText(String column)
      Get help text for a measurement if available, or null if no help text is found.
      Parameters:
      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: