Skip to main content

napari-generic-SIMulator

License BSD-3 PyPI Python Version tests codecov napari hub

A napari plugin to simulate raw-image stacks of Structured illumination microscopy (SIM).

The simulation is originally based on the paper GPU-accelerated real-time reconstruction in Python of three-dimensional datasets from structured illumination microscopy with hexagonal patterns 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.

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

    The two widgets can be tabbed together. raw

  3. Choose the type and other parameters of point cloud as a sample in Point cloud generator.

    raw

    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

    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

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.

Release files for napari-generic-SIMulator 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for napari-generic-SIMulator 0.1.3
File Size Uploaded
napari_generic_simulator-0.1.3.tar.gz 1.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for napari-generic-SIMulator 0.1.3
File Interpreter ABI Platform
napari_generic_SIMulator-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 1.5 MB

Release files / napari_generic_simulator-0.1.3.tar.gz

Download URL napari_generic_simulator-0.1.3.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
b3ab3d5cc0f5f958086d1b62fd0054ba9f2de5e0a89e63b5237a4273e8a3063c
BLAKE2b-256 checksum
How to use checksums
f23c9333bad9dfe1677055d4a27ca6540381439f55f3316441ee7830147e6c36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / napari_generic_SIMulator-0.1.3-py3-none-any.whl

Download URL napari_generic_SIMulator-0.1.3-py3-none-any.whl
Size 20.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8970ba51b210ef26a771be1c1a532a5d3941120d7ee0bc5ce3d45a153f3b9fe1
BLAKE2b-256 checksum
How to use checksums
e8d04d65abc922438461e2adc3f454d6940baa88a5b16a332134e0a51e8496c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.6

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.30

2 release files

0.0.29

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.19

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page