Search in sources :

Example 1 with WorkflowCommandLogView

use of qupath.lib.gui.panes.WorkflowCommandLogView in project qupath by qupath.

the class QuPathGUI method initializeAnalysisPanel.

private void initializeAnalysisPanel() {
    analysisPanel.setTabClosingPolicy(TabClosingPolicy.UNAVAILABLE);
    projectBrowser = new ProjectBrowser(this);
    analysisPanel.getTabs().add(new Tab("Project", projectBrowser.getPane()));
    ImageDetailsPane pathImageDetailsPanel = new ImageDetailsPane(this);
    analysisPanel.getTabs().add(new Tab("Image", pathImageDetailsPanel.getPane()));
    /*
		 * Create tabs.
		 * Note that we don't want ImageData/hierarchy events to be triggered for tabs that aren't visible,
		 * since these can be quite expensive.
		 * For that reason, we create new bindings.
		 * 
		 * TODO: Handle analysis pane being entirely hidden.
		 */
    // Create annotation tab
    var tabAnnotations = new Tab("Annotations");
    var annotationTabImageData = Bindings.createObjectBinding(() -> {
        return tabAnnotations.isSelected() ? imageDataProperty.get() : null;
    }, tabAnnotations.selectedProperty(), imageDataProperty());
    var annotationMeasurementsTable = new SelectedMeasurementTableView(annotationTabImageData).getTable();
    SplitPane splitAnnotations = new SplitPane();
    splitAnnotations.setOrientation(Orientation.VERTICAL);
    var annotationPane = new AnnotationPane(this, imageDataProperty());
    annotationPane.disableUpdatesProperty().bind(tabAnnotations.selectedProperty().not());
    splitAnnotations.getItems().addAll(annotationPane.getPane(), annotationMeasurementsTable);
    tabAnnotations.setContent(splitAnnotations);
    analysisPanel.getTabs().add(tabAnnotations);
    // analysisPanel.getSelectionModel().selectedItemProperty()
    // Create hierarchy tab
    var tabHierarchy = new Tab("Hierarchy");
    var hierarchyTabImageData = Bindings.createObjectBinding(() -> {
        return tabHierarchy.isSelected() ? imageDataProperty.get() : null;
    }, imageDataProperty(), tabHierarchy.selectedProperty());
    final PathObjectHierarchyView paneHierarchy = new PathObjectHierarchyView(this, imageDataProperty());
    paneHierarchy.disableUpdatesProperty().bind(tabHierarchy.selectedProperty().not());
    SplitPane splitHierarchy = new SplitPane();
    splitHierarchy.setOrientation(Orientation.VERTICAL);
    splitHierarchy.getItems().addAll(paneHierarchy.getPane(), new SelectedMeasurementTableView(hierarchyTabImageData).getTable());
    tabHierarchy.setContent(splitHierarchy);
    analysisPanel.getTabs().add(tabHierarchy);
    // Bind the split pane dividers to create a more consistent appearance
    splitAnnotations.getDividers().get(0).positionProperty().bindBidirectional(splitHierarchy.getDividers().get(0).positionProperty());
    var commandLogView = new WorkflowCommandLogView(this);
    TitledPane titledLog = new TitledPane("Command history", commandLogView.getPane());
    titledLog.setCollapsible(false);
    titledLog.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    var pane = new BorderPane(titledLog);
    analysisPanel.getTabs().add(new Tab("Workflow", pane));
}
Also used : TitledPane(javafx.scene.control.TitledPane) WorkflowCommandLogView(qupath.lib.gui.panes.WorkflowCommandLogView) ImageDetailsPane(qupath.lib.gui.panes.ImageDetailsPane) AnnotationPane(qupath.lib.gui.panes.AnnotationPane) BorderPane(javafx.scene.layout.BorderPane) Tab(javafx.scene.control.Tab) PathObjectHierarchyView(qupath.lib.gui.panes.PathObjectHierarchyView) SelectedMeasurementTableView(qupath.lib.gui.panes.SelectedMeasurementTableView) SplitPane(javafx.scene.control.SplitPane) ProjectBrowser(qupath.lib.gui.panes.ProjectBrowser)

Example 2 with WorkflowCommandLogView

use of qupath.lib.gui.panes.WorkflowCommandLogView in project qupath by qupath.

the class Commands method createWorkflowDisplayDialog.

/**
 * Create a dialog to show the workflow history for the current image data.
 * @param qupath the QuPath instance
 * @return a workflow display dialog
 */
public static Stage createWorkflowDisplayDialog(QuPathGUI qupath) {
    var view = new WorkflowCommandLogView(qupath);
    Stage dialog = new Stage();
    dialog.initOwner(qupath.getStage());
    dialog.setTitle("Workflow viewer");
    Pane pane = view.getPane();
    dialog.setScene(new Scene(pane, 400, 400));
    return dialog;
}
Also used : WorkflowCommandLogView(qupath.lib.gui.panes.WorkflowCommandLogView) Stage(javafx.stage.Stage) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane) MeasurementMapPane(qupath.lib.gui.panes.MeasurementMapPane) BorderPane(javafx.scene.layout.BorderPane) ViewTrackerControlPane(qupath.lib.gui.viewer.recording.ViewTrackerControlPane) PathClassPane(qupath.lib.gui.panes.PathClassPane) GridPane(javafx.scene.layout.GridPane) Pane(javafx.scene.layout.Pane)

Aggregations

BorderPane (javafx.scene.layout.BorderPane)2 WorkflowCommandLogView (qupath.lib.gui.panes.WorkflowCommandLogView)2 Scene (javafx.scene.Scene)1 SplitPane (javafx.scene.control.SplitPane)1 Tab (javafx.scene.control.Tab)1 TitledPane (javafx.scene.control.TitledPane)1 GridPane (javafx.scene.layout.GridPane)1 Pane (javafx.scene.layout.Pane)1 StackPane (javafx.scene.layout.StackPane)1 Stage (javafx.stage.Stage)1 AnnotationPane (qupath.lib.gui.panes.AnnotationPane)1 ImageDetailsPane (qupath.lib.gui.panes.ImageDetailsPane)1 MeasurementMapPane (qupath.lib.gui.panes.MeasurementMapPane)1 PathClassPane (qupath.lib.gui.panes.PathClassPane)1 PathObjectHierarchyView (qupath.lib.gui.panes.PathObjectHierarchyView)1 ProjectBrowser (qupath.lib.gui.panes.ProjectBrowser)1 SelectedMeasurementTableView (qupath.lib.gui.panes.SelectedMeasurementTableView)1 ViewTrackerControlPane (qupath.lib.gui.viewer.recording.ViewTrackerControlPane)1