General resampling infrastructure
