-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdataking.js
51 lines (42 loc) · 1.83 KB
/
dataking.js
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
// A method for extracting cell fluorescence data from a stack of images.
ID = getImageID();
// First, you need to convert your 8-bit grayscale images to binary,
// with the cells white, background black.
//
// I find the following series of manipulations work well:
// 1. Process -> Subtract Background...
// Don't use this if you are analyzine a field full of cells.
run("Subtract Background...");
// 2. Process -> FFT -> Bandpass Filter...
// The default settings (40, 3, none, 5, check, check) have worked well
// so far, but might be worth playing around with them.
run("Bandpass Filter...");
//
// 3. Image -> Adjust -> Threshold
// Play around with this until cells are red and background is not.
// Error on side of cell overlap, as that will be handled by the next
// step and reduces the chance that a cell will be split due to a dark
// vacuole or something like that.
run("Threshold...");
title = "Wait...";
msg = "If necessary, use the \"Threshold\" tool to\nadjust the threshold, then click \"OK\".";
waitForUser(title, msg);
selectImage(ID); //make sure we still have the same image
getThreshold(lower, upper);
if (lower==-1)
exit("Threshold was not set");
// 4. Process -> Binary -> Fill Holes
// run("Fill Holes", "stack"):
// 5. Process -> Binary -> Watershed
run("Watershed", "stack");
// Now you have a nice stack of images in binary format! Next, run
//
// 6. Analyze -> Analyze Particles...
roiManager("Reset");
Dialog.create("Particle Parameters");
Dialog.addNumber("Minimum area",100);
Dialog.addNumber("Minimum circularity",0.53);
Dialog.show();
a = Dialog.getNumber();
c = Dialog.getNumber();
run("Analyze Particles...", "size="+a+"-Infinity circularity="+c+"-1.00 show=Outlines exclude clear include summarize record add stack");