2D perovskite-based high spatial resolution X-ray detectors