Apparatus with interchangeable optical heads or interchangeable block of optics and detector