Skip to content

Commit

Permalink
Merge pull request #19 from tlambert03/napari
Browse files Browse the repository at this point in the history
add napari plugin
  • Loading branch information
tlambert03 committed May 30, 2021
2 parents f18d035 + 9d9f419 commit a54e7cf
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
40 changes: 40 additions & 0 deletions pycudadecon/napari.py
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"}
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ license_file = LICENSE
classifiers =
Development Status :: 4 - Beta
Environment :: GPU :: NVIDIA CUDA
Framework :: napari
Intended Audience :: Science/Research
License :: OSI Approved :: MIT License
Natural Language :: English
Expand Down Expand Up @@ -41,6 +42,10 @@ python_requires = >=3.7
setup_requires =
setuptools_scm

[options.entry_points]
napari.plugin =
pycudadecon = pycudadecon.napari

[options.extras_require]
dev =
black
Expand Down

0 comments on commit a54e7cf

Please sign in to comment.