Pions in nuclear matter—an approach to the pion-nucleus optical potential