-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathmacro.txt
37 lines (34 loc) · 1.31 KB
/
macro.txt
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
//
dir = getArgument;
dir2 = "',temp,'";
list = getFileList(dir);
open(dir + list[0]);
run("Set Scale...", "distance=',distance.pixel, ' known=',known.distance, ' pixel=1 unit=cm global");
for (i=0; i<list.length; i++) {
open(dir + list[i]);
width = getWidth() - ',trim.pixel, ';
height = getHeight() -',trim.pixel,' ;
run("Canvas Size...", "width=" + width + " height=" + height + " position=Bottom-Center");
run("8-bit");
run("Threshold...");
setAutoThreshold("Minimum");
run("Analyze Particles...", "size=',size.arg,' circularity=',circ.arg,' show=Masks display clear record");
saveAs("Measurements", dir2+list[i]+".txt");
saveAs("tiff", dir+list[i]+ "_mask.tif")};
// else
dir = getArgument;
dir2 = "',temp,'";
list = getFileList(dir);
open(dir + list[0]);
run("Set Scale...", "distance=',distance.pixel, ' known=',known.distance, ' pixel=1 unit=cm global");
for (i=0;
i<list.length; i++) {
open(dir + list[i]);
width = getWidth() - ',trim.pixel, ';
height = getHeight() -',trim.pixel,' ;
run("Canvas Size...", "width=" + width + " height=" + height + " position=Bottom-Center");
run("8-bit");
run("Threshold...");
setAutoThreshold("Minimum");
run("Analyze Particles...", "size=',size.arg,' circularity=',circ.arg,' show=Masks display clear record");
saveAs("Measurements", dir2+list[i]+".txt")};