-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtiff2stl.ijm
More file actions
20 lines (20 loc) · 802 Bytes
/
tiff2stl.ijm
File metadata and controls
20 lines (20 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
print(getArgument())
print("importing .tiff files");
var name = getArgument();
var imgSequence = "open=./" + name +"/ scale=50 sort";
print(imgSequence);
run("Image Sequence...", imgSequence);
setOption("BlackBackground", false);
print("converting .tiff files to binary images");
run("Make Binary", "method=MaxEntropy background=Dark calculate black");
//setTool("hand");
run("3D Viewer");
call("ij3d.ImageJ3DViewer.setCoordinateSystem", "false");
print("converting .tiff to 3D rendering");
call("ij3d.ImageJ3DViewer.add", name, "White", name, "50", "true", "true", "true", "2", "2");
call("ij3d.ImageJ3DViewer.select", name);
print("exporting 3D rendering to .stl");
var filename = "./" + name + ".stl";
call("ij3d.ImageJ3DViewer.exportContent", "STL ASCII", filename);
print("exiting");
run("Quit");