Search in sources :

Example 1 with AnnotationPane

use of qupath.lib.gui.panes.AnnotationPane 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)

Aggregations

SplitPane (javafx.scene.control.SplitPane)1 Tab (javafx.scene.control.Tab)1 TitledPane (javafx.scene.control.TitledPane)1 BorderPane (javafx.scene.layout.BorderPane)1 AnnotationPane (qupath.lib.gui.panes.AnnotationPane)1 ImageDetailsPane (qupath.lib.gui.panes.ImageDetailsPane)1 PathObjectHierarchyView (qupath.lib.gui.panes.PathObjectHierarchyView)1 ProjectBrowser (qupath.lib.gui.panes.ProjectBrowser)1 SelectedMeasurementTableView (qupath.lib.gui.panes.SelectedMeasurementTableView)1 WorkflowCommandLogView (qupath.lib.gui.panes.WorkflowCommandLogView)1