-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreprocessing_deprecated.ijm
More file actions
67 lines (57 loc) · 1.29 KB
/
preprocessing_deprecated.ijm
File metadata and controls
67 lines (57 loc) · 1.29 KB
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
inputDir = getArgument();
print(inputDir);
processFolder(inputDir);
function processAlexaFile(input){
print("3");
open(input);
subStr = split(input, ".");
getMinAndMax(min, max);
setMinAndMax(min, (max/2));
run("Apply LUT");
getMinAndMax(min, max);
setMinAndMax(min, (max/2));
run("Apply LUT");
run("8-bit");
run("Auto Local Threshold", "method=Phansalkar radius=35 parameter_1=0 parameter_2=0 white");
saveAs("PNG", ".."+ subStr[0]);
close();
}
function processDapiFile(input){
print("2");
open(input);
subStr = split(input, ".");
getMinAndMax(min, max);
setMinAndMax(min, (max/2));
run("Apply LUT");
getMinAndMax(min, max);
setMinAndMax(min, (max/2));
run("Apply LUT");
run("8-bit");
saveAs("PNG", ".."+ subStr[0]);
close();
}
function processFolder(input){
print("1");
list = getFileList(input);
for(i = 0; i < list.length; i++){
if(File.isDirectory(input + list[i]))
{
print(input + list[i]);
print("8");
processFolder(input + list[i]);
}
if (endsWith(list[i], ".tif"))
{
if (matches(list[i], ".*Alexa.*")){
print(input + list[i]);
print("9");
processAlexaFile(input + list[i]);
}
if (matches(list[i], ".*DAPI.*")){
print(input + list[i]);
processDapiFile(input + list[i]);
}
}
}
print("ImageJ Vorverarbeitung fertig");
}