Skip to main content

napari-tmidas

License BSD-3 PyPI Supported Python Downloads GitHub stars DOI tests codecov

Analyse a whole folder of microscopy images the same way, without writing code.

napari-tmidas is a free, open-source plugin for the napari image viewer. Set up an analysis on one image, check the result, then run it on every file in a folder: Z-stacks, time-lapse movies, well-plate screens or whole-slide scans, straight from Leica (.lif), Nikon (.nd2), Zeiss (.czi), Hamamatsu (.ndpi) and Acquifer files.

What you can do

  • Convert microscope files to open formats (OME-TIFF, OME-Zarr), keeping pixel size, Z spacing and frame interval. Each converted file is checked against the original.
  • Improve images: remove noise (CAREamics), or predict nuclear and membrane stains from phase contrast or DIC (VisCy).
  • Find objects: outline cells and nuclei (Cellpose, Convpaint) and detect spots such as puncta or transcripts (Spotiflow).
  • Follow cells over time (Trackastra, HOCT, Ultrack), then check tracks, divisions and lineages.
  • Fix mistakes by hand: click to delete, merge, split or relabel objects, or let SAM2 complete a cell that was only partly found.
  • Measure size, shape, intensity and colocalization per object, saved as CSV tables.

Why it is practical

  • No programming. The AI tools install themselves the first time you use them, each in its own environment so they don't interfere with each other.
  • See before you commit. A results table shows each original next to its result, so you can tune parameters on a few images before running the whole folder.
  • Large files. Images bigger than your computer's memory are processed piece by piece (every function except the AI tools).
  • Reproducible. Each run records the function, its settings and software versions in your data folder, ready for a methods section and rerunnable later.
  • Local. Everything runs on your own computer; your images are not uploaded.

napari-tmidas-interactive-table-example

✨ Key Features

🤖 AI Methods Built-In

  • Virtual staining (VisCy) • Denoising (CAREamics) • Spot detection (Spotiflow) • Segmentation (Cellpose, Convpaint) • Tracking (Trackastra, HOCT, Ultrack)
  • Auto-install in isolated environments, kept separate from napari and from each other • GPU acceleration

🔄 Microscopy File Conversion

  • Convert LIF, ND2, CZI (including ZEN camera-streaming files), NDPI, Acquifer → TIFF or OME-Zarr
  • Preserve spatial metadata automatically

⚡ Batch Processing

  • Process entire folders with one click • 40+ processing functions • Progress tracking & quality control
  • One Dimension Order setting, shared by every function — set it once per batch, not per function

🔍 Interactive Workflow

  • Side-by-side table view of original and processed images • Click to instantly compare results • Quickly iterate parameter values • Real-time visual feedback

📊 Complete Analysis Pipeline

  • Segmentation → Tracking → Quantification → Colocalization

🚀 Quick Start (macOS / Linux)

Supports Python 3.11–3.13; commands below use Python 3.12. We recommend installing with uv, which downloads Python for you — no conda needed.

1. Install uv (one-time; Windows: see Installation below)

curl -LsSf https://astral.sh/uv/install.sh | sh 

2. Create an environment with napari and the plugin

uv venv --python 3.12 ~/napari-tmidas-env
source ~/napari-tmidas-env/bin/activate 
uv pip install "napari[all]" napari-tmidas

3. Launch napari in the activated environment

source ~/napari-tmidas-env/bin/activate 
napari

Then find napari-tmidas in the Plugins menu. Watch video tutorials →

💡 Tip: AI methods (SAM2, Cellpose, Spotiflow, etc.) auto-install into isolated environments on first use - no manual setup required! They are built with uv, which also downloads a different Python where a method needs one. If you install packages through a mirror configured in pip.conf (uv does not read it), set NAPARI_TMIDAS_NO_UV=1 to build them with pip instead.

⚠️ Before a batch run: set Dimension Order (top of the batch widget) to match your data — TZYX for a 3D time series, ZYX for a Z-stack, TYX for a 2D movie. Most microscopy TIFFs carry no usable axis metadata, so on Auto a function that builds 3D objects cannot tell Z from T: it will either stop with an error or label the same object once per Z slice. The widget reads each file's rank up front, shows it next to the dropdown, and warns before the run starts.

📖 Documentation

AI-Powered Methods

Method Description Documentation
🎨 VisCy Virtual staining from phase/DIC Guide
🔧 CAREamics Noise2Void/CARE denoising Guide
🎯 Spotiflow Spot/puncta detection Guide
🔬 Cellpose Cell/nucleus segmentation Guide
🎨 Convpaint Custom semantic/instance segmentation Guide
📈 Trackastra Transformer-based cell tracking Guide
🧬 HOCT Transformer-based cell tracking (Higher-Order Cell Tracking Transformer) Guide
🔗 Ultrack Cell tracking based on segmentation ensemble Guide

