Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Transformer.java
1 package ij.plugin.filter;
2 import ij.*;
3 import ij.process.*;
4 import ij.gui.*;
5 import ij.measure.Calibration;
6 import java.awt.*;
7 import java.awt.image.*;
8 
10 public class Transformer implements PlugInFilter {
11 
12  ImagePlus imp;
13  String arg;
14 
15  public int setup(String arg, ImagePlus imp) {
16  this.arg = arg;
17  this.imp = imp;
18  if (arg.equals("fliph") || arg.equals("flipv"))
19  return IJ.setupDialog(imp, DOES_ALL+NO_UNDO);
20  else
22  }
23 
24  public void run(ImageProcessor ip) {
25 
26  if (arg.equals("fliph")) {
27  ip.flipHorizontal();
28  return;
29  }
30 
31  if (arg.equals("flipv")) {
32  ip.flipVertical();
33  return;
34  }
35 
36  if (arg.equals("right"))
37  ip = ip.rotateRight();
38  else
39  ip = ip.rotateLeft();
40  Calibration cal1 = imp.getCalibration();
41  imp.changes = false;
42  ImagePlus imp2 = new ImagePlus(imp.getTitle(), ip);
43  imp2.show();
44  return;
45  }
46 
47 }