MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / Orthogonal_Views

Class Orthogonal_Views

ij/src/main/java/ij/plugin/Orthogonal_Views.java:55–1067  ·  view source on GitHub ↗

This plugin projects dynamically orthogonal XZ and YZ views of a stack. The output images are calibrated, which allows measurements to be performed more easily. Many thanks to Jerome Mutterer for the code contributions and testing. Thanks to Wayne Rasband for the code that properly handles the imag

Source from the content-addressed store, hash-verified

53 * @author Dimiter Prodanov
54 */
55public class Orthogonal_Views implements PlugIn, MouseListener, MouseMotionListener, KeyListener, ActionListener,
56 ImageListener, WindowListener, AdjustmentListener, MouseWheelListener, FocusListener, CommandListener, Runnable {
57
58 private ImageWindow win;
59 private ImagePlus imp;
60 private boolean rgb;
61 private ImageStack imageStack;
62 private boolean hyperstack;
63 private int currentChannel, currentFrame, currentMode;
64 private ImageCanvas canvas;
65 private static final int H_ROI=0, H_ZOOM=1;
66 private static boolean sticky=true;
67 private static int xzID, yzID;
68 private static Orthogonal_Views instance;
69 private ImagePlus xz_image, yz_image;
70 /** ImageProcessors for the xz and yz images */
71 private ImageProcessor fp1, fp2;
72 private double ax, ay, az;
73 private boolean rotateYZ = Prefs.rotateYZ;
74 private boolean flipXZ = Prefs.flipXZ;
75
76 private int xyX, xyY;
77 private Calibration cal, cal_xz, cal_yz;
78 private double magnification=1.0;
79 private Color color = Roi.getColor();
80 private double min, max;
81 private boolean syncZoom = true;
82 private Point crossLoc;
83 private boolean firstTime = true;
84 private static int previousID, previousX, previousY;
85 private Rectangle startingSrcRect;
86 private boolean done;
87 private boolean initialized;
88 private boolean sliceSet;
89 private Thread thread;
90 final static String CROSS = "|OV|";
91
92
93 public void run(String arg) {
94 imp = IJ.getImage();
95 boolean isStack = imp.getStackSize()>1;
96 hyperstack = imp.isHyperStack();
97 if ((hyperstack||imp.isComposite()) && imp.getNSlices()<=1)
98 isStack = false;
99 if (instance!=null) {
100 if (imp==instance.imp) {
101 instance.dispose();
102 return;
103 } else if (isStack) {
104 instance.dispose();
105 if (IJ.isMacro()) IJ.wait(1000);
106 } else {
107 ImageWindow win = instance.imp!=null?instance.imp.getWindow():null;
108 if (win!=null) win.toFront();
109 return;
110 }
111 }
112 if (!isStack) {

Callers

nothing calls this directly

Calls 1

getColorMethod · 0.95

Tested by

no test coverage detected