PunctaTools is a Python toolkit for fluorescence microscopy workflows that bundles ROI segmentation, puncta segmentation, and downstream quantification into a single, reproducible package.
- ROI segmentation -- Cellpose-based whole-cell segmentation with label stitching across z-stacks.
- Puncta segmentation -- Dual modes: Cellpose masks or Ilastik-assisted predictions with per-ROI normalization.
- Ilastik training data generation -- Prepare normalized ROI crops for training Ilastik pixel classifiers.
- Quantification -- Extensive per-ROI and per-puncta metrics including intensity, morphology, colocalization (PCC, SCC, Manders), surface area, and more.
- JSON-driven configuration -- Fully reproducible processing pipelines driven by simple JSON config files.
pip install -e .Note for institutional users: This environment file uses the conda-forge channel exclusively, which does not require a commercial Anaconda license.
conda env create -f environment.yml
conda activate punctatoolspip install -r requirements.txt
pip install -e .- Python 3.9+
- CUDA/cuDNN configured for Cellpose GPU mode (optional but recommended)
- Ilastik installed separately for the Ilastik puncta workflow
The quantification module reads TIFF/OME-TIFF files using tifffile by default. For proprietary microscope formats (Leica .lif, Zeiss .czi, Nikon .nd2, etc.), install the optional Bio-Formats backend:
pip install -e ".[bioformats]"This requires a working Java installation (JDK) and adds python-bioformats and javabridge as dependencies. Note that python-bioformats is licensed under GPL-2.0.
punctatools roi-seg params.json # ROI segmentation (Cellpose)
punctatools puncta-seg params.json # Puncta segmentation (Cellpose or Ilastik)
punctatools train-ilastik params.json # Generate Ilastik training ROIs
punctatools quantify params.json # ROI/puncta quantificationEach sub-command consumes a JSON configuration file. See the examples/ directory for templates.
A typical analysis pipeline consists of the following steps:
- ROI segmentation -- Segment cells/nuclei from raw fluorescence images using Cellpose.
- Puncta segmentation -- Detect puncta within each ROI using either Cellpose or Ilastik.
- For the Ilastik workflow, first generate training data with
train-ilastik, train a pixel classifier in the Ilastik GUI, then runpuncta-segwith"segmentation_method": "ilastik".
- For the Ilastik workflow, first generate training data with
- Quantification -- Measure intensity, morphology, and colocalization metrics per ROI and per punctum.
punctatools_v2/
src/punctatools/
cli.py # Command-line interface
config.py # JSON config dataclasses
segmentation/
roi.py # Cellpose ROI segmentation
puncta.py # Cellpose / Ilastik puncta segmentation
ilastik_training.py # Ilastik training ROI generation
quantification/
roi.py # ROI and sub-ROI quantification
utils/
metadata.py # ImageJ TIFF metadata helpers
examples/ # Example JSON configuration files
environment.yml # Conda environment (conda-forge)
requirements.txt # Pip requirements
This project is licensed under the GNU General Public License v2.0. See LICENSE for details.