-
Notifications
You must be signed in to change notification settings - Fork 393
Description
I've developed an interactive visualization tool for debugging and analyzing CNMF pipeline stages using Napari. This tool allows users to inspect intermediate results at each stage of the CNMF algorithm (initialization, spatial updates, temporal updates, merging, and refinement), making it easier to understand component evolution and diagnose issues.
Motivation
When running CNMF analysis, it's often difficult to understand:
Why certain components are detected or missed
How components change through spatial/temporal updates
The effect of merging on final results
Whether the algorithm is behaving as expected
This tool addresses these challenges by providing real-time visualization and analysis of each pipeline stage.
Features
-Stage Switching: Navigate between all CNMF debug stages using keyboard shortcuts
-Interactive ROI Analysis: Click on any ROI to see:
Spatial component visualization
Temporal trace plots
A×C reconstruction
Correlation analysis (CNMF vs raw data)
Quality metrics (SNR, compactness, etc.)
Activity distribution histograms
-Reference Layers: Toggle validation layers including:
Original mean image
Max projection
Reconstructed mean (A×C)
Component density map
Local correlation map
Debug Tracking Integration: Works with a debug_tracker module that saves intermediate CNMF results at each pipeline stage.
Related Changes
This feature also requires adding debug hooks to cnmf.py to save intermediate results at each stage using a debug_tracker module. I can provide these changes as well if there's interest.
Questions for Maintainers
Would this be useful as part of the main CaImAn package or as a separate companion tool?
Are there specific stages or metrics you'd like to see added?