A new generation of direct X-ray detectors for medical and synchrotron imaging applications