-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflylight_easyopen.ijm
77 lines (76 loc) · 2.02 KB
/
flylight_easyopen.ijm
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//"flylight_easyopen"
//This macro makes compositses of split channel tifs with appropriate channel colours.
//It also makes a Z projection. Takes some of the edge off manual annotation.
macro "flylight_easyopen [u]" {
names= getList("image.titles");
if (names.length==0) {
print("no images open");
return;
}
if (names.length==1) {
print("only 1 image open");
return;
}
if (names.length>4) {
print("too many images open");
return;
}
if (names.length==2) {
//Open the appropriate color for each channel if image is 20xTI;
for (i=0;i<names.length;i++) {
if(endsWith(names[i],"c0.tif" )) {
selectWindow(names[i]);
rename("venus");
}
if(endsWith(names[i],"c1.tif" )) {
selectWindow(names[i]);
rename("neuropil");
}
}
run("Merge Channels...", "c2=venus c6=neuropil create");
run("Z Project...", "projection=[Standard Deviation]");
}
if (names.length==3) {
//Open the appropriate color for each channel if image is Polarity;
for (i=0;i<names.length;i++) {
if(endsWith(names[i],"c0.tif" )) {
selectWindow(names[i]);
rename("sytHA");
}
if(endsWith(names[i],"c1.tif" )) {
selectWindow(names[i]);
rename("flag");
}
if(endsWith(names[i],"c2.tif" )) {
selectWindow(names[i]);
rename("neuropil");
}
}
run("Merge Channels...", "c2=flag c4=sytHA c6=neuropil create");
run("Z Project...", "projection=[Standard Deviation]");
}
if (names.length==4) {
//Open the appropriate color for each channel if image is MCFO;
for (i=0;i<names.length;i++) {
if(endsWith(names[i],"c0.tif" )) {
selectWindow(names[i]);
rename("stain1");
}
if(endsWith(names[i],"c1.tif" )) {
selectWindow(names[i]);
rename("stain2");
}
if(endsWith(names[i],"c2.tif" )) {
selectWindow(names[i]);
rename("stain3");
}
if(endsWith(names[i],"c3.tif" )) {
selectWindow(names[i]);
rename("neuropil");
}
}
run("Merge Channels...", "c2=stain1 c4=neuropil c6=stain2 c5=stain3 create");
run("Z Project...", "projection=[Standard Deviation]");
}
//end
}