Infection prevention

A patient with respiratory symptoms wears a mask during a necessary trip to imaging. What is the main infection-prevention purpose of the patient's mask in this situation?