-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlueLight.bsh
executable file
·70 lines (51 loc) · 1.76 KB
/
BlueLight.bsh
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import org.micromanager.api.AcquisitionOptions;
import java.lang.System;
gui.closeAllAcquisitions();
//gui.clearMessageWindow();
numBefore = 2;
numAfter = 5;
interval = 500;
exposure = 2000;
gain = 500;
gainon = "On";
acqname = "29-05-12";
YFPchan = "Direct Digital Out 2";
bluechan = "Direct Digital Out 1";
gui.openAcquisition(acqname,"C:/Users/User/Desktop", numBefore + numAfter, 1, 1 );
// set up the camera
cameraName = mmc.getCameraDevice();
mmc.setExposure(exposure);
mmc.setProperty( cameraName, "Binning", "1");
mmc.setProperty( cameraName, "EMSwitch", gainon );
mmc.setProperty( cameraName, "Gain", gain );
// turn off the LEDs
mmc.setProperty( "OptoLED", "Direct Digital Out 0", "0" );
mmc.setProperty( "OptoLED", "Direct Digital Out 3", "0" );
mmc.setProperty( "OptoLED", YFPchan, "0" );
mmc.setProperty( "OptoLED", bluechan, "0" );
// open the shutter
mmc.setProperty( "Core", "AutoShutter", "0" );
mmc.setProperty( "OptoLED", "Shutter", "0" );
mmc.setProperty( "OptoLED", YFPchan, "0" );
mmc.setProperty( "OptoLED", bluechan, "0" );
for (int i=0; i<numBefore; i++) {
now = System.currentTimeMillis();
mmc.setProperty( "OptoLED", YFPchan, "1" );
gui.snapAndAddImage(acqname, i, 0, 0 );
mmc.setProperty( "OptoLED", YFPchan, "0" );
itTook = System.currentTimeMillis() - now;
if ( itTook < interval )
gui.sleep( interval - itTook );
}
mmc.setProperty( "OptoLED", bluechan, "1" );
for (int i=0; i<numAfter; i++) {
now = System.currentTimeMillis();
mmc.setProperty( "OptoLED", YFPchan, "1" );
gui.snapAndAddImage(acqname, numBefore + i, 0, 0 );
mmc.setProperty( "OptoLED", YFPchan, "0" );
itTook = System.currentTimeMillis() - now;
if ( itTook < interval )
gui.sleep( interval - itTook );
}
mmc.setProperty( "OptoLED", bluechan, "0" );
gui.refreshGUI();