Skip to content

matt-black/pyspim

Repository files navigation

PySPIM

A comprehensive Python library for analyzing and visualizing Selective plane illumination microscopy (SPIM) data, with special emphasis on dual-view SPIM (diSPIM) microscopy.

🚀 Features

  • Complete SPIM Pipeline: Data loading, ROI detection, deskewing, registration, and deconvolution
  • High Performance: Built on Dask for scalable, parallel processing
  • GPU Acceleration: CUDA support with CuPy for fast computation
  • Interactive GUI: Full napari integration with tabbed workflow
  • Modular Design: Separate core library and napari plugin
  • Modern Tooling: UV-based dependency management and build system

📦 Installation

Quick Install

# Install both packages
pip install pyspim napari-pyspim

Development Install

# Clone the repository
git clone https://github.com/matt-black/pyspim.git
cd pyspim

# Install with UV (recommended)
uv sync --extra dev
uv pip install -e packages/pyspim
uv pip install -e packages/napari-pyspim

🏗️ Project Structure

This is a modern monorepo using UV for dependency management:

pyspim/
├── packages/
│   ├── pyspim/              # Core SPIM processing library
│   └── napari-pyspim/       # Napari plugin for GUI
├── docs/                    # Documentation (MkDocs + Material)
├── examples/                # Example data and notebooks
├── examples/                # Example code, data, and scripts
└── pyproject.toml          # UV workspace configuration

🚀 Quick Start

Command Line Usage

import pyspim

# Load and process SPIM data
data = pyspim.load_data("path/to/data.tif")
processed = pyspim.process_pipeline(data)
pyspim.save_data(processed, "output.tif")

Napari Plugin Usage

import napari

# Launch napari and load the PySPIM plugin
viewer = napari.Viewer()
# Go to Plugins → PySPIM → DiSPIM Pipeline

📚 Documentation

Building Documentation Locally

# Build documentation
just docs

# Serve documentation locally
just docs-serve

🛠️ Development

Prerequisites

  • Python 3.8.1+
  • UV (recommended) or pip
  • CUDA-compatible GPU (optional)

Development Commands

# Install development environment
just install-dev

# Run tests
just test

# Format code
just format

# Run linting
just lint

# Build packages
just build

# Clean build artifacts
just clean

Contributing

We welcome contributions! Please see our Contributing Guide for details.

📋 Requirements

Core Dependencies

  • numpy: Numerical computing
  • dask: Parallel processing
  • scikit-image: Image processing
  • tifffile: TIFF file I/O
  • zarr: Array storage
  • cupy-cuda12x: GPU acceleration (optional)

GUI Dependencies

  • napari: Scientific image viewer
  • npe2: Napari plugin engine
  • qtpy: Qt bindings
  • PyQt5: GUI framework

🎯 Use Cases

  • Light Sheet Microscopy: Process SPIM/diSPIM data
  • Multi-view Registration: Align multiple imaging views
  • Deconvolution: Improve image resolution
  • ROI Analysis: Focus on specific regions of interest
  • Batch Processing: Process multiple datasets efficiently

📄 License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0) - see the License file for details.

🤝 Citation

If you use PySPIM in your research, please cite:

@software{pyspim2024,
  title={PySPIM: Selective Plane Illumination Microscopy Analysis},
  author={PySPIM Team},
  year={2024},
  url={https://github.com/matt-black/pyspim}
}

📞 Support


PySPIM - Making SPIM data analysis accessible and efficient! 🔬✨

About

library for diSPIM analysis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages