# mesmerize-viz
This is currently in beta and documentation is a WIP. Motion Correction and CNMF visualizations should just work. CNMFE will work without `"rcb"` and `"residuals"` `image_data_options`.
:exclamation: **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
Assuming you have `mesmerize-core` installed:
```bash
git clone https://github.com/kushalkolar/mesmerize-viz.git
cd mesmerize-viz
pip install -e .
```
If you want to use `%gui qt` you will need pyqt6:
```
pip install PyQt6
```
## Usage
### Explore parameter variants
Click on different rows to view the results of different runs of motion correction, CNMF or CNMFE.
https://github.com/kushalkolar/mesmerize-viz/assets/9403332/41175c80-7bdf-4210-96d4-4913ae46568e
### 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.
https://github.com/kushalkolar/mesmerize-viz/assets/9403332/c6d8cb7d-f99c-4771-8562-b890c9a18ae2
### 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
https://github.com/kushalkolar/mesmerize-viz/assets/9403332/b2780212-c941-4306-b7de-45bfa49ab9cd
### 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.
https://github.com/kushalkolar/mesmerize-viz/assets/9403332/0e7b0b41-9360-456c-9c91-6bd74fedb11d
## Voila app
WIP
### Explore components**
Install voila:
```bash
pip install voila
```
Use as a voila app (as shown in the demo video).
```bash
cd mesmerize-viz
voila examples/app.ipynb --enable_nbextensions=True
```
Note that the voila app is a WIP prototype
Raw data
{
"_id": null,
"home_page": "https://github.com/kushalkolar/mesmerize-viz",
"name": "mesmerize-viz",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Kushal Kolar, Caitlin Lewis",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/36/c4/8d915541afc141a54a7b558bc5ba22a83eec8574ba6314e3136bac323ee7/mesmerize_viz-0.1.0.tar.gz",
"platform": null,
"description": "# mesmerize-viz\n\nThis is currently in beta and documentation is a WIP. Motion Correction and CNMF visualizations should just work. CNMFE will work without `\"rcb\"` and `\"residuals\"` `image_data_options`.\n\n:exclamation: **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. \n\nhttps://www.youtube.com/watch?v=GWvaEeqA1hw\n\n## Installation\n\nAssuming you have `mesmerize-core` installed:\n\n```bash\ngit clone https://github.com/kushalkolar/mesmerize-viz.git\ncd mesmerize-viz\npip install -e .\n```\n\nIf you want to use `%gui qt` you will need pyqt6:\n\n```\npip install PyQt6\n```\n\n## Usage\n\n### Explore parameter variants\n\nClick on different rows to view the results of different runs of motion correction, CNMF or CNMFE.\n\nhttps://github.com/kushalkolar/mesmerize-viz/assets/9403332/41175c80-7bdf-4210-96d4-4913ae46568e\n\n### Explore components\n\nExplore 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.\n\nhttps://github.com/kushalkolar/mesmerize-viz/assets/9403332/c6d8cb7d-f99c-4771-8562-b890c9a18ae2\n\n### Visualize component evaluation metrics\n\nView 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.\n\nColormaps used:\n\naccepted/rejected: Set1, accepted - blue, rejected - red\n\nsnr, r_values, and cnn_preds: spring: low value: pink, high value: yellow\n\nhttps://github.com/kushalkolar/mesmerize-viz/assets/9403332/b2780212-c941-4306-b7de-45bfa49ab9cd\n\n### Interactive component evaluation using metrics and manully accept or reject components\n\nInteractively 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 \n\nAfter 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. \n\nWhen 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. \n\nhttps://github.com/kushalkolar/mesmerize-viz/assets/9403332/0e7b0b41-9360-456c-9c91-6bd74fedb11d\n\n## Voila app\n\nWIP\n### Explore components**\n\nInstall voila:\n\n```bash\npip install voila\n```\n\nUse as a voila app (as shown in the demo video).\n\n```bash\ncd mesmerize-viz\nvoila examples/app.ipynb --enable_nbextensions=True\n```\n\nNote that the voila app is a WIP prototype\n",
"bugtrack_url": null,
"license": "GPL v3.0",
"summary": "Mesmerize visualization package using fastplotlib",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/kushalkolar/mesmerize-viz"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "803e16e9a722ee6bc0f9cf05ec024dfe59d17450d3d596c8fc391f0dad67a157",
"md5": "35eef82a032a7350519bf5f0e9630e49",
"sha256": "4bd389fa8391e5384590c86acb6865b09482d6b16300b6dde4e69c05047fe5fe"
},
"downloads": -1,
"filename": "mesmerize_viz-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "35eef82a032a7350519bf5f0e9630e49",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 30379,
"upload_time": "2024-04-14T00:01:22",
"upload_time_iso_8601": "2024-04-14T00:01:22.351911Z",
"url": "https://files.pythonhosted.org/packages/80/3e/16e9a722ee6bc0f9cf05ec024dfe59d17450d3d596c8fc391f0dad67a157/mesmerize_viz-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "36c48d915541afc141a54a7b558bc5ba22a83eec8574ba6314e3136bac323ee7",
"md5": "3152944fba2577d8652340028b7b4f32",
"sha256": "a2ed2fe13ab2f24793e9641e8276b1e43179bb67574a46a648efdaab37ce551c"
},
"downloads": -1,
"filename": "mesmerize_viz-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "3152944fba2577d8652340028b7b4f32",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 30510,
"upload_time": "2024-04-14T00:01:24",
"upload_time_iso_8601": "2024-04-14T00:01:24.104219Z",
"url": "https://files.pythonhosted.org/packages/36/c4/8d915541afc141a54a7b558bc5ba22a83eec8574ba6314e3136bac323ee7/mesmerize_viz-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-14 00:01:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kushalkolar",
"github_project": "mesmerize-viz",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "mesmerize-viz"
}