-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScript1.ijm
More file actions
28 lines (28 loc) · 1.1 KB
/
Script1.ijm
File metadata and controls
28 lines (28 loc) · 1.1 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
Directory = getDirectory("Choose the folder containing Images");
Images = getFileList(Directory);
NumImages = Images.length;
for (t = 0; t < NumImages; t += 1) {
CurrentImage = Images[t];
//file = File.openAsString(Path);
open(Directory + CurrentImage);
CurrentImageID = getImageID();
selectImage(CurrentImageID);
Stack.setChannel(4)
setOption("ScaleConversions", true);
run("8-bit");
run("Grays");
run("Subtract Background...", "rolling=10");
run("Gaussian Blur...", "sigma=0.3 scaled");
run("adaptiveThr ", "using=Mean from=557 then=-2");
//run("adaptiveThr ", "using=Mean from=1201 then=-5");
//557 and -2 for Epi
run("Despeckle", "slice");
run("Watershed", "slice");
//setOption("BlackBackground", true);
//run("Erode"); Erode function not used for new centroid detection
run("Analyze Particles...", "size=10-Infinity circularity=0.40-1.00 show=[Count Masks] display clear add slice");
//selectWindow("Count Masks of Epidermis.tif");
run("Find Maxima...", "prominence=10 output=[Single Points]");
selectWindow("Results");
saveAs("text", Directory + "Results for " + CurrentImage + ".csv");
}