A gamma ray collimator is a device used in nuclear medicine imaging to focus gamma rays onto a detector, improving image resolution by allowing only rays traveling in specific directions to reach the detector. By selectively blocking scattered rays, collimators enhance the clarity and diagnostic utility of images obtained in procedures like SPECT and PET scans.