Phase Retrieval With Application To Optical Imaging