I wrote a pytorch GPU-accelerated 3d resampler a while back that uses catmull-rom spline interpolation

  
      gist.github.com
  
  
    https://gist.github.com/ajbrock/86fd41cf468839fe804ce28df145d170 267
resample3d.py
# Resample.py
# Andrew Brock, 2017
# This code resamples a 3d grid using catmull-rom spline interpolation, and is GPU accelerated.

# Resample along the trailing dimension
# Assumes a more-than-1D array? Or just directly assumes a 3D array? we'll find out
# 

# TODO: Some things could be shared (such as the mgrid call, which can presumably be done once? hmm)
#       between resample1d calls.
This file has been truncated. show original