Re: [micro-manager-general] Variable exposure length in multidimensional acquisition series
Status: Beta
Brought to you by:
nicost
|
From: Nico S. <ni...@cm...> - 2011-01-30 22:16:01
|
Hi Damian, Thanks for bringing this up. Camera-shutter synchronization is a recurring issue, and I hope that the following explanations will help improve things. > I’ve been working with Franz Reitner from PCO, who has been a great > help, to > resolve my shutter synchronization issue, and think we have > identified the > problem. When a multidimensional image is acquired, the camera > creates the > image series (rather than relying on a trigger signal from > Micromanager), I am not sure what you mean with this, and I do not think it describes what is going accurately. The MDA does not "create the images series" in the camera. Rather, it moves all other peripheral equipment into the correct state and then issues the "SnapImage" function. This operation takes place for each individual frame, i.e., Micro-Manager does not ask the camera to take a series of images but asks it to take individual images consecutively. > and it seems like there is poor synchronization between the image > series > generation in camera and micromanager control of the mechanical > shutter. Camera-Shutter synchronization all takes place in the Micro-Manager Core function "SnapImage". When Autoshutter is active, it will open the shutter, wait for the shutter to open, call the "SnapImage" function in the camera, wait for this function to return, and then close the shutter. It is the task of the camera adapter's SnapImage function to start the exposure as quickly, and return immediately after exposure finishes. If the camera adapter waits longer, either since it can not immediately start exposure (some cameras seem to be running more like a video camera, taking images continuously and one has to wait until the next exposure happens to start), or because image buffer readout does take place in the SnapImage function (instead of in the GetImageBuffer where it should be happening), then the shutter will stay open longer then it should. So, you only need to test the SnapImage function (which you can do by pressing the "Snap" button) to test Micro-Manager's camer-shutter synchronization. A simple test is to replace the real camera with the DemoCamera (a software only camera that behaves as expected by the Micro-Manager core) and test how long the shutter stays open in relation to the set exposure time (your trick to measure duration of the TTL pulses is a good one). I have done this test a number of times, and always have seen tight synchronization (i.e., pulse duration not more than 1 ms longer than the exposure time). > While these patterns do not affect the image intensities (presumably > because > the TTL pulse durations are all much longer than the camera > exposure), the > TTL pulse (and hence the length of time the mechanical shutter is > open) is > roughly double the length camera exposure time, and, because it is > important > than our samples are exposed to minimum amount of light, it would be > very > helpful if mechanical shutter opening could be better synchronized > to the > camera exposure. Do you think this is at all possible? When I look at the PCO adapter code, I see that the SnapImage function calls the PCO SDK function "WaitForImage()". Although I have not looked at the documentation to this function, I suspect that it waits for readout of the image to complete, since the adapter's "GetImageBuffer" function does not seem to wait for readout completion. So, the PCO adapter's SnapImage function clearly does not play its part in Micro-Manager's synchronization strategy, and the delays that you are seeing are most likely caused by it. You could test if this is true by changing readout speed of the camera and see if that affects the time the shutter stays open. Please do explain the situation to Franz and ask if he has a solution. To be fair, I am quite surprised how difficult this issue seems to be for most camera manufactures. If - from their point of view - there is a better way to achieve synchronization 'd love to hear it. From the software's point of view, it seems reasonable and simple to ask the camera to start exposure as quickly as possible and to give a signal immediately after exposure ends. Without such facilities, it seems virtually impossible to get reliable synchronization. Best, Nico |