A counting pixel chip and sensor system for X-ray imaging