-
Notifications
You must be signed in to change notification settings - Fork 10
/
plotProfileLoop.ijm
52 lines (41 loc) · 1.42 KB
/
plotProfileLoop.ijm
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
//This simple macro uses "Live" function of imageJ's "Plot Profile" in a loop,
//in order to monitor the pixel values in a ROI defined in the macro
//anywhere on a screenshot image of the whole screen.
//grab the whole screen into an image window
run("Capture Screen");
//Set the ROI for use by Plot Profile
makeRectangle(124, 386, 290, 259);
//makeRectangle(region);
//Grab the ROI from the screen shot and make a new imiage with it.
run("Copy");
run("Internal Clipboard");
//Make the profile plot with all of the new image, containing the ROI
run("Select All");
run("Plot Profile");
//Close the screenshot
selectWindow("Screenshot");
run("Close");
// user needs to click "Live" button in plot profile window and move it to a good place.
waitForUser;
// Set number of times to run the loop, it can be a very large number.
timePoints = 100;
// Loop to repeat the above first plot,
// resuimng the clipboard image and pasting into it
// and closing the screenshots as we go
// plot profile is in live mode, so it updates automatically when the input image changes.
for (i=0; i<timePoints; i++){
run("Capture Screen");
run("Set... ", "zoom=1");
// same ROI as above here please.
makeRectangle(124, 386, 290, 259);
run("Copy");
selectWindow("Clipboard-1");
run("Paste");
selectWindow("Screenshot");
run("Close");
//add a time delay here to update less often
//wait(100);
}
// tidy up
selectWindow("Clipboard-1");
run("Close");