A napari widget to process Structured Illumination Microscopy data with gpu acceleration
Project description
napari-sim-processor
A Napari plugin for the reconstruction of Structured Illumination Microscopy (SIM) with GPU acceleration (with pytorch, if installed). Currently supports:
- conventional SIM data for resolution improvement in 1D (1 angle, 3 phases)
- conventional SIM data for resolution improvement in 2D (3 angles, 3 phases)
- hexagonal SIM data for resolution improvement in 2D (7 phases).
The SIM processing widget accepts image stacks organized in 5D (angle
,phase
,z
,y
,x
).
A reshape widget is availbale, to easily reshape the data if they are organized differently than 5D (angle,phase,z,y,x)
Currently only square images are supported (x
=y
)
For raw image stacks with multiple z-frames each plane is processed as described here: https://doi.org/10.1098/rsta.2020.0162
Support for N angles and M phases is in progress. Support for 3D SIM with enhanced resolution in all directions is not yet available. Multicolor reconstruction is not yet available.
This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.
Installation
You can install napari-sim-processor
via pip:
pip install napari-sim-processor
To install latest development version :
pip install git+https://github.com/andreabassi78/napari-sim-processor.git
Usage
-
Open napari.
-
Launch the reshape and sim-processor widgets.
-
Open your raw image stack (using the napari built-in or your own file openers).
-
If your image is ordered as a 5D stack (angle, phase, z-frame, y, x) go to point 4.
-
In the reshape widget, select the actual number of acquired angles, phases, and frames (red arrow) and press
Reshape Stack
. Note that the label axis of the viewer will be updated (green arrow).
-
In the sim-reconstruction widget press the Select image layer button. Note that the number of phases and angles will be updated (blue arrow).
-
Choose the correct parameters of the SIM acquisition (
NA
,pixelsize
,M
, etc.) and processing parameters (alpha
,beta
, w,eta
,group
):w
: parameter of the Weiner filter.eta
: constant used for calibration. It should be slightly smaller than the carrier frequency (in pupil radius units).group
: for stacks with multiple z-frames, it is the number of frames that are used together for the calibration process.
For details on the other parameters see https://doi.org/10.1098/rsta.2020.0162.
-
Calibrate the SIM processor, pressing the
Calibrate
button. This will find the carrier frequencies (red circles if theShow Carrier
checkbox is selected), the modulation amplitude and the phase, using cross correlation analysis. -
Click on the checkboxes to show the power spectrum of the raw image (
Show power spectrum
) or the cross-correlation (Show Xcorr
), to see if the found carrier frequency is correct.
Napari viewer showing the power spectrum of the raw stack. The pupil circle is in blue. A circle corresponding to eta
is shown in green.
Napari viewer showing the cross-correlation of the raw stack. The red circles indicate the found carrier frequencies
- Run the reconstruction of a single plane (
SIM reconstruction
) or of a stack (Stack reconstruction
). After execution, a new image_layer will be added to the napari viewer. Click on theBatch reconstruction
checkbox in order to process an entire stack in one shot. Click on the pytorch checkbox for gpu acceleration.
Napari viewer with widgets showing a pseudo-widefield reconstruction
Napari viewer with widgets showing a SIM reconstruction
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-sim-processor" is free and open source software
Issues
If you encounter any problems, please file an issue along with a detailed description.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for napari-sim-processor-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7e6c84947f6d818fbfb149f3ae4055aceb6a0d4cd73c6fdf76268a3b41153c9 |
|
MD5 | d572f6fa6e8bf2ce0455a53fb02c70fb |
|
BLAKE2b-256 | 8f143c821a4b0f6005fb915a9f9a4d4262342b8f1be7e47086eeb8fbe9cb6413 |
Hashes for napari_sim_processor-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b307a8d98777be3b325fcfa82b150eb94202d67a9fcd609077ee637e78c94e35 |
|
MD5 | b618b99a25b4275e9bcd79f7b8e9da66 |
|
BLAKE2b-256 | c4bea030427fd3751f84b4cf54f780ad06798aedc907aafb027adbaaf4a9f1f7 |