Name | pycudadecon JSON |
Version |
0.5.0
JSON |
| download |
home_page | None |
Summary | Python wrapper for CUDA-accelerated 3D deconvolution |
upload_time | 2024-08-15 14:37:59 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT |
keywords |
cuda
deconvolution
microscopy
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# pyCUDAdecon
This package provides a python wrapper and convenience functions for
[cudaDecon](https://github.com/scopetools/cudaDecon), which is a CUDA/C++
implementation of an accelerated Richardson Lucy Deconvolution
algorithm<sup>1</sup>.
* CUDA accelerated deconvolution with a handful of artifact-reducing features.
* radially averaged OTF generation with interpolation for voxel size
independence between PSF and data volumes
* 3D deskew, rotation, general affine transformations
* CUDA-based camera-correction for [sCMOS artifact correction](https://llspy.readthedocs.io/en/latest/camera.html)
### Install
The conda package includes the required pre-compiled libraries for Windows and Linux. See GPU driver requirements [below](#gpu-requirements)
```sh
conda install -c conda-forge pycudadecon
```
*macOS is not supported*
### 📖 [Documentation](http://www.talleylambert.com/pycudadecon)
### GPU requirements
This software requires a CUDA-compatible NVIDIA GPU. The underlying cudadecon
libraries have been compiled against different versions of the CUDA toolkit.
The required CUDA libraries are bundled in the conda distributions so you don't
need to install the CUDA toolkit separately. If desired, you can pick which
version of CUDA you'd like based on your needs, but please note that different
versions of the CUDA toolkit have different GPU driver requirements:
To specify a specific cudatoolkit version, install as follows (for instance, to
use `cudatoolkit=10.2`)
```sh
conda install -c conda-forge pycudadecon cudatoolkit=10.2
```
| CUDA | Linux driver | Win driver |
| ---- | ------------ | ---------- |
| 10.2 | ≥ 440.33 | ≥ 441.22 |
| 11.0 | ≥ 450.36.06 | ≥ 451.22 |
| 11.1 | ≥ 455.23 | ≥ 456.38 |
| 11.2 | ≥ 460.27.03 | ≥ 460.82 |
If you run into trouble, feel free to [open an
issue](https://github.com/tlambert03/pycudadecon/issues) and describe your
setup.
## Usage
The [`pycudadecon.decon()`](https://www.talleylambert.com/pycudadecon/deconvolution.html#pycudadecon.decon) function is designed be able to handle most basic applications:
```python
from pycudadecon import decon
# pass filenames of an image and a PSF
result = decon('/path/to/3D_image.tif', '/path/to/3D_psf.tif')
# decon also accepts numpy arrays
result = decon(img_array, psf_array)
# the image source can also be a sequence of arrays or paths
result = decon([img_array, '/path/to/3D_image.tif'], psf_array)
# see docstrings for additional parameter options
```
For 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).
```python
from pycudadecon import RLContext, rl_decon
from glob import glob
import tifffile
image_folder = '/path/to/some_images/'
imlist = glob(image_folder + '*488*.tif')
otf_path = '/path/to/pregenerated_otf.tif'
with tifffile.TiffFile(imlist[0]) as tf:
imshape = tf.series[0].shape
with RLContext(imshape, otf_path, dz) as ctx:
for impath in imlist:
image = tifffile.imread(impath)
result = rl_decon(image, ctx.out_shape)
# do something with result...
```
If you have a 3D PSF volume, the [`pycudadecon.TemporaryOTF`](https://www.talleylambert.com/pycudadecon/otf.html#pycudadecon.TemporaryOTF) context manager facilitates temporary OTF generation...
```python
# continuing with the variables from the previous example...
psf_path = "/path/to/psf_3D.tif"
with TemporaryOTF(psf) as otf:
with RLContext(imshape, otf.path, dz) as ctx:
for impath in imlist:
image = tifffile.imread(impath)
result = rl_decon(image, ctx.out_shape)
# do something with result...
```
... 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.
*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.*
For 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)
___
<sup>1</sup> 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
Raw data
{
"_id": null,
"home_page": null,
"name": "pycudadecon",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "CUDA, deconvolution, microscopy",
"author": null,
"author_email": "Talley Lambert <talley.lambert@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/14/64/157a2d441822322bad090852b63dbdcb046160bbf9e48684c0cc3d5cc976/pycudadecon-0.5.0.tar.gz",
"platform": null,
"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\nalgorithm<sup>1</sup>.\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### \ud83d\udcd6 [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 | \u2265 440.33 | \u2265 441.22 |\n| 11.0 | \u2265 450.36.06 | \u2265 451.22 |\n| 11.1 | \u2265 455.23 | \u2265 456.38 |\n| 11.2 | \u2265 460.27.03 | \u2265 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\n<sup>1</sup> 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",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python wrapper for CUDA-accelerated 3D deconvolution",
"version": "0.5.0",
"project_urls": {
"Documentation": "https://tlambert03.github.io/pycudadecon/",
"Source": "https://github.com/tlambert03/pycudadecon",
"Tracker": "https://github.com/tlambert03/pycudadecon/issues"
},
"split_keywords": [
"cuda",
" deconvolution",
" microscopy"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bf13701255c06a89d5033067f34f9742ef75b93f7c918c997d7b5bd24a96f5dd",
"md5": "39b751aeaf9ccd3e58f2210fb3e99d67",
"sha256": "6b47fca2d0e9f57439d245166c65f6b56b486fac14ceb69df7aa5513c13bbe6c"
},
"downloads": -1,
"filename": "pycudadecon-0.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "39b751aeaf9ccd3e58f2210fb3e99d67",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 22908,
"upload_time": "2024-08-15T14:37:57",
"upload_time_iso_8601": "2024-08-15T14:37:57.346212Z",
"url": "https://files.pythonhosted.org/packages/bf/13/701255c06a89d5033067f34f9742ef75b93f7c918c997d7b5bd24a96f5dd/pycudadecon-0.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1464157a2d441822322bad090852b63dbdcb046160bbf9e48684c0cc3d5cc976",
"md5": "943b9fcabbd091375e367f26551aa760",
"sha256": "e9d67bab6253cd7c2d416fe9e4aba2e2a818b728bb0ba29f4759d1f0dcfc3cef"
},
"downloads": -1,
"filename": "pycudadecon-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "943b9fcabbd091375e367f26551aa760",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 52352864,
"upload_time": "2024-08-15T14:37:59",
"upload_time_iso_8601": "2024-08-15T14:37:59.344898Z",
"url": "https://files.pythonhosted.org/packages/14/64/157a2d441822322bad090852b63dbdcb046160bbf9e48684c0cc3d5cc976/pycudadecon-0.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-15 14:37:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tlambert03",
"github_project": "pycudadecon",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pycudadecon"
}