Reinforcement learning for adaptive sampling in X-ray applications