Integration with respect to the Euler characteristic and its applications