CUDA-accelerated 3D affine transformations for Python
Project description
voltools
CUDA-accelerated numpy/cupy 3D affine transformations
Overview
Currently implemented:
transforms
module that offers CUDA-accelerated affine transformations for cupy/numpy ndarrays.
import cupy as cp
from voltools import transform
volume = cp.random.random((200, 200, 200), dtype=cp.float32)
transformed_volume = transform(volume,
translation=(10, 0, -10),
rotation=(0, 45, 0), rotation_units='deg', rotation_order='rzxz')
StaticVolume
class optimized for multiple transformations of the same data. The data transfer is minimized to just the transformation matrix for each transformation.
import cupy as cp
from voltools import StaticVolume, Interpolations
volume = StaticVolume(cp.random.random((200, 200, 200), dtype=cp.float32), interpolation=Interpolations.FILT_BSPLINE)
for i in range(0, 180):
rotated_vol = volume.rotate(rotation=(0, i, 0), rotation_units='deg', rotation_order='rzxz', profile=True)
- Various interpolations:
Interpolation.LINEAR
, tri-linear interpolationInterpolation.BSPLINE
, cubic b-spline interpolation (optimized, 8 texture lookups)Interpolation.BSPLINE_SIMPLE
, cubic b-spline interpolation (simple implementation, 27 texture lookups)Interpolation.FILT_BSPLINE
, prefiltered cubic b-spline interpolation (8 texture lookups)Interpolation.FILT_BSPLINE_SIMPLE
, prefiltered cubic b-spline interpolation (27 texture lookups)
Installation
PIP: pip install voltools
Source: pip install git+https://github.com/the-lay/voltools
TODO
- Benchmarks
- FFT
- Tests
- Travis? Other CI?
- Visualizations?
- Return scripts: projections
- Develop branch for cleaner sepration of code
- Remove
_old
code
Notes
- CUDA cubic b-spline interpolation is based on Danny Ruijters's implementation
- Transformation matrices are based on Christoph Gohlike's transformations.py
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
voltools-0.1.3-py3-none-any.whl
(17.1 kB
view hashes)