# napari-generic-SIMulator
[![License BSD-3](https://img.shields.io/pypi/l/napari-generic-SIMulator.svg?color=green)](https://github.com/Meizhu-Liang/napari-generic-SIMulator/raw/main/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/napari-generic-SIMulator.svg?color=green)](https://pypi.org/project/napari-generic-SIMulator)
[![Python Version](https://img.shields.io/pypi/pyversions/napari-generic-SIMulator.svg?color=green)](https://python.org)
[![tests](https://github.com/Meizhu-Liang/napari-generic-SIMulator/workflows/tests/badge.svg)](https://github.com/Meizhu-Liang/napari-generic-SIMulator/actions)
[![codecov](https://codecov.io/gh/Meizhu-Liang/napari-generic-SIMulator/branch/main/graph/badge.svg)](https://codecov.io/gh/Meizhu-Liang/napari-generic-SIMulator)
[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-generic-SIMulator)](https://napari-hub.org/plugins/napari-generic-SIMulator)
A napari plugin to simulate raw-image stacks of Structured illumination microscopy (SIM).
The simulation is originally based on the paper <strong>GPU-accelerated real-time reconstruction in Python of three-dimensional datasets from structured illumination microscopy with hexagonal patterns</strong> by
Hai Gong, Wenjun Guo and Mark A. A. Neil (https://doi.org/10.1098/rsta.2020.0162).
The calculation can be GPU-accelerated if the CUPY (tested with cupy-cuda11x) is installed. In addition, the TORCH package can complete the acceleration both on CPU if TORCH is installed, and on GPU if TORCH is compiled with the CUDA (tested with torch v1.13.1+cu117) enabled.
Currently applies to:
- conventional 2-beam SIM data with 3 angles and 3 phases
- 3-beam hexagonal SIM data with 7 phases, as described in the paper
- 3-beam hexagonal SIM data with 5 phases at right-angles
- conventional 3-beam 3-D data with 3 angles and 5 phases
----------------------------------
This [napari] plugin was generated with [Cookiecutter] using [@napari]'s [cookiecutter-napari-plugin] template.
<!--
Don't miss the full getting started guide to set up your new package:
https://github.com/napari/cookiecutter-napari-plugin#getting-started
and review the napari docs for plugin developers:
https://napari.org/plugins/index.html
-->
## Installation
You can install `napari-generic-SIMulator` via [pip]:
pip install napari-generic-SIMulator
To install latest development version :
pip install git+https://github.com/Meizhu-Liang/napari-generic-SIMulator.git
This plugin is compatible with **napari 0.4.17** or above, older versions of napari would show errors in _interpolation_.
## Usage
1) Open napari and create the viewer.
2) Launch two widgets: **Point cloud generator** and **SIM data generator** in ***Plugin***.
![raw](https://github.com/Meizhu-Liang/napari-generic-SIMulator/raw/main/images/lauch.png)
The two widgets can be tabbed together.
![raw](https://github.com/Meizhu-Liang/napari-generic-SIMulator/raw/main/images/2tabs.png)
3) Choose the type and other parameters of point cloud as a sample in **Point cloud generator**.
![raw](https://github.com/Meizhu-Liang/napari-generic-SIMulator/raw/main/images/pc.png)
The point cloud can be displayed in three dimensions, and be saved and loaded as .pcd files.
https://user-images.githubusercontent.com/74197598/227589232-9006842b-6706-48b7-9f2b-fe93c6698503.mp4
4) Adjust parameters in SIM data generator to simulate a raw image stack.
Apart from basic parameters such as the refractive index, the wavelengths and so on, the z scanning can be either
**z drift**: the conventional SIM (imaging a raw stack at the same z-position) or **z step**: the drifting case in
the papaer mentioned above (imaging only one raw image at a z-position).
![raw](https://github.com/Meizhu-Liang/napari-generic-SIMulator/raw/main/images/raw_stack.png)
The parameters used in the simulation can be saved with the image stack by clicking **save tif with tags**. Tags (of current or of one stack dragged into napari viewer) can be printed in Python by **print tags**.
5) Three-dimensional point spread function (**PSF**), optical transfer function (**OTF**) and **illumination** patterns applied in the simulation can be showed by buttons. Note the all of these correspond the generated raw-image stack, so keep the parameters the same before showing the **PSF** (or **OTF** and **illumination**).
https://user-images.githubusercontent.com/74197598/227588321-ad3c8f17-1c61-4079-9e34-9b1f990714c1.mp4
https://user-images.githubusercontent.com/74197598/227586957-b76ad56e-44d5-4d9b-a1cc-2cfd08ca5400.mp4
https://user-images.githubusercontent.com/74197598/227585827-64531265-b4fb-48a9-9698-7f263f22d718.mp4
6) The raw image stacks can be then processed by napari-sim-processor (https://www.napari-hub.org/plugins/napari-sim-processor).
![raw](https://github.com/Meizhu-Liang/napari-generic-SIMulator/raw/main/images/processor.png)
## Contributing
Contributions are very welcome. Tests can be run with [tox], please ensure
the coverage at least stays the same before you submit a pull request.
## License
Distributed under the terms of the [BSD-3] license,
"napari-generic-SIMulator" is free and open source software
## Issues
If you encounter any problems, please [file an issue] along with a detailed description.
[napari]: https://github.com/napari/napari
[Cookiecutter]: https://github.com/audreyr/cookiecutter
[@napari]: https://github.com/napari
[MIT]: http://opensource.org/licenses/MIT
[BSD-3]: http://opensource.org/licenses/BSD-3-Clause
[GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt
[GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt
[Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0
[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt
[cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin
[file an issue]: https://github.com/Meizhu-Liang/napari-generic-SIMulator/issues
[napari]: https://github.com/napari/napari
[tox]: https://tox.readthedocs.io/en/latest/
[pip]: https://pypi.org/project/pip/
[PyPI]: https://pypi.org/
Raw data
{
"_id": null,
"home_page": "https://github.com/Meizhu-Liang/napari-generic-SIMulator",
"name": "napari-generic-SIMulator",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "",
"author": "Meizhu Liang",
"author_email": "ml2618@ic.ac.uk",
"download_url": "https://files.pythonhosted.org/packages/66/74/ba6a5faf55997ebacf827787ce180bc7999b6678ebded248cbb8e337ea6b/napari-generic-SIMulator-0.1.2.tar.gz",
"platform": null,
"description": "# napari-generic-SIMulator\n\n[![License BSD-3](https://img.shields.io/pypi/l/napari-generic-SIMulator.svg?color=green)](https://github.com/Meizhu-Liang/napari-generic-SIMulator/raw/main/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/napari-generic-SIMulator.svg?color=green)](https://pypi.org/project/napari-generic-SIMulator)\n[![Python Version](https://img.shields.io/pypi/pyversions/napari-generic-SIMulator.svg?color=green)](https://python.org)\n[![tests](https://github.com/Meizhu-Liang/napari-generic-SIMulator/workflows/tests/badge.svg)](https://github.com/Meizhu-Liang/napari-generic-SIMulator/actions)\n[![codecov](https://codecov.io/gh/Meizhu-Liang/napari-generic-SIMulator/branch/main/graph/badge.svg)](https://codecov.io/gh/Meizhu-Liang/napari-generic-SIMulator)\n[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-generic-SIMulator)](https://napari-hub.org/plugins/napari-generic-SIMulator)\n\nA napari plugin to simulate raw-image stacks of Structured illumination microscopy (SIM). \n\nThe simulation is originally based on the paper <strong>GPU-accelerated real-time reconstruction in Python of three-dimensional datasets from structured illumination microscopy with hexagonal patterns</strong> by\nHai Gong, Wenjun Guo and Mark A. A. Neil (https://doi.org/10.1098/rsta.2020.0162). \n\nThe calculation can be GPU-accelerated if the CUPY (tested with cupy-cuda11x) is installed. In addition, the TORCH package can complete the acceleration both on CPU if TORCH is installed, and on GPU if TORCH is compiled with the CUDA (tested with torch v1.13.1+cu117) enabled.\n\nCurrently applies to:\n- conventional 2-beam SIM data with 3 angles and 3 phases\n- 3-beam hexagonal SIM data with 7 phases, as described in the paper\n- 3-beam hexagonal SIM data with 5 phases at right-angles\n- conventional 3-beam 3-D data with 3 angles and 5 phases\n\n----------------------------------\n\nThis [napari] plugin was generated with [Cookiecutter] using [@napari]'s [cookiecutter-napari-plugin] template.\n\n<!--\nDon't miss the full getting started guide to set up your new package:\nhttps://github.com/napari/cookiecutter-napari-plugin#getting-started\n\nand review the napari docs for plugin developers:\nhttps://napari.org/plugins/index.html\n-->\n\n## Installation\n\nYou can install `napari-generic-SIMulator` via [pip]:\n\n pip install napari-generic-SIMulator\n\n\n\nTo install latest development version :\n\n pip install git+https://github.com/Meizhu-Liang/napari-generic-SIMulator.git\n\nThis plugin is compatible with **napari 0.4.17** or above, older versions of napari would show errors in _interpolation_.\n\n## Usage\n\n1) Open napari and create the viewer.\n\n\n2) Launch two widgets: **Point cloud generator** and **SIM data generator** in ***Plugin***.\n\n ![raw](https://github.com/Meizhu-Liang/napari-generic-SIMulator/raw/main/images/lauch.png)\n\n The two widgets can be tabbed together.\n ![raw](https://github.com/Meizhu-Liang/napari-generic-SIMulator/raw/main/images/2tabs.png)\n\n\n3) Choose the type and other parameters of point cloud as a sample in **Point cloud generator**.\n\n ![raw](https://github.com/Meizhu-Liang/napari-generic-SIMulator/raw/main/images/pc.png)\n\n The point cloud can be displayed in three dimensions, and be saved and loaded as .pcd files.\n \n https://user-images.githubusercontent.com/74197598/227589232-9006842b-6706-48b7-9f2b-fe93c6698503.mp4\n\n\n4) Adjust parameters in SIM data generator to simulate a raw image stack.\n\n Apart from basic parameters such as the refractive index, the wavelengths and so on, the z scanning can be either \n **z drift**: the conventional SIM (imaging a raw stack at the same z-position) or **z step**: the drifting case in \n the papaer mentioned above (imaging only one raw image at a z-position).\n\n\n ![raw](https://github.com/Meizhu-Liang/napari-generic-SIMulator/raw/main/images/raw_stack.png)\n\n The parameters used in the simulation can be saved with the image stack by clicking **save tif with tags**. Tags (of current or of one stack dragged into napari viewer) can be printed in Python by **print tags**. \n\n\n5) Three-dimensional point spread function (**PSF**), optical transfer function (**OTF**) and **illumination** patterns applied in the simulation can be showed by buttons. Note the all of these correspond the generated raw-image stack, so keep the parameters the same before showing the **PSF** (or **OTF** and **illumination**).\n\n https://user-images.githubusercontent.com/74197598/227588321-ad3c8f17-1c61-4079-9e34-9b1f990714c1.mp4\n \n https://user-images.githubusercontent.com/74197598/227586957-b76ad56e-44d5-4d9b-a1cc-2cfd08ca5400.mp4\n \n https://user-images.githubusercontent.com/74197598/227585827-64531265-b4fb-48a9-9698-7f263f22d718.mp4 \n \n6) The raw image stacks can be then processed by napari-sim-processor (https://www.napari-hub.org/plugins/napari-sim-processor).\n \n ![raw](https://github.com/Meizhu-Liang/napari-generic-SIMulator/raw/main/images/processor.png)\n\n\n## Contributing\n\nContributions are very welcome. Tests can be run with [tox], please ensure\nthe coverage at least stays the same before you submit a pull request.\n\n## License\n\nDistributed under the terms of the [BSD-3] license,\n\"napari-generic-SIMulator\" is free and open source software\n\n## Issues\n\nIf you encounter any problems, please [file an issue] along with a detailed description.\n\n[napari]: https://github.com/napari/napari\n[Cookiecutter]: https://github.com/audreyr/cookiecutter\n[@napari]: https://github.com/napari\n[MIT]: http://opensource.org/licenses/MIT\n[BSD-3]: http://opensource.org/licenses/BSD-3-Clause\n[GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt\n[GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt\n[Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0\n[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt\n[cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin\n\n[file an issue]: https://github.com/Meizhu-Liang/napari-generic-SIMulator/issues\n\n[napari]: https://github.com/napari/napari\n[tox]: https://tox.readthedocs.io/en/latest/\n[pip]: https://pypi.org/project/pip/\n[PyPI]: https://pypi.org/\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "A napari plugin to simulate raw-image stacks of Structured illumination microscopy (SIM).",
"version": "0.1.2",
"project_urls": {
"Bug Tracker": "https://github.com/Meizhu-Liang/napari-generic-SIMulator/issues",
"Documentation": "https://github.com/Meizhu-Liang/napari-generic-SIMulator#README.md",
"Homepage": "https://github.com/Meizhu-Liang/napari-generic-SIMulator",
"Source Code": "https://github.com/Meizhu-Liang/napari-generic-SIMulator",
"User Support": "https://github.com/Meizhu-Liang/napari-generic-SIMulator/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6b64cb69625dc12eb733404e85dc98f6ddcd247f2092b476265f616ef46748d2",
"md5": "1c617ff781734dde38075abeb4d62eb1",
"sha256": "d335a72c9a7b797ecb700a6a6f62762128a850c1844805d8374833ec577ef30d"
},
"downloads": -1,
"filename": "napari_generic_SIMulator-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1c617ff781734dde38075abeb4d62eb1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 20106,
"upload_time": "2023-09-25T20:49:05",
"upload_time_iso_8601": "2023-09-25T20:49:05.568858Z",
"url": "https://files.pythonhosted.org/packages/6b/64/cb69625dc12eb733404e85dc98f6ddcd247f2092b476265f616ef46748d2/napari_generic_SIMulator-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6674ba6a5faf55997ebacf827787ce180bc7999b6678ebded248cbb8e337ea6b",
"md5": "ad6413a07ae756b97403cf52d6e83586",
"sha256": "802c06577549c0efa3208819db41fa95b009b831e624fa5a856eddbbf8bf96bc"
},
"downloads": -1,
"filename": "napari-generic-SIMulator-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "ad6413a07ae756b97403cf52d6e83586",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 1451879,
"upload_time": "2023-09-25T20:49:07",
"upload_time_iso_8601": "2023-09-25T20:49:07.293380Z",
"url": "https://files.pythonhosted.org/packages/66/74/ba6a5faf55997ebacf827787ce180bc7999b6678ebded248cbb8e337ea6b/napari-generic-SIMulator-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-25 20:49:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Meizhu-Liang",
"github_project": "napari-generic-SIMulator",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "napari-generic-simulator"
}