Package qupath.process.gui.commands.ml
Class PixelClassifierUI
java.lang.Object
qupath.process.gui.commands.ml.PixelClassifierUI
Helper class for generating standardized UI components for pixel classification.
- Author:
- Pete Bankhead
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.static ComboBox
<RegionFilter> createRegionFilterCombo
(OverlayOptions options) Create aComboBox
that can be used to select the pixel classification region filter.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.static boolean
promptToCreateObjects
(ImageData<BufferedImage> imageData, PixelClassifier classifier, String classifierName) Prompt the user to create objects directly from the pixels of anImageServer
.
-
Constructor Details
-
PixelClassifierUI
public PixelClassifierUI()
-
-
Method Details
-
createRegionFilterCombo
Create aComboBox
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 theImageData
to which the operation should be appliedclassifier
- expression that provides thePixelClassifier
that will be usedclassifierName
- 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 savedclassifier
- the classifier to savesavedName
- 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 anImageServer
. Often, theImageServer
has been created by applying aPixelClassifier
.- Parameters:
imageData
- theImageData
to which objects should be addedclassifier
- theImageServer
used to generate objectsclassifierName
- the name of the classifier; if not null and the command runs to completion, it will be logged in the history workflow of theImageData
for later scripting.- Returns:
- true if changes were made, false otherwise
-