Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Need an efficient 3D resampling op (e.g. trilinear resampler) #239

Closed
tvercaut opened this issue Oct 9, 2018 · 2 comments
Closed

Need an efficient 3D resampling op (e.g. trilinear resampler) #239

tvercaut opened this issue Oct 9, 2018 · 2 comments

Comments

@tvercaut
Copy link
Member

tvercaut commented Oct 9, 2018

This issue mirrors and superseded the cmiclab issue 244.

From @eligibson :

The TF resampler is 2d only and inefficient. We should make one that is more efficient and get it into TF so that we can resample 3d images quickly. Preliminary tests suggest we should be able to get a 3 fold improvement over the current resampler just by naively adapting the 2d op to 3d, and another 3-fold improvement by implementing code from niftyreg (without using cuda texture sampling). @mmodat thinks a proper implementation could do even better than that.

Related Branch on cmiclab 244-resampler-op-3d

Two working prototypes are in the 244-resampler-op-3d branch along with testing code. They have been compiled and run on Ubuntu 14. Note that you do not need to recompile tensorflow to use these, but you do need to compile them against the tensorflow headers (as in https://cmiclab.cs.ucl.ac.uk/CMIC/NiftyNet/blob/244-resampler-op-3d/niftynet/contrib/resampler3d/resampler3d/gpu_compile.sh)

--
From @tvercaut :

For the record, this relates somehow to cmiclab issues #96 #169 and #173

Also, if we get a nice resampled, I would be in favour of pushing that upstream in TF to keep the need for compilation in NiftyNet to a minimum.

Note that there currently is a 2D GPU version of bilinear interpolation in tensorflow but @mmodat thinks it looks far from optimal:
https://www.tensorflow.org/api_docs/python/tf/contrib/resampler/resampler
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/resampler/kernels/resampler_ops_gpu.cu.cc

--
From @YipengHu :

backprop uses a lot of memory in our python implementation of the (3D) resampler. It may be worth looking at this in cuda/c as in the 2D implementation from tensorflow:
https://www.tensorflow.org/api_docs/python/tf/contrib/resampler/resampler

@stian-johnsen
Copy link
Collaborator

A NiftyReg-based solution to this issue can be found in the following pull request: #334

@ericspod
Copy link
Collaborator

We're planning to process through the pull requests so I'm going to mark this one as closed as #334 will address it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants