Leica M205A and MicroManager

Hello all,

I have a M205A stereoscope that I would love to control via Micromanager. I have my digital camera working through the uManager, but I’d love to also gain control of the motorized focus for stacking.

I read a few posts in the archives about the same desire, but I did not see any evidence for a good solution.

One person seemed hopeful, writing:

The answer is probably yes, if you want to control stuff like focus and zoom. Leica uses an ascii based protocol via virtual serial port for this, and they have apparently not changed that protocol for years.

I’d very much enjoy hearing from anybody that has been successful at controlling the focus or zoom function.

Thanks so much!

1 Like

You will have to see if your microscope came with any documentation on how to use an API they may have provided. I haven’t worked with Leica microscopes but I have used Zeiss MTB API which has great documentation. If nothing else works you could use Windows Automation functions to move the focus since you already can control the camera you are one step closer to fully controlling acquisition. Let me know if your microscope came with a .NET API like Zeiss does and I will be able to help. I have made .NET projects which may be of use incase Leica provided a .NET API. GitHub - BiologyTools/BioImager: A .NET microscopy imaging application based on Bio library. Supports various microscopes by using imported libraries & GUI automation. Supports XInput game controllers to move stage, take images, run ImageJ macros on images or Bio C# scripts. and GitHub - BiologyTools/BioCore: Bio Library in .NET6. Bio is a library & program for annotating, & editing various microscopy imaging formats using Bioformats supported images. including whole slide, pyramidal & series.

Erik,
Thank you for your interest in this problem!

The good news for me is that I’ve been able to control the Leica camera and Marzhauser stage (Blue Oasis controller) using Micro-Manager. This means that I can execute an x-y stitch. The only thing left for me to figure out is control of the Z-axis, for which the motor and controller are integral to the M205A stand. I can control the Z-position using a Leica dial controller and also with the LAS core software but I don’t have the special software module that allows me to execute an automated Z-stack. The perfect solution would be to gain access to the Z-motor using Micro-Manager.

It is unfamiliar territory for me, but I’ll explore whether I can find .NET API information for the M205A.

Thanks again, and best wishes.
Rob

1 Like

No I haven’t worked with Micromanager. I’ve worked with Zeiss & Olympus microscopes. Automating both with .NET approach. Which was easier with Zeiss compared to Olympus due to the MTB API being well documented. From my understanding you would have to create a new plugin for micromanager maybe ask this question on image.sc as well since more people view that forum. If you want to automate windows be sure to get inspect.exe which is useful in seeing what elements the program has.

Thanks again Erik. I’ll explore that possibility.

Much appreciated!

Rob

Erik,

I meant to ask…

Is the Windows Automation approach totally independent of Micro-Manager? Or would it work in concert with Micro-Manager?

If you were involved with Micro-Manager, my hat is off to you. It is quite an impressive tool.

Rob

Hi Rob, This is going back a bit now, but I was wondering whether you were able to get the M205 Z-motor working with Micro-Manager. Thanks

Hi Vica,

I had some success getting Micro-Manager to run the microscope’s camera and also its motorized x-y stage. However, I did not figure out a way to control the Z-axis motor. I’ve been able to stitch using Micro-Manager but not do focus stacking. I’d love to hear from you if you learn how to do it.

Rob

No worries, will do. Thanks.

Hi Rob, I managed to write a device adapter for the for the motorised z-drive on the Leica scope. It works just fine. However, I first had to obtain the SDK for this from Leica and I am not able to share the drivers that came with the SDK, which are needed by the MM device adapter that I cobbled together. I am under some kind of license restriction. If you are able to obtain the SDK yourself (just ask the local rep, it will take a few weeks before central office responds), then I would be able to share my device adapter with you.

1 Like

Dear Victa,

That is exciting news. I wondered whether you had made any progress and you certainly did!

I’ll try to request the drivers. I’m hopeful!

Thanks so much for letting me know about your excellent progress.

Rob

No worries. Ask for the SDK. They will probably ask you to find and provide them the serial number of the motordrive. Good luck and let us know when you have it. The three zipped files (folders) I received were AHM_SDK_V2023.3.0.12509.zip, SDK_Hardware_Configurator_2023.3.0.12509.zip and UCAPI_SDK_V2023.3.0.12509.zip. It is the first one I used and AHM represents “Abstract Hardware Model”. Good luck.

1 Like

Hi Victa,

I contacted Leica, and they have been very kind communicators. However, I’m still waiting for a decision on my SDK request.

I’m wondering if there is a way to communicate directly. I’m unsure whether posting my email is allowed, and I don’t see an option for a personal message to you.

I’ll let you know when I learn more about the SDK. I just wanted to reach out with this update.

Rob

Hi Victa_Phanta,

Good news…Leica has agreed to provide me with the Software Development Kit.

I’d love to learn more about your code to make this work with MicroManager.

Best wishes,
Rob

Hi Victa,

I’ve formally requested the SDK file, and I’d very much appreciate any help you can provide to control the M205 z-axis.

A good contact, if you wish to correspond directly, is:

geomicroscopy@gmail.com

Best,

Rob