-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTwo_Canvasses.java
More file actions
40 lines (31 loc) · 899 Bytes
/
Copy pathTwo_Canvasses.java
File metadata and controls
40 lines (31 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package examples;
import java.awt.Frame;
import ij.IJ;
import ij.ImagePlus;
import ij.plugin.PlugIn;
import ij3d.IJAdapter;
import ij3d.Image3DUniverse;
import ij3d.ImageCanvas3D;
public class Two_Canvasses implements PlugIn {
@Override
public void run(String arg) {
// Open a hyperstack
String path = "d:/template.tif";
ImagePlus imp = IJ.openImage(path);
// Create a universe and show it
Image3DUniverse univ = new Image3DUniverse();
univ.addVoltex(imp);
univ.show();
// retrieve some info about the 1st canvas
int w = univ.getCanvas().getWidth();
int h = univ.getCanvas().getHeight();
// Create a new canvas and add it
ImageCanvas3D canvas2 = new ImageCanvas3D(w, h, new IJAdapter());
univ.getViewer().getView().addCanvas3D(canvas2);
// create a new window, add the canvas and show it
Frame f = new Frame();
f.add(canvas2);
f.pack();
f.show();
}
}