HamamatsuHam in Python - MMCore

Hey,

This is my first post in image.sc :stuck_out_tongue:

I’m trying to update our software in the lab in order to use MMCore as our device layer (atm we have our own but wanted something more general). Nico told me about pymmcore and I tried for the Hamamatsu camera (seems to work in the first approach) but I have some questions/problems I wanted to discuss:

  • We have multiple hamamatsu cameras that need to acquire at the same time, we currently do this with multithreading in Python (I know not the best, but it has worked so far), and we also save it to memory as well. I have seen that I need to choose one of the cameras in my program with mmc.setCameraDevice(“Camera”); Is there a way to solve this design question with the already implemented MMCore?

  • When I print the list of available properties I see that the ones we use from dcam are not implemented, for example readout_speed, subarray_vpos/hpos/vsize/hsize,
    for i in range(1, len(properties)):
    prop = properties[i];
    val = self._camera.getProperty(“Camera”, prop);
    print("Name: " + prop + ", value: " + val);

and I get a CMMError * if I try self._mcc.getProperty(“Camera”, “readout_speed”) for example.

I have the hamamatsu Fusion and it seems to detect it without problems, I used:
mmc.loadDevice(‘Camera’, ‘HamamatsuHam’, ‘HamamatsuHam_DCAM’);

But anyway quite exciting to keep working on this direction.

Best,
Xavi.

Welcome @Xavi!

Great to see that you manager to get things going. Indeed, Micro-Manager has the concept of the “current” camera. To enable the use of multiple cameras simultaneously, we use a specific device, called “Multi-Camera” that is in the Utilties Device Adapter. It has properties that you can use to tell it which cameras to actually use. When snapping an image with this Multi-Camera device, it will snap images from all of its child cameras. There are some pointers in this paper: Advanced methods of microscope control using μManager software | Edelstein | Journal of Biological Methods, and there is some documentation here: Utilities - Micro-Manager.

As for the available properties being incomplete, I think that the device adapter code queries the camera for available properties. It is possible that we are building against a DCAM-DSK (from 2016) that is too old and I asked Hamamtsu for help.

Thanks for the quick reply!

That’s actually very cool, we had something similar called MultiManager but in Python, so seems much better to leave that to a more threading efficient language :+1:t3::+1:t3: I will take a look.

Thanks for asking them! If we have a different dll is it possible to change it? Maybe the adapter already works since the properties are defined there? not sure though

Best,
Xavi.