Core Workflows

  • File Conversion - Multi-format microscopy file conversion (LIF, ND2, CZI, NDPI, Acquifer)
  • Batch Processing - All 40+ processing functions in one place
  • Frame Removal - Interactive human-in-the-loop frame removal from time series
  • Label-Based Cropping - Interactive ROI extraction with label expansion
  • Quality Control - Visual QC with grid overlay
  • Tracking QC - Tracks layer for tracking results and per-file track statistics
  • Quantification - Extract measurements from labels
  • Workflow Log - Every batch run is recorded in tmidas_workflow.jsonl in your data folder: function, parameters, files, outputs and versions

Advanced Features

  • Batch Crop Anything - Interactive object cropping with SAM2
  • Batch Label Inspection - Manual label verification and editing, with one-click delete/relabel across all timepoints, click-to-split for merged objects, and click-to-merge-neighbors for over-segmented ones
  • Multichannel Processing - Channel selection and per-channel processing

💻 Installation

1. Install uv (one-time). Close and reopen your terminal afterwards so uv is on your PATH.

macOS / Linux

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows (PowerShell)

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

2. Create an environment and install napari with the plugin. uv downloads Python 3.12 if you don't have it. On Windows (PowerShell), write $HOME\napari-tmidas-env wherever these commands say ~/napari-tmidas-env.

uv venv --python 3.12 ~/napari-tmidas-env
source ~/napari-tmidas-env/bin/activate      # Windows: $HOME\napari-tmidas-env\Scripts\activate
uv pip install "napari[all]" napari-tmidas
Your Needs Command (in the activated environment)
Standard installation uv pip install napari-tmidas
Want the latest dev features uv pip install "napari-tmidas @ git+https://github.com/MercaderLabAnatomy/napari-tmidas.git"

3. Start napari whenever you want to use it: activate the environment, then run napari.

source ~/napari-tmidas-env/bin/activate      # Windows: $HOME\napari-tmidas-env\Scripts\activate
napari

Updating napari-tmidas

Activate the environment, then upgrade the package:

source ~/napari-tmidas-env/bin/activate      # Windows: $HOME\napari-tmidas-env\Scripts\activate

# Installed from PyPI (standard installation)
uv pip install --upgrade napari-tmidas

# Installed from GitHub (dev version): fetches the newest commit
uv pip install --upgrade "napari-tmidas @ git+https://github.com/MercaderLabAnatomy/napari-tmidas.git"

# Check which version you have
uv pip show napari-tmidas

--upgrade also brings napari-tmidas's dependencies (which can include napari) up to their newest compatible versions. To upgrade only napari-tmidas and leave everything else as it is, use uv pip install --upgrade-package napari-tmidas napari-tmidas instead. The AI methods' own environments in ~/.napari-tmidas/envs are separate and are left as they are. If one misbehaves after an update, delete its folder (e.g. ~/.napari-tmidas/envs/cellpose) and it is rebuilt the next time you use that method. To update uv itself, run uv self update.

Upgrading from v0.5.x or earlier: v0.6 moved to PyQt6, but upgrading does not remove PyQt5, and napari's Qt layer (qtpy) uses PyQt5 whenever it is installed. Remove it once so napari runs on PyQt6:

uv pip uninstall pyqt5 pyqt5-qt5 pyqt5-sip
Alternative: conda / mamba
mamba create -y -n napari-tmidas -c conda-forge python=3.12
mamba activate napari-tmidas
python -m pip install "napari[all]" napari-tmidas

Update with python -m pip install --upgrade napari-tmidas inside the activated environment. conda is not needed by the AI methods: their environments are built with uv either way.

🖼️ Screenshots

File Conversion Widget File Conversion

Convert proprietary formats to open standards with metadata preservation.

Batch Processing Interface Batch Processing

Select files → Choose processing function → Run on entire dataset.

Label Inspection Label Inspection

Inspect and manually correct segmentation results.

SAM2 Crop Anything Crop Anything

Interactive object selection and cropping with SAM2.

📋 TODO

Memory-Efficient Streaming

Done for every function except four AI methods. Batch processing no longer materializes whole stacks: the worker keeps large inputs lazy and streams results back to disk block by block (256 MB budget). Of the 48 registered functions, 36 take a lazy input — most by mapping their existing body over blocks with the @chunked decorator — and 9 own their I/O outright via skip_load. Measured end to end on a real (31, 2, 57, 2720, 2720) uint16 acquisition — 52 GB dense — Gamma Correction peaks at 3.15 GB RSS in 8.8 min, byte-identical to the dense path. Convpaint prediction, Cellpose segmentation and Trackastra tracking all write per-timepoint.

