Text this: Real-time spatiotemporal optimization during imaging