Hi all,
I am working on a Micro-Manager (1.4.22) beanshell script to perform live fluorescence imaging (I only need the mean gray value of the current image) during a running acquisition. My original script allows a framerate of around 40 frames/s. Based on the gray value, the script gives a live feedback to another device.
I wonder, if I can speed it up by hiding the images during acquisition? I accomplished to avoid displaying it by setting the “show” boolean in “gui.openAcquisition(dFF0, rootDirName, nrFrames, nrChannels, nrSlices, nrPositions, /* show / false, / save */ false)” to false, but then I don’t know how to access the image and its mean gray value anymore (I used “getStatistics().mean”).
Thank you in advance for any ideas!
Best regards,
Amelie
Here parts of an example code (adapted from the micro-manager page) that works only, when images are displayed:
gui.openAcquisition(title, acqDir,
nrFrames, nrChannels, nrSlices, nrPositions,
/* show / false,
/ save */ true);
width = (int) mmc.getImageWidth();
height = (int) mmc.getImageHeight();
bytesPerPixel = (int) mmc.getBytesPerPixel();
bitDepth = (int) mmc.getImageBitDepth();
gui.initializeAcquisition(title, width, height, bytesPerPixel, bitDepth);
mmc.startSequenceAcquisition(nrFrames, 0, true);
frame = 0;
exposureMs = mmc.getExposure();
while (mmc.getRemainingImageCount() > 0 || mmc.isSequenceRunning(mmc.getCameraDevice())) {
if (mmc.getRemainingImageCount() > 0) {
img = mmc.popNextTaggedImage();
imp = IJ.getImage();
double F = imp.getStatistics().mean;
gui.addImageToAcquisition(title, frame, 0, 0, 0, img);
frame++;
}
else {
mmc.sleep(Math.min(0.5 * exposureMs, 20));
}
}
mmc.stopSequenceAcquisition();