Dirigo: a future Python alternative to Scanimage?

Over the last 20 years, many microscopes that are capable of resonant scanning two-photon microscopy have converged on using ScanImage, a powerful software package with many strengths but also two downsides: First, it is no longer open-source, and second, it is written in Matlab, a framework that many scientists and developers now find less attractive compared with more flexible languages such as Python. But how exactly would we replace ScanImage if we could design a microscope control software from scratch?

Tim Weber has been working on these ideas. He has developed a framework called Dirigo that may serve as a modular, extensible backend for scientific image acquisition. One aspect of the design I particularly appreciate is its clean separation of responsibilities. Dirigo organizes its functionality into four independent “workers” – self-contained threads with a stop event and an inbox queue – which handle the core tasks of acquisition, processing, display, and logging. Based on my own experience building and rebuilding resonant-scanning microscope software (see my earlier blog post), this separation makes a great deal of sense. It not only creates components that can be flexibly combined, but also naturally distributes acquisition, computation, and visualization across threads. For anyone interested in online processing or closed-loop experiments, Dirigo’s structure looks like a very promising foundation.

If you’re curious and have a bit of time, take a look at the project on GitHub. Tim has also written a series of short posts on the Image.sc forum that go into the design in more detail:

  1. Designing Dirigo: a flexible, extensible backend for scientific image acquisition
  2. Demo & Pipeline
  3. Hardware extensibility: the digitizer interface for talking to DAQs cleanly
  4. Unit quantities
  5. Worker Products

I especially recommend posts #2 and #3. Post #2 includes a demo video and gives a clear explanation of how the worker model functions in practice. Post #3 digs into the digitizer interfaces, covering systems from National Instruments and Alazar to several boards I hadn’t encountered before but that look quite promising (and are also described in the GitHub README).

These and other hardware interfaces are a crucial part of any microscope control system, since they define how the software communicates with the acquisition hardware itself. If you’re interested in contributing – whether by adding wrappers for specific devices or by expressing interest in particular hardware interfaces – I am pretty sure that Tim would be very happy to hear from you!

This entry was posted in Calcium Imaging, Imaging, Microscopy, neuroscience and tagged , , , , . Bookmark the permalink.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.