Search in sources :

Example 1 with MeasurementMapPane

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

the class Commands method createMeasurementMapDialog.

/**
 * Create a dialog for displaying measurement maps.
 * @param qupath the {@link QuPathGUI} instance to which the maps refer
 * @return a measurement map dialog
 */
public static Stage createMeasurementMapDialog(QuPathGUI qupath) {
    var dialog = new Stage();
    if (qupath != null)
        dialog.initOwner(qupath.getStage());
    dialog.setTitle("Measurement maps");
    var panel = new MeasurementMapPane(qupath);
    BorderPane pane = new BorderPane();
    pane.setCenter(panel.getPane());
    Scene scene = new Scene(pane, 300, 400);
    dialog.setScene(scene);
    dialog.setMinWidth(300);
    dialog.setMinHeight(400);
    // pane.setMinSize(300, 400);
    // dialog.setResizable(false);
    dialog.setOnCloseRequest(e -> {
        OverlayOptions overlayOptions = qupath.getOverlayOptions();
        if (overlayOptions != null)
            overlayOptions.resetMeasurementMapper();
        dialog.hide();
    });
    dialog.setOnShowing(e -> {
        panel.updateMeasurements();
    });
    return dialog;
}
Also used : BorderPane(javafx.scene.layout.BorderPane) OverlayOptions(qupath.lib.gui.viewer.OverlayOptions) Stage(javafx.stage.Stage) Scene(javafx.scene.Scene) MeasurementMapPane(qupath.lib.gui.panes.MeasurementMapPane)

Aggregations

Scene (javafx.scene.Scene)1 BorderPane (javafx.scene.layout.BorderPane)1 Stage (javafx.stage.Stage)1 MeasurementMapPane (qupath.lib.gui.panes.MeasurementMapPane)1 OverlayOptions (qupath.lib.gui.viewer.OverlayOptions)1