-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from tlambert03/napari
add napari plugin
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
""" | ||
This module is an example of a barebones QWidget plugin for napari | ||
It implements the ``napari_experimental_provide_dock_widget`` hook specification. | ||
see: https://napari.org/docs/dev/plugins/hook_specifications.html | ||
Replace code below according to your needs. | ||
""" | ||
from magicgui import magic_factory | ||
from napari_plugin_engine import napari_hook_implementation | ||
|
||
from napari.types import ImageData | ||
from pycudadecon.deconvolution import decon | ||
|
||
|
||
@magic_factory(call_button="Deconvolve") | ||
def deconvolve( | ||
image: ImageData, | ||
psf: ImageData, | ||
image_pixel_size=0.1, | ||
image_zstep=0.5, | ||
psf_pixel_size=0.1, | ||
psf_zstep=0.1, | ||
iterations=10, | ||
) -> ImageData: | ||
return decon( | ||
image, | ||
psf, | ||
dxdata=image_pixel_size, | ||
dzdata=image_zstep, | ||
dxpsf=psf_pixel_size, | ||
dzpsf=psf_zstep, | ||
n_iters=iterations, | ||
) | ||
|
||
|
||
@napari_hook_implementation | ||
def napari_experimental_provide_dock_widget(): | ||
# you can return either a single widget, or a sequence of widgets | ||
return deconvolve, {"name": "CUDA-Deconvolution"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters