Abstract Two-photon microscopy is one of the fastest-growing methods of in-vivo imaging of the brain. It has the capability of imaging structures of the scale of 1 micrometer. At this scale the wavelength of the imaging field (usually near infra-red), is comparable to the size of the structures being imaged (e.g. neurons of the visual cortex). This scale relation makes the use of ray optics invalid. A better understanding is needed to predict the result of introducing different media into the light path, such as the coverslips protecting the optical window. We use Wolf’s integral, which is capable of fulfilling these needs without the shortcomings of ray optics. We predict the effects of aberrating media introduced into the light path and then correct the aberration using the same method. We also create a method to predict aberrations when the interfaces of the media in the light-path are not aligned with the propagation direction of the wavefront. This work leads to simple and cost-effective improvements in 2 photons neural imaging and contributes to understanding the anatomy and function of brain circuits, an important challenge under Obama’s B.R.A.I.N. initiative.