Class PixelClassifierUI

java.lang.Object
qupath.process.gui.commands.ml.PixelClassifierUI

public class PixelClassifierUI extends Object
Helper class for generating standardized UI components for pixel classification.
Author:
Pete Bankhead
  • Constructor Details

    • PixelClassifierUI

      public PixelClassifierUI()
  • Method Details

    • createRegionFilterCombo

      public static ComboBox<RegionFilter> createRegionFilterCombo(OverlayOptions options)
      Create a ComboBox that can be used to select the pixel classification region filter.
      Parameters:
      options -
      Returns:
    • createPixelClassifierButtons

      public static Pane createPixelClassifierButtons(ObjectExpression<ImageData<BufferedImage>> imageData, ObjectExpression<PixelClassifier> classifier, StringExpression classifierName)
      Create a standard button pane for pixel classifiers, to create, measure and classify objects.
      Parameters:
      imageData - expression that provides the ImageData to which the operation should be applied
      classifier - expression that provides the PixelClassifier that will be used
      classifierName - expression that provides the saved name of the classifier. If available, running a command will result in it being logged to the history workflow for later scripting.
      Returns:
      a Pane that may be added to a scene
    • createSavePixelClassifierPane

      public static Pane createSavePixelClassifierPane(ObjectExpression<Project<BufferedImage>> project, ObjectExpression<PixelClassifier> classifier, StringProperty savedName)
      Create a pane that contains a text field and save button to allow a pixel classifier to be saved in a project.
      Parameters:
      project - the current project, within which the classifier can be saved
      classifier - the classifier to save
      savedName - property to store the classifier name. If the user saves the classifier, this will be set to the saved name. Otherwise, if classifier is changed, this will be set to null. Therefore it provides a way to determine if the current classifier has been saved and, if so, what is its name.
      Returns:
      a pane that may be added to a scene
    • promptToCreateObjects

      public static boolean promptToCreateObjects(ImageData<BufferedImage> imageData, PixelClassifier classifier, String classifierName)
      Prompt the user to create objects directly from the pixels of an ImageServer. Often, the ImageServer has been created by applying a PixelClassifier.
      Parameters:
      imageData - the ImageData to which objects should be added
      classifier - the ImageServer used to generate objects
      classifierName - the name of the classifier; if not null and the command runs to completion, it will be logged in the history workflow of the ImageData for later scripting.
      Returns:
      true if changes were made, false otherwise