[micro-manager-general] my version of 2-CameraAcq.bsh from scripts/
Status: Beta
Brought to you by:
nicost
|
From: Karl B. <kar...@gm...> - 2016-01-28 15:39:14
|
I modified the distributed version for internal testing and updated the API
calls.
Hope this helps someone.
import org.json.JSONArray;
import org.json.JSONObject;
import org.micromanager.utils.MDUtils;
String c1 = "Andor sCMOS Camera 1";
String c2 = "Andor sCMOS Camera 2";
String acq = "2-Live";
int nrFrames = 10;
gui.closeAllAcquisitions();
gui.clearMessageWindow();
gui.openAcquisition(acq, "/storage/big0/kdb/vesm/", 1, 2, 1, true);
gui.setChannelColor(acq, 0, Color.RED);
gui.setChannelColor(acq, 1, Color.GREEN);
gui.setChannelName("2-Live", 0, c1);
gui.setChannelName("2-Live", 1, c2);
int w = mmc.getImageWidth();
int h = mmc.getImageHeight();
int d = mmc.getBytesPerPixel();
int b = mmc.getImageBitDepth();
gui.initializeAcquisition(acq, w, h, d,b);
// delete previous content of circular buffer
mmc.initializeCircularBuffer();
mmc.startSequenceAcquisition(c1, nrFrames, 0, false);
mmc.startSequenceAcquisition(c2, nrFrames, 0, false);
int c1_frame = 0;
int c2_frame = 0;
while (mmc.isSequenceRunning() || mmc.getRemainingImageCount() > 0) {
if (mmc.getRemainingImageCount() > 0) {
img = mmc.popNextTaggedImage();
JSONObject md = img.tags;
cName = md.get("Camera");
if (c1.equals(cName)) {
print ("Camera: " + cName + " Channel: 0" + " Frame : " +
c1_frame);
gui.addImageToAcquisition(acq,c1_frame,0,0,0,img);
c1_frame++;
}
else {
print ("Camera: " + cName + " Channel: 1" + " Frame : " +
c2_frame);
gui.addImageToAcquisition(acq,c2_frame,1,0,0,img);
c2_frame++;
}
}
}
print ("Finished Dual Camera Acquisition");
Cheers
Karl Bellvé
Biomedical Imaging Group
Molecular Medicine
University of Massachusetts Medical School
|