-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScript3.ijm
More file actions
35 lines (35 loc) · 1.07 KB
/
Script3.ijm
File metadata and controls
35 lines (35 loc) · 1.07 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
CirclesDirectory = getDirectory("Choose a Directory with Circles");
ImageDirectory = getDirectory("Choose a Directory with Images");
CirclesList = getFileList(CirclesDirectory);
Array.sort(CirclesList);
ImagesList = getFileList(ImageDirectory);
Array.sort(ImagesList);
NumCirc = CirclesList.length;
NumImages = ImagesList.length;
for (t = 0; t < NumCirc; t += 1) {
CurrentCircle = CirclesList[t];
open(CirclesDirectory + CurrentCircle);
CircleID = getImageID();
CurrentImage = ImagesList[t];
open(ImageDirectory + CurrentImage);
ImageID = getImageID();
selectImage(CircleID);
run("Convert to Mask");
run("Analyze Particles...", " show=Overlay display clear add");
selectWindow("Results");
run("Close");
selectImage(ImageID);
for (n = 1; n < 5; n += 1) {
Stack.setChannel(n);
run("Subtract Background...", "rolling=10 slice");
roiManager("multi-measure append");
}
selectWindow("Results");
saveAs("text", ImageDirectory + "Means for " + CurrentImage + ".csv");
selectWindow("Results");
run("Close");
selectImage(CircleID);
close();
selectImage(ImageID);
close();
}