use of qupath.lib.images.servers.PixelCalibration in project qupath by qupath.
the class LocalBinaryPatternsPlugin method getPreferredTileSizePixels.
static ImmutableDimension getPreferredTileSizePixels(final ImageServer<BufferedImage> server, final ParameterList params) {
// Determine tile size
int tileWidth, tileHeight;
PixelCalibration cal = server.getPixelCalibration();
if (cal.hasPixelSizeMicrons()) {
double tileSize = params.getDoubleParameterValue("tileSizeMicrons");
tileWidth = (int) (tileSize / cal.getPixelWidthMicrons() + .5);
tileHeight = (int) (tileSize / cal.getPixelHeightMicrons() + .5);
} else {
tileWidth = (int) (params.getDoubleParameterValue("tileSizePx") + .5);
tileHeight = tileWidth;
}
return ImmutableDimension.getInstance(tileWidth, tileHeight);
}
Aggregations