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;
}
Aggregations