Lung imaging for titration of mechanical ventilation