Request for Changes-30: Faster resampling filter

From OTBWiki
Jump to: navigation, search



This RFC introduces a new fast and scalable filter when resampling an image in the same geometry (i.e. only origin, spacing and size change).


StreamingResampleImageFilter is a good filter when resampling images with complex transforms. It supports streaming and multithreading, however when using very simple transforms such as IdentityTransform, it is quite ineficient and does not scale up very well with the number of threads. The itk::ResampleImageFilter behave better in this case, but it does not support streaming. The proposed class is faster than the ITK one and scales up perfectly.

Implementation details

Classes and files

New otb::GridResampleImageFilter class in Filtering/ImageManipulation module :

Some tips used to speed-up things:

  • This filter does not build and use instances of the Transform class
  • Fill buffer is multithreaded
  • No calls to the IsInside method, the region of computable pixels is computed beforehand
  • Use of itk::ImageScanLineIterator


BundleToPerfectSensor and Superimpose applications have been updated to use the new filter in PHR mode. RigidTransformResample has been updated to use the new filter in Identiy mode.


There is a test comparing output of this new filter to the output of the itk::ResampleImageFilter with an Identity transform and the same parameters:

The test does not read or write any image, it is self-contained.


Extensive doxygen documentation of the class.

Additional notes

Branch mantis-1153 has been merged to the grid-resampling branch because it adds some new tests that needed to be updated.