1 package ij.plugin.filter;
11 private static double xscale = 0.5;
12 private static double yscale = 0.5;
13 private static boolean interpolate =
true;
19 Roi roi = imp.getRoi();
20 if (roi!=null && !roi.isArea())
26 public void run(ImageProcessor ip) {
29 ip.setInterpolate(interpolate);
34 catch(OutOfMemoryError o) {
40 void scale(ImageProcessor ip) {
41 ip.scale(xscale, yscale);
45 boolean showDialog() {
46 GenericDialog gd =
new GenericDialog(
"Scale");
47 gd.addNumericField(
"X Scale (0.05-25):", xscale, 2);
48 gd.addNumericField(
"Y Scale (0.05-25):", yscale, 2);
49 gd.addCheckbox(
"Interpolate", interpolate);
54 xscale = gd.getNextNumber();
55 yscale = gd.getNextNumber();
56 if (gd.invalidNumber()) {
57 IJ.
error(
"X or Y scale are invalid.");
60 if (xscale > 25.0) xscale = 25.0;
61 if (xscale < 0.05) xscale = 0.05;
62 if (yscale > 25.0) yscale = 25.0;
63 if (yscale < 0.05) yscale = 0.05;
64 interpolate = gd.getNextBoolean();