Microscope Image Processing Library (MIPLIB) is a Python based software library, created especially for processing and analysis of fluorescece microscopy images. It contains functions for example for:
- image registration 2D/3D
- image deconvolution and fusion (2D/3D), based on efficient CUDA GPU accelerated algorithms
- Fourier Ring/Shell Correlation (FRC/FSC) based image resolution analysis -- and several blind image restoration methods based on FRC/FSC.
- Image quality analysis
- ...
The library is distributed under a BSD open source license.
MIPLIB uses modern Python packaging with uv for fast, reliable dependency management. The library requires Python 3.11+ and works on all platforms (Windows, macOS, Linux).
- Python 3.11+: MIPLIB requires a modern Python version
- C Compiler: For compiling Cython extensions
- macOS: Install Xcode command line tools:
xcode-select --install - Windows: Install Microsoft C++ Build Tools
- Linux: Install
build-essential(Ubuntu/Debian) or equivalent
- macOS: Install Xcode command line tools:
- Java Runtime (Optional): Required only if using the Bioformats reader for microscopy formats
- Set
JAVA_HOMEenvironment variable - See JPype installation guide for details
- Set
-
Install uv (if not already installed):
curl -LsSf https://astral.sh/uv/install.sh | sh # Or on Windows: powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
-
Clone the repository:
git clone https://github.com/sakoho81/miplib.git cd miplib -
Install MIPLIB (creates virtual environment automatically):
uv sync
-
Activate the environment:
source .venv/bin/activate # On Unix/macOS # Or on Windows: .venv\Scripts\activate
For contributors and developers:
-
Fork and clone the repository:
git clone [email protected]:<your_account>/miplib.git cd miplib
-
Install with development dependencies:
uv sync --extra dev
-
Install pre-commit hooks (recommended):
source .venv/bin/activate pre-commit install -
Run tests to verify everything works:
source .venv/bin/activate pytest tests/
For CUDA acceleration (NVIDIA GPUs):
uv sync --extra cudaOnce published to PyPI:
uv add miplib
# Or with pip: pip install miplibMy preferred tool for explorative tasks is Jupyter Notebook/Lab. Please look for updates in the notebooks/ folder (a work in progress). Let me know if you would be interested in some specific example to be included.
There are also a number of command line scripts (entry points) in the bin/ directory that may be handy in different batch processing tasks. They are also a good place to start exploring the library.
MIPLIB was born as a combination of several previously separate libraries. The code and structure, although working, might (does) not in all places make sense. Any suggestions for improvements, new features etc. are welcome.
The deconvolution algorithms can be accelerated with a GPU. On MacOS the CUDA GPU acceleration currently does not work, because there are no NVIDIA drivers available for the latest OS versions. I recently re-factored the GPU acceleration functions, using the CuPy library. It would in principle be possible to use OpenCL backend, instead of CUDA, but I have not tried that (yet).
Here are some works that have been made possible by the MIPLIB (and its predecessors):
Koho, S. V. et al. Two-photon image-scanning microscopy with SPAD array and blind image reconstruction. Biomed. Opt. Express, BOE 11, 2905–2924 (2020)
Koho, S., T. Deguchi, and P. E. E. Hänninen. 2015. “A Software Tool for Tomographic Axial Superresolution in STED Microscopy.” Journal of Microscopy 260 (2): 208–18.
Koho, Sami, Elnaz Fazeli, John E. Eriksson, and Pekka E. Hänninen. 2016. “Image Quality Ranking Method for Microscopy.” Scientific Reports 6 (July): 28962.
Prabhakar, Neeraj, Markus Peurla, Sami Koho, Takahiro Deguchi, Tuomas Näreoja, H-C Huan-Cheng Chang, Jessica M. J. M. Rosenholm, and Pekka E. P. E. Hänninen. 2017. “STED-TEM Correlative Microscopy Leveraging Nanodiamonds as Intracellular Dual-Contrast Markers.” Small 1701807 (December): 1701807.
Deguchi, Takahiro, Sami Koho, Tuomas Näreoja, and Pekka Hänninen. 2014. “Axial Super-Resolution by Mirror-Reflected Stimulated Emission Depletion Microscopy.” Optical Review 21 (3): 389–94.
Deguchi, Takahiro, Sami V. Koho, Tuomas Näreoja, Juha Peltonen, and Pekka Hänninen. 2015. “Tomographic STED Microscopy to Study Bone Resorption.” In Proceedings of the SPIE, 9330:93301M – 93301M – 6.