Functions with a whole-stack dependency take it in one reduction pass and then map per block: per-slice areas (Mirror Labels, Keep Slice Range by Area), the min and max (Convert to 8-bit), the maximum label (Subdivide Labels into 3 Layers), or an exact percentile from a histogram, matching np.percentile bit for bit on 8- and 16-bit integers (Percentile Threshold). Functions that read a second file (Intersect Label Images, Label-Based Cropping, both Regionprops functions) open it lazily where its format allows. Merge Timepoints writes its series one timepoint at a time. Large TIFFs are opened page-wise, RGB stacks included.

The mechanism is documented in _chunked.py, and the behaviour is pinned by TestZarrOutputStreaming, TestSplitChannelsStreaming, TestLazyTiffLoading, TestCLAHEDaskMemory, TestRollingBallPerPlane and the worker-level classes in test_chunked.py, which fail if a function goes dense again.

What is left:

  • Four AI methods still run dense. CAREamics denoising, Spotiflow spot detection and Ultrack tracking have no streaming path. VisCy virtual staining accepts _source_filepath but does not use it, and stacks every timepoint in memory before returning. CAREamics and VisCy have not been audited for real, which needs their dedicated virtualenvs installed.
  • Cases that still read densely, by design. Percentile Threshold on floats and 32-bit integers (no exact bounded-memory percentile exists for them); Intersect Label Images when the pair's shape differs and it must be aligned by object centres; a non-leading channel axis (ZCYX) in the label zoom functions, since blocks are cut from the front. Folder functions (Merge Timepoints, Grid View, Regionprops' intensity image below the lazy-TIFF threshold) still read each input file whole, one at a time.

Other Known Issues

  • Resize Zarr by YX Scale (OME-Zarr native) writes zarr v3 stores: attributes live in zarr.json (multiscales nested under an ome key), not in a v2 .zattrs. Anything downstream that reads .zattrs directly will find no file there — use ome_output_utils._read_root_attrs(), which handles both layouts.
  • Python 3.14 is not supported yet. pylibCZIrw, used for CZI conversion, has no Python 3.14 wheel (6.1.0 ships wheels up to 3.13), and building it from source fails on 3.14. Once a wheel is published, add 3.14 to the CI matrix and the pyproject.toml classifiers.

🤝 Contributing

Contributions are welcome! Development uses uv; dependency versions are pinned in uv.lock, which CI installs exactly. Please ensure tests pass before submitting PRs:

git clone https://github.com/MercaderLabAnatomy/napari-tmidas.git
cd napari-tmidas
uv sync                          # creates .venv with the package and dev tools
uv run pytest -m "not slow"      # run the test suite

After changing dependencies in pyproject.toml, run uv lock and commit the updated uv.lock. tox still works for testing against a fresh resolve.

📄 License

BSD-3 License - see LICENSE for details.

🐛 Issues

Found a bug or have a feature request? Open an issue

🙏 Acknowledgments

Built with napari and powered by:

AI/ML Methods:

Core Scientific Stack:

File Format Support:

Metadata

Release files for napari-tmidas 0.6.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for napari-tmidas 0.6.3
File Size Uploaded Provenance Actions
napari_tmidas-0.6.3.tar.gz 1.4 MB Without provenance Details for napari_tmidas-0.6.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for napari-tmidas 0.6.3
File Interpreter ABI Platform Actions
napari_tmidas-0.6.3-py3-none-any.whl Python 3 none any Details for napari_tmidas-0.6.3-py3-none-any.whl

Total release size: 2.4 MB

Release files / napari_tmidas-0.6.3.tar.gz

Download URL napari_tmidas-0.6.3.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
a972bfc61374d5f22f3a56477d1f0fb935f0add57ff66cce4f91d412fd07a344
BLAKE2b-256 checksum
How to use checksums
24cf96fad80a0e71000d56c0c0d602eedb369d2098ce63f66e527641e9e040b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / napari_tmidas-0.6.3-py3-none-any.whl

Download URL napari_tmidas-0.6.3-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
70dbd31691132d119aed9e6ec8d25951792bdf768713edcff7c47de1079d6a33
BLAKE2b-256 checksum
How to use checksums
5435a6564749585f4e8659f142fee68d23bc3d61994598b095c175f399318123
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for napari-tmidas 0.6.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.6.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page