Search in sources :

Example 1 with GridLines

use of qupath.lib.gui.viewer.GridLines in project qupath by qupath.

the class Commands method promptToSetGridLineSpacing.

/**
 * Prompt to input the spacing for the grid lines optionally displayed on viewers.
 * @param options the {@link OverlayOptions} that manage the grid lines.
 */
public static void promptToSetGridLineSpacing(OverlayOptions options) {
    GridLines gridLines = options.getGridLines();
    ParameterList params = new ParameterList().addDoubleParameter("hSpacing", "Horizontal spacing", gridLines.getSpaceX()).addDoubleParameter("vSpacing", "Vertical spacing", gridLines.getSpaceY()).addBooleanParameter("useMicrons", "Use microns", gridLines.useMicrons());
    if (!Dialogs.showParameterDialog("Set grid spacing", params))
        return;
    gridLines = new GridLines();
    gridLines.setSpaceX(params.getDoubleParameterValue("hSpacing"));
    gridLines.setSpaceY(params.getDoubleParameterValue("vSpacing"));
    gridLines.setUseMicrons(params.getBooleanParameterValue("useMicrons"));
    options.gridLinesProperty().set(gridLines);
}
Also used : ParameterList(qupath.lib.plugins.parameters.ParameterList) GridLines(qupath.lib.gui.viewer.GridLines)

Aggregations

GridLines (qupath.lib.gui.viewer.GridLines)1 ParameterList (qupath.lib.plugins.parameters.ParameterList)1