Partially changed to ImageStatistics