Skip to main content

CUDA-accelerated 3D affine transformations for Python

Project description

voltools

CUDA-accelerated numpy/cupy 3D affine transformations

Overview

Currently implemented:

  1. 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')
  1. 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)
  1. Various interpolations:
  • Interpolation.LINEAR, tri-linear interpolation
  • Interpolation.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

Project details


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.2-py3-none-any.whl (17.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page