Thanks to visit codestin.com
Credit goes to Github.com

Skip to content
/ demis Public

Deep Electron Microscopy Image Stitching (DEMIS): a tool for stitching grids of electron microscopy images. Image matching is performed using LoFTR.

License

Notifications You must be signed in to change notification settings

PSilling/demis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEMIS: Deep Electron Microscopy Image Stitching

DEMIS is a tool for stitching grids of electron microscopy (EM) images using deep learning-based feature matching and optical flow refinement.

TESCAN GROUP logo   FIT BUT logo

Overview

DEMIS normalizes image tiles, detects feature matches using LoFTR, estimates pairwise transformations between tiles, and optimizes them globally to stitch the final grid.

Key features:

  • Deep feature matching: Uses LoFTR for robust matching of EM images with low-quality or highly repetitive texture.
  • Optical flow refinement: Refines alignments using RAFT-based optical flow.
  • Flexible configuration: Support for multiple feature matching, grid construction and image compositing methods.
  • ImageJ integration: Includes a plugin for easy use within ImageJ2 and Fiji.

Installation

The following setup guide was tested on Ubuntu 22.04 and Windows 11. Running on Windows might have a negative performance impact.

Prerequisites

  • Python 3.9
  • uv: DEMIS uses uv for dependency management.
  • CUDA: A CUDA-enabled GPU is required to use deep learning-based features. Running on CPU would be too slow.

Setup

  1. Clone the repository:
git clone https://github.com/PSilling/demis.git
cd demis
  1. Install dependencies using uv:
uv sync
  1. Set PYTHONPATH to the root of the repository.
  • Linux: export PYTHONPATH=$PWD
  • Windows: $env:PYTHONPATH = $PWD (PowerShell)
  1. Download weights for LoFTR:
  • Place LoFTR weights in LoFTR/weights/. Recommended options:

Usage

Scripts from scripts/ directory can be run using uv run. Ensure PYTHONPATH is set to project root.

Stitching

To stitch a dataset using a configuration file:

uv run scripts/stitch.py --config configs/em424-fine-tuned.yaml

Evaluation

To evaluate performance on the EM424 dataset:

uv run scripts/evaluate_demis.py --config configs/em424-fine-tuned.yaml

Documentation

Detailed documentation is available in the docs/ directory:

  • Configuration Guide: Detailed explanation of all YAML options.
  • Datasets: Information on the EM424 dataset and expected dataset format.
  • Training: Instructions for fine-tuning LoFTR on EM424 dataset.
  • ImageJ Plugin: Guide for building and using the ImageJ plugin.

Acknowledgements

DEMIS is supported by TESCAN GROUP and the Faculty of Information Technology, Brno University of Technology.

Citation

If you use our tool, please cite our paper published in BIOIMAGING 2025:

ŠILLING, P.; ŠPANĚL, M. DEMIS: Electron Microscopy Image Stitching using Deep Learning Features and Global Optimisation. Proceedings of the 18th International Joint Conference on Biomedical Engineering Systems and Technologies - BIOIMAGING. Porto: Institute for Systems and Technologies of Information, Control and Communication, 2025. p. 255-256. ISBN: 978-989-758-731-3.

About

Deep Electron Microscopy Image Stitching (DEMIS): a tool for stitching grids of electron microscopy images. Image matching is performed using LoFTR.

Resources

License

Stars

Watchers

Forks

Packages

No packages published