Skip to content

Napari PySPIM Plugin

Interactive graphical interface for processing SPIM data within Napari.

Overview

The plugin integrates seamlessly with Napari, providing a tabbed interface for all SPIM processing steps. It leverages the core PySPIM package for processing while offering an intuitive GUI for parameter adjustment and result visualization.

Features

Interactive Processing Pipeline

  • Tabbed Interface: Organized workflow with dedicated tabs for each processing step
  • Real-time Visualization: See results immediately in the Napari viewer
  • Parameter Adjustment: Interactive sliders and controls for all processing parameters
  • Progress Tracking: Real-time progress bars and status updates

Processing Steps

  1. Data Loading
  2. Load various file formats (TIFF, HDF5, Zarr)
  3. Preview data in Napari layers
  4. Metadata display and validation

  5. ROI Detection

  6. Automated ROI detection with preview
  7. Manual ROI selection tools
  8. ROI refinement and validation

  9. Deskewing

  10. Interactive deskewing parameter adjustment
  11. Real-time preview of deskewed results
  12. GPU acceleration support

  13. Registration

  14. Multi-view registration with quality metrics
  15. Registration parameter optimization
  16. Result validation and refinement

  17. Deconvolution

  18. Advanced deconvolution algorithms
  19. PSF model selection and configuration
  20. Iteration control and convergence monitoring

Installation

# Install from source
git clone https://github.com/matt-black/pyspim.git
cd pyspim
just install

Usage

Basic Workflow

  1. Launch Napari

    napari
    

  2. Load the Plugin

  3. Go to Plugins → PySPIM → DiSPIM Pipeline

  4. Process Your Data

  5. Follow the tabbed workflow from left to right
  6. Adjust parameters as needed
  7. View results in the Napari viewer

Advanced Usage

import napari
from napari_pyspim import DispimPipelineWidget

# Create viewer
viewer = napari.Viewer()

# Load data
viewer.open("path/to/your/data.tif")

# Create and add the widget
widget = DispimPipelineWidget(viewer)
viewer.window.add_dock_widget(widget, name="PySPIM Pipeline")

Widget Structure

The plugin provides a main widget (DispimPipelineWidget) with the following components:

  • DataLoaderWidget: File loading and data preview
  • RoiDetectionWidget: ROI detection and selection
  • DeskewingWidget: Deskewing parameter adjustment
  • RegistrationWidget: Registration and alignment
  • DeconvolutionWidget: Deconvolution processing

Integration with Napari

The plugin integrates deeply with Napari:

  • Layer Management: Automatically creates and manages Napari layers
  • Event Handling: Responds to Napari events and updates
  • Viewer Integration: Seamless integration with Napari's viewer controls
  • Plugin Discovery: Automatically discovered by Napari's plugin system

Performance

  • Lazy Loading: Data is loaded on-demand to minimize memory usage
  • Background Processing: Long-running operations run in background threads
  • Progress Updates: Real-time progress reporting for all operations
  • Memory Management: Efficient memory usage with chunked processing

Troubleshooting

Issue Solution
Plugin not appearing Restart Napari after installation
CUDA errors Ensure CuPy is properly installed
Memory issues Use smaller data chunks

Next Steps