All Projects → radioxoma → micromanager-samples

radioxoma / micromanager-samples

Licence: MIT license
Python samples for Micro-Manager: image acquisition and microscope control system

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to micromanager-samples

bg-atlasapi
A lightweight python module to interact with atlases for systems neuroscience
Stars: ✭ 54 (+184.21%)
Mutual labels:  microscopy
ColiCoords
Single-cell fluorescence microscopy data analysis
Stars: ✭ 22 (+15.79%)
Mutual labels:  microscopy
segmentation
Code for my master's thesis. Instance segmentation of fluorescence microscopy images with deep learning.
Stars: ✭ 38 (+100%)
Mutual labels:  microscopy
flika
An interactive image processing program for biologists written in Python.
Stars: ✭ 20 (+5.26%)
Mutual labels:  microscopy
DeconvolutionLab2
Java (ImageJ/Fiji) software package for 3D deconvolution microscopy
Stars: ✭ 29 (+52.63%)
Mutual labels:  microscopy
cucim
No description or website provided.
Stars: ✭ 218 (+1047.37%)
Mutual labels:  microscopy
atomai
Deep and Machine Learning for Microscopy
Stars: ✭ 77 (+305.26%)
Mutual labels:  microscopy
odemis
Open Delmic Microscope Software
Stars: ✭ 32 (+68.42%)
Mutual labels:  microscopy
ThreeDeconv.jl
A convex 3D deconvolution algorithm for low photon count fluorescence imaging
Stars: ✭ 28 (+47.37%)
Mutual labels:  microscopy
picasso
A collection of tools for painting super-resolution images
Stars: ✭ 77 (+305.26%)
Mutual labels:  microscopy
NanoJ-Fluidics
Manual, source-code and binaries for the NanoJ-Fluidics project
Stars: ✭ 47 (+147.37%)
Mutual labels:  microscopy
simple sim fusion demo
Simple demo of structured illumination microscopy image fusion via Richardson-Lucy deconvolution
Stars: ✭ 13 (-31.58%)
Mutual labels:  microscopy
brainreg
Automated 3D brain registration with support for multiple species and atlases.
Stars: ✭ 73 (+284.21%)
Mutual labels:  microscopy
Scripts
🔬🍸 Home of the ImageJ BAR: A collection of Broadly Applicable Routines for ImageJ
Stars: ✭ 18 (-5.26%)
Mutual labels:  microscopy
sparse-deconv-py
Official Python implementation of the 'Sparse deconvolution'-v0.3.0
Stars: ✭ 18 (-5.26%)
Mutual labels:  microscopy
GPim
Gaussian processes and Bayesian optimization for images and hyperspectral data
Stars: ✭ 29 (+52.63%)
Mutual labels:  microscopy
MicroscPSF-Py
Fast and Accurate 3D PSF Computation for Fluorescence Microscopy
Stars: ✭ 25 (+31.58%)
Mutual labels:  microscopy
axondeepseg
Axon/Myelin segmentation using Deep Learning
Stars: ✭ 102 (+436.84%)
Mutual labels:  microscopy
MiM NikonTi
Config and scripts used to run a Nikon Eclipse Ti in the vanNimwegen lab.
Stars: ✭ 16 (-15.79%)
Mutual labels:  microscopy
ImSwitch
ImSwitch is a software solution in Python that aims at generalizing microscope control by providing a solution for flexible control of multiple microscope modalities.
Stars: ✭ 43 (+126.32%)
Mutual labels:  microscopy

micromanager-samples

Python code samples for Micro-manager image acquisition system

Micromanager project provides broad opportunity for constructing sophisticated image acquisition protocols (e.g. in microscopy). So it becomes possible to overreach vendor software limitation and realize your inherent researcher's freedom as far as possible.

Unfortunately, micromanager documentation lacks for detailed examples. It is not easy to understand the hardware capabilities and API logic. I hope those samples will be helpful in your journey, especially for live video acquisition.

Available samples

  • Getting list of available properties and their allowed values
  • Video grabbing with opencv highgui
  • Efficient frame conversion with Numpy (rgb32 to rgb, bgr)
  • Qt GUI (property browser)
  • OpenGL context for efficient video output

Setup

Windows

Install Micromanager from official website and add C:\Program Files\Micro-Manager-1.4 to PYTHONPATH system variable. After that you can simple import micromanager's core:

import MMCorePy

Linux

I made Archlinux PKGBUILD.

See test snippet at the end of the PKGBUILD.

Issues

Memory requirements not adequate

2014-02-11T14:36:41.328125 p:612 t:2300 [LOG] Error occurred. Device BaumerOptronic. Failed to initialize circular buffer - memory requirements not adequate.
Traceback (most recent call last):[Decode error - output not utf-8]
    mmc.startContinuousSequenceAcquisition(1)
  File "C:\Program Files\Micro-Manager-1.4\MMCorePy.py", line 4956, in startContinuousSequenceAcquisition
    return _MMCorePy.CMMCore_startContinuousSequenceAcquisition(self, *args)
MMCorePy.CMMError: Failed to initialize circular buffer - memory requirements not adequate.

Solution: Just increase circular buffer size (60 megabytes works fine for me). According with mailing list 600-800-1200 MB for circular buffer is normal.

mmc.setCircularBufferMemoryFootprint(60)

Circular buffer is empty

mmc.popNextImage() and mmc.getLastImage() both raises an exception while circular buffer is empty.

Solution: Check buffer for image count.

if mmc.getRemainingImageCount() > 0:
    rgb32 = mmc.popNextImage()

Snippets

def rgb32asrgb(rgb32):
    """View RGB32 as RGB array (no copy, very fast).

    low memory address    ---->      high memory address
    | pixel | pixel | pixel | pixel | pixel | pixel |...
    |-------|-------|-------|-------|-------|-------|...
    |B|G|R|A|B|G|R|A|B|G|R|A|B|G|R|A|B|G|R|A|B|G|R|A|...
    http://avisynth.nl/index.php/RGB32
    """
    return rgb32.view(dtype=np.uint8).reshape(
        rgb32.shape[0], rgb32.shape[1], 4)[...,2::-1]

Further reading

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].