Skip to content

Widgets for calcium imaging analysis visualization in notebooks

License

Notifications You must be signed in to change notification settings

kushalkolar/mesmerize-viz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mesmerize-viz

Motion Correction and CNMF visualizations should just work. CNMFE will work without "rcb" and "residuals" image_data_options.

Harware requirements The large CNMF visualizations with contours etc. usually require either a dedicated GPU or integrated GPU with access to at least 1GB of VRAM.

https://www.youtube.com/watch?v=GWvaEeqA1hw

Installation

After you have mesmerize-core installed:

pip install mesmerize-viz

If you want to use %gui qt you will need pyqt6 or PySide6:

pip install PyQt6
# or
pip install PySide6

Usage

Explore parameter variants

Click on different rows to view the results of different runs of motion correction, CNMF or CNMFE.

mesviz-variants.mp4

Explore components

Explore components using the heatmap selector, or the component index slider. Auto-zoom into components if desired using the checkbox, set the zoom scale using the slider.

mesviz-explore-components.mp4

Visualize component evaluation metrics

View the evaluation metrics by setting the contour colors based on the metrics. Select to show "all", or only "accepted" or only "rejected" components based on the current evaluation criteria. You can also choose to make the accepted or rejected components semi-transparent instead of entirely opague or invisible using the alpha slider.

Colormaps used:

accepted/rejected: Set1, accepted - blue, rejected - red

snr, r_values, and cnn_preds: spring: low value: pink, high value: yellow

mesviz-eval-metrics.mp4

Interactive component evaluation using metrics and manully accept or reject components

Interactively change the metric thresholds for the sliders. See the caiman docs for info on the evaluation params: https://caiman.readthedocs.io/en/latest/Getting_Started.html#component-evaluation

After setting the metric thresholds, you can manually accept or reject components by clicking on them and pressing "a" (accept) or "r" (reject) keys on your keyboard.

When you are happy with component evaluation, click "Save eval to disk". This overwrites the existing hdf5 file with the state of the hdf5 file as shown in the visualization, i.e. estimates.idx_components and estimates.edx_components_bad gets set with respect to the visualization.

mesviz-eval-interactive.mp4

Voila app

Install voila:

pip install voila

Use as a voila app (as shown in the demo video).

cd mesmerize-viz
voila examples/app.ipynb --enable_nbextensions=True

Note that the voila app is a prototype

About

Widgets for calcium imaging analysis visualization in notebooks

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages