forked from chalkie666/imagejMacros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathredgreensspotsmoveillusion.js
33 lines (30 loc) · 1009 Bytes
/
redgreensspotsmoveillusion.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
// Movement illusion
// Look just above the flashing circles and they appear to move towards each other
// but look directly at one of them and it only flashes in same position
// can't remeber where I found this illusion.
importClass(Packages.ij.IJ);
importClass(Packages.ij.gui.OvalRoi);
imp = IJ.createImage("ColourMoveIllusion", "RGB black", 256, 256, 1);
imp.show();
for (var i=0; i<100; i++) {
imp.setRoi(new OvalRoi(150, 106, 45, 45));
IJ.setForegroundColor(255, 0, 0);
IJ.run(imp, "Fill", "slice");
IJ.run(imp, "Select None", "");
IJ.wait(100);
IJ.setForegroundColor(0, 0, 0);
IJ.run("Restore Selection", "");
IJ.run(imp, "Fill", "slice");
IJ.run(imp, "Select None", "");
IJ.setForegroundColor(0, 255, 0);
imp.setRoi(new OvalRoi(80, 106, 45, 45));
IJ.run(imp, "Fill", "slice");
IJ.run(imp, "Select None", "");
IJ.wait(100);
IJ.setForegroundColor(0, 0, 0);
IJ.run("Restore Selection", "");
IJ.run(imp, "Fill", "slice");
IJ.run(imp, "Select None", "");
imp.show();
}
imp.close();