-
Notifications
You must be signed in to change notification settings - Fork 2
/
_DKR_MarkCellLocationToROIManager.txt
45 lines (39 loc) · 1.22 KB
/
_DKR_MarkCellLocationToROIManager.txt
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
macro "Mark Cell Location" {
roiManager("reset");
run("Colors...", "foreground=white background=black selection=yellow");
i=1;
leftButton=16;
rightButton=4;
shift=1;
ctrl=2;
alt=8;
x2=-1; y2=-1; z2=-1; flags2=-1;
logOpened = false;
print("close this window when done");
print(" zoom to reposition with +/-, do not attempt to drag the window");
print(" remember to save the ROI set after closing this window");
if (getVersion>="1.37r")
setOption("DisablePopupMenu", true);
while (!logOpened || isOpen("Log")) {
getCursorLoc(x, y, z, flags);
//only recalculate if the cursor has changed one position
if (x!=x2 || y!=y2 || z!=z2 || flags!=flags2) {
if(flags==16||flags==2){
makePoint(x,y);
roiManager("add");
setOption("Show All",true);
roiManager("Select", i-1);
roiManager("Rename", i);
i++;
run("Select None");
roiManager("Deselect");
}
logOpened = true;
startTime = getTime();
}
x2=x; y2=y; z2=z; flags2=flags;
wait(100);
}
if (getVersion>="1.37r")
setOption("DisablePopupMenu", false);
}