ctdDecimate() takes user-supplied function