{"name":"pycudadecon","display_name":"pyCUDAdecon","visibility":"public","icon":"","categories":[],"schema_version":"0.2.0","on_activate":null,"on_deactivate":null,"contributions":{"commands":[{"id":"pycudadecon.deconvolve","title":"Deconvolve","python_name":"pycudadecon.napari:deconvolve","short_title":null,"category":null,"icon":null,"enablement":null}],"readers":null,"writers":null,"widgets":[{"command":"pycudadecon.deconvolve","display_name":"CUDA-Deconvolution","autogenerate":true}],"sample_data":null,"themes":null,"menus":{},"submenus":null,"keybindings":null,"configuration":[]},"package_metadata":{"metadata_version":"2.1","name":"pycudadecon","version":"0.4.1","dynamic":null,"platform":null,"supported_platform":null,"summary":"Python wrapper for CUDA-accelerated 3D deconvolution","description":"# pyCUDAdecon\n\nThis package provides a python wrapper and convenience functions for\n[cudaDecon](https://github.com/scopetools/cudaDecon), which is a CUDA/C++\nimplementation of an accelerated Richardson Lucy Deconvolution\nalgorithm1.\n\n* CUDA accelerated deconvolution with a handful of artifact-reducing features.\n* radially averaged OTF generation with interpolation for voxel size\n independence between PSF and data volumes\n* 3D deskew, rotation, general affine transformations\n* CUDA-based camera-correction for [sCMOS artifact correction](https://llspy.readthedocs.io/en/latest/camera.html)\n\n\n### Install\n\nThe conda package includes the required pre-compiled libraries for Windows and Linux. See GPU driver requirements [below](#gpu-requirements)\n\n```sh\nconda install -c conda-forge pycudadecon\n```\n\n*macOS is not supported*\n\n### 📖   [Documentation](http://www.talleylambert.com/pycudadecon)\n\n\n### GPU requirements\n\nThis software requires a CUDA-compatible NVIDIA GPU. The underlying cudadecon\nlibraries have been compiled against different versions of the CUDA toolkit.\nThe required CUDA libraries are bundled in the conda distributions so you don't\nneed to install the CUDA toolkit separately. If desired, you can pick which\nversion of CUDA you'd like based on your needs, but please note that different\nversions of the CUDA toolkit have different GPU driver requirements:\n\nTo specify a specific cudatoolkit version, install as follows (for instance, to\nuse `cudatoolkit=10.2`)\n\n```sh\nconda install -c conda-forge pycudadecon cudatoolkit=10.2\n```\n\n| CUDA | Linux driver | Win driver |\n| ---- | ------------ | ---------- |\n| 10.2 | ≥ 440.33 | ≥ 441.22 |\n| 11.0 | ≥ 450.36.06 | ≥ 451.22 |\n| 11.1 | ≥ 455.23 | ≥ 456.38 |\n| 11.2 | ≥ 460.27.03 | ≥ 460.82 |\n\n\nIf you run into trouble, feel free to [open an\nissue](https://github.com/tlambert03/pycudadecon/issues) and describe your\nsetup.\n\n\n## Usage\n\n\nThe [`pycudadecon.decon()`](https://www.talleylambert.com/pycudadecon/deconvolution.html#pycudadecon.decon) function is designed be able to handle most basic applications:\n\n```python\nfrom pycudadecon import decon\n\n# pass filenames of an image and a PSF\nresult = decon('/path/to/3D_image.tif', '/path/to/3D_psf.tif')\n\n# decon also accepts numpy arrays\nresult = decon(img_array, psf_array)\n\n# the image source can also be a sequence of arrays or paths\nresult = decon([img_array, '/path/to/3D_image.tif'], psf_array)\n\n# see docstrings for additional parameter options\n```\n\nFor finer-tuned control, you may wish to make an OTF file from your PSF using [`pycudadecon.make_otf()`](https://www.talleylambert.com/pycudadecon/otf.html#pycudadecon.make_otf), and then use the [`pycudadecon.RLContext`](https://www.talleylambert.com/pycudadecon/deconvolution.html#pycudadecon.RLContext) context manager to setup the GPU for use with the [`pycudadecon.rl_decon()`](https://www.talleylambert.com/pycudadecon/deconvolution.html#pycudadecon.rl_decon) function. (Note all images processed in the same context must have the same input shape).\n\n```python\nfrom pycudadecon import RLContext, rl_decon\nfrom glob import glob\nimport tifffile\n\nimage_folder = '/path/to/some_images/'\nimlist = glob(image_folder + '*488*.tif')\notf_path = '/path/to/pregenerated_otf.tif'\n\nwith tifffile.TiffFile(imlist[0]) as tf:\n imshape = tf.series[0].shape\n\nwith RLContext(imshape, otf_path, dz) as ctx:\n for impath in imlist:\n image = tifffile.imread(impath)\n result = rl_decon(image, ctx.out_shape)\n # do something with result...\n```\n\nIf you have a 3D PSF volume, the [`pycudadecon.TemporaryOTF`](https://www.talleylambert.com/pycudadecon/otf.html#pycudadecon.TemporaryOTF) context manager facilitates temporary OTF generation...\n\n```python\n # continuing with the variables from the previous example...\n psf_path = \"/path/to/psf_3D.tif\"\n with TemporaryOTF(psf) as otf:\n with RLContext(imshape, otf.path, dz) as ctx:\n for impath in imlist:\n image = tifffile.imread(impath)\n result = rl_decon(image, ctx.out_shape)\n # do something with result...\n```\n\n... and that bit of code is essentially what the [`pycudadecon.decon()`](https://www.talleylambert.com/pycudadecon/deconvolution.html#pycudadecon.decon) function is doing, with a little bit of additional conveniences added in.\n\n*Each of these functions has many options and accepts multiple keyword arguments. See the [documentation](https://www.talleylambert.com/pycudadecon/index.html) for further information on the respective functions.*\n\nFor examples and information on affine transforms, volume rotations, and deskewing (typical of light sheet volumes acquired with stage-scanning), see the [documentation on Affine Transformations](https://www.talleylambert.com/pycudadecon/affine.html)\n___\n\n1 D.S.C. Biggs and M. Andrews, Acceleration of iterative image restoration algorithms, Applied Optics, Vol. 36, No. 8, 1997. https://doi.org/10.1364/AO.36.001766\n","description_content_type":"text/markdown","keywords":"deconvolution,microscopy,CUDA","home_page":null,"download_url":null,"author":null,"author_email":"Talley Lambert ","maintainer":null,"maintainer_email":null,"license":"MIT","classifier":["Development Status :: 4 - Beta","Environment :: GPU :: NVIDIA CUDA","Framework :: napari","Intended Audience :: Science/Research","License :: OSI Approved :: MIT License","Programming Language :: Python :: 3","Programming Language :: Python :: 3.7","Programming Language :: Python :: 3.8","Programming Language :: Python :: 3.9","Programming Language :: Python :: 3.10","Programming Language :: Python :: 3.11","Topic :: Scientific/Engineering"],"requires_dist":["numpy","tifffile","typing-extensions","importlib-metadata ; python_version < \"3.8\"","black ; extra == 'dev'","ipython ; extra == 'dev'","mypy ; extra == 'dev'","pdbpp ; extra == 'dev'","pre-commit ; extra == 'dev'","rich ; extra == 'dev'","jupyter-book ==0.13.1 ; extra == 'docs'","ghp-import ==2.1.0 ; extra == 'docs'","sphinx-autodoc-typehints ==1.19.1 ; extra == 'docs'","furo ==2022.9.29 ; extra == 'docs'","pytest >=6.0 ; extra == 'test'","pytest-cov ; extra == 'test'"],"requires_python":">=3.7","requires_external":null,"project_url":["Documentation, https://pycudadecon.readthedocs.io/en/latest/","Source, https://github.com/tlambert03/pycudadecon","Tracker, https://github.com/tlambert03/pycudadecon/issues"],"provides_extra":["dev","docs","test"],"provides_dist":null,"obsoletes_dist":null},"npe1_shim":false}