microscope-cockpit / cockpit

Cockpit is a microscope graphical user interface. It is a flexible and easy to extend platform aimed at life scientists using bespoke microscopes.
https://microscope-cockpit.org
GNU General Public License v3.0
35 stars 26 forks source link

Import experiment exposure timings from main window interface. #858

Open iandobbie opened 1 year ago

iandobbie commented 1 year ago

In a discussion with Diamond CryoSIM group today they said it would be really nice to import the exposure times for each camera from the main window interface. The reason this is not trivial is there is no association between lasers and cameras, especially on multi-camera systems.

There are a few possible solution to this.

1) Heuristics, a laser gets associated with the camera with the next lowest emission wavelength.

2) Expand the use of the mapping table used in the single camera multi-channel code from the Zaber system.

These two could also easily be combined with a table taking precedence, then a heuristic applied. This could be done at experiment dialog open, so still leaving an option to hand edit the exposure times if needed.

iandobbie commented 1 year ago

The single camera multiple wavelength code has the following type of entry in the camera section of the depot.conf

em-map: 488 : 525 561 : 580

So with maps excitation wavelengths to emission on that camera but this is specifically designed for the multibandpass filter cube where the excitation is defined but the emission wavelength is unknown.

This could just be crudely hacked into the code but I am not happy with this approach. A significant question is where should this mapping data go? Does it want to be on the camera, on the light source or elsewhere? I think the cemar is a sensible place but it does mean we need to update it if we have filter wheels and change the definitions in the filter wheels.

I will play about a bit and try to implement something.

juliomateoslangerak commented 1 year ago

What about using the information in the defined channels? Those define the sequence of events. in the experiment window we would need to choose which channels to use and the order.

iandobbie commented 1 year ago

That is actually a good idea. There are a few awkward corners as a "channel" doesn't necessarily have a single camera or light source active.

How about each camera remembers the last channel it was activated with and then the default values are then for any active light sources in that channel. We could then add a dropdown for each line of the experiment settings where you could select an alternative channel to grab that exposure time/light source. Finally the existing text boxes would stay for fully manual control.

juliomateoslangerak commented 1 year ago

That is actually a good idea. There are a few awkward corners as a "channel" doesn't necessarily have a single camera or light source active.

I would say that is an advantage as you may setup mixed simultaneous exposure. That is, whatever is active in one channel is exposed simultaneously and channels are run sequentially. That seems intuitive to me, but maybe I'm missing something.

iandobbie commented 1 year ago

You are correct, but currently there isn't a code path to do this, so it might be relatively difficult. You can have multiple light sources active on one camera, or all cameras active with an arbitrary selection of light sources but it is not possible for instance on a 4 camera system to have 2 cameras active for one snapshot, and the other two cameras active for the other snapshot.

I agree this could be a sensible approach eg on a 4 camera system with 4 light sources to be 405/561 and then 488/630 excitation and the relevant cameras for emission as this would separate excitations enough to minimise bleed through while maximising acquisitions speed. We should think about using channels like this but would need some thought and testing.

My suggested change is just populating the text fields in the experiment form and so easily overridden and just encompasses the existing functionality.