Search in sources :

Example 1 with TMASummaryViewer

use of qupath.lib.gui.tma.TMASummaryViewer in project qupath by qupath.

the class Commands method launchTMADataViewer.

/**
 * Open new window with the TMA data viewer.
 * @param qupath current {@link QuPathGUI} instance (may be null).
 */
public static void launchTMADataViewer(QuPathGUI qupath) {
    Stage stage = new Stage();
    if (qupath != null)
        stage.initOwner(qupath.getStage());
    TMASummaryViewer tmaViewer = new TMASummaryViewer(stage);
    ImageData<BufferedImage> imageData = qupath.getImageData();
    if (imageData != null && imageData.getHierarchy().getTMAGrid() != null)
        tmaViewer.setTMAEntriesFromImageData(imageData);
    try {
        Screen screen = Screen.getPrimary();
        stage.setWidth(screen.getBounds().getWidth() * 0.75);
        stage.setHeight(screen.getBounds().getHeight() * 0.75);
    } catch (Exception e) {
        logger.error("Exception setting stage size", e);
    }
    stage.show();
}
Also used : Screen(javafx.stage.Screen) Stage(javafx.stage.Stage) TMASummaryViewer(qupath.lib.gui.tma.TMASummaryViewer) BufferedImage(java.awt.image.BufferedImage) IOException(java.io.IOException)

Aggregations

BufferedImage (java.awt.image.BufferedImage)1 IOException (java.io.IOException)1 Screen (javafx.stage.Screen)1 Stage (javafx.stage.Stage)1 TMASummaryViewer (qupath.lib.gui.tma.TMASummaryViewer)1