## 1.

## Introduction

Many important biological processes take place inside the cranial bone marrow or just beyond the cranial bone in the brain. Multiphoton excitation microscopy has the potential to acquire deep tissue optical sectioned images with minimal damage in highly scattering media at depths greater than $150\text{\hspace{0.17em}\hspace{0.17em}}\mu \mathrm{m}$.^{1}2.3.4.5.^{–}^{6} This potential has led to widespread use in the bone biology and neuroscience fields. Two-photon microscopy commonly exploits light with longer wavelengths in optimal windows for *in vivo* tissue imaging (near-IR and IR) with reduced Rayleigh scattering and absorbance to penetrate deeper inside biological tissue; but nonhomogeneous wave propagation through highly scattering turbid media, such as bone, dramatically reduces image resolution even at moderate depths of $\sim 100\text{\hspace{0.17em}\hspace{0.17em}}\mu \mathrm{m}$. In bone, layers of varying refractive index and irregularities in the shape of the matrix produce scattering and refractive optical aberrations that induce phase deviations in the wavefront, which distort the point spread function (PSF) from a diffraction limited imaging system.^{7} A distorted optical wavefront causes the PSF size to increase and its maximum intensity to drop from the ideal, thereby reducing the precision and fidelity of the image.

Several techniques have been proposed to correct such distortions. Optical clearing increases the refractive index homogeneity of the aqueous media and has been effective for imaging collagen^{8} or more recently for a range of tissues using protocols, such as CLARITY.^{9} However, these techniques are only applicable to *ex vivo* experiments. For *in vivo* experiments, ablation and thinning of bone improve imaging quality in cranial bone or into the brain^{10}11.12.^{–}^{13} but induces a biological response to associated tissue damage. An attractive approach to increase imaging resolution in deep tissue for both *in vivo* and *ex vivo* imaging without tissue damage is the use of adaptive optics (AO) techniques for microscopy.

AO compensates for tissue-induced distortions using correction element(s) in combination with either a wavefront sensor or image-based sensorless wavefront estimation methods. Wavefront sensor approaches include Shack–Hartmann wavefront sensors with autofluorescent or near-IR guide stars,^{14}^{,}^{15} coherence gated wavefront sensing,^{16} and image-based methods that use information from acquired images to estimate the wavefront distortions.^{17}18.19.20.^{–}^{21} Wavefront sensorless approaches usually estimate an initial error and through an iterative scheme converge to an optimized solution based on metrics, such as total fluorescence intensity for confocal and two-photon microscopy.^{22}23.^{–}^{24} In other microscopy modalities, metrics such as maximum intensity of the image (or a part of the image),^{25} the low-frequency spatial content of the image, the image sharpness,^{26}27.^{–}^{28} and the Fourier metric^{29} have been used. To generate a corrected wavefront in all cases, a compensating optical element or elements are required; most commonly deformable mirrors (DM) are used. The correction attainable by a single DM depends on its pitch, number and stroke of actuators, and surface form (segmented or continuous facesheet). This functional characteristic of DMs makes them act as high-pass filters that primarily correct lower order aberrations. For correction of spatially confined high-order aberrations in biological tissues like bone, other technologies such as spatial light modulators (SLMs) or digital micromirror devices (DMDs)^{30}31.^{–}^{32} could potentially assist. They often contain hundreds or thousands of segments, but may have other limitations in response time or correction magnitude.

The most common method for correcting image aberrations for scanning microscopy modalities is by evaluating and compensating for tissue aberrations in multiple spots across the field of view. However, functional limitations tend to reduce the field of view to keep the acquisition and correction speeds reasonable.^{33}^{,}^{34} Recently, use of nonlinear guide stars with Shack–Hartmann measurements of wavefront aberrations averaged over a larger area has significantly expanded the corrected lateral field of view to several tens of microns.^{15}^{,}^{35} This pragmatic approach yields an accurate measurement of low-order tissue aberrations that has proven useful to extend imaging deep into biological samples, such as the brain.^{15} High-order aberrations and scattering that are prevalent in bone change with each focal point, so averaging aberrations from a larger area would limit correction. Therefore, in an alternative wavefront sensorless approach, the adaptive correction element is conjugated to the turbid layer instead of the focus, which improved imaging through bone for a cell-sized field of view.^{34} To design an AO approach that can effectively correct both low- and high-order aberrations for a larger biologically relevant field of view, it is necessary to characterize the aberrations present in bone, as well as to estimate what portion of those aberrations can be corrected with given deformable element characteristics.

Therefore, in this paper, we investigate the optical aberrations caused by mouse cranial bone. We characterize the bone with experimental data acquired using second-harmonic generation (SHG) imaging in collagen. We simulate the wave propagation in the sample and calculate the amount of wavefront error that can be corrected using a typical commercially available DM, and the residual wavefront error that remains. We further calculate the number of segments a potential second correcting element would require to remove the residual error. Previously, wavefront error measurements have been made in thin biological samples using transmission light microscopy.^{36}^{,}^{37} Theoretical^{38} models of wavefront errors in biological tissue have also been developed. Propagation of electromagnetics wave in biological tissues and cells can be simulated using methods, such as finite-difference time-domain modeling,^{39} Monte Carlo simulations,^{40} which model radiation transfer, or analytical models.^{41} Our work uses a combination of SHG measurements and an analytical approach to model propagation of light through thick sections of highly scattering and randomly structured sections of bone. This fast modeling approach can provide initial information on present optical aberrations for an AO two-photon imaging system, either in open-loop configuration or closed loop. We also calculate the statistics of the different Zernike modes across a large field of view. This work shows that AO correction with a high number of correcting segments could significantly improve resolution when imaging through intact mouse skull.

## 2.

## Methods

## 2.1.

### Theoretical Approach

SHG occurs in noncentrosymmetric crystals, due to redistribution of energy confined in a molecule by a high-energy excitatory laser pulse. This causes symmetric generation of dipole moments, and therefore a noncentrosymmetric polarization signal is produced in one direction. Collagen in bone has a crystalline triple-helix structure that can act as a harmonics generator, and hence frequency up-convertor of light.^{42} The polarization vector can be described in terms of the electric dipole expansion^{42}43.44.^{–}^{45}

^{43}The brackets indicate an orientation average. We also have the following ratio between relative permittivity ${\u03f5}_{r}$ and the molecular characteristics of the material

By combining Eqs. (2)–(4) and the relation $n=\sqrt{{\u03f5}_{r}}$, we can express a relation for the refractive index in terms of the SHG signal and laser input energy in the form

We introduce a new parameter ${k}_{1}=1/({I}_{\omega}\sqrt{{\tau}_{l}/{\tau}_{p}})$, and since ${k}_{1}\sqrt{{I}_{2\omega}}$ is a small number, we can use the first-order Taylor expansion

Now to account for the proportionality, we substitute an experimentally determined constant for ${k}_{1}/2$. We use the background intensity ${I}_{b}$ (5% of maximum intensity ${I}_{\mathrm{max}}$) as a threshold between the SHG signal from the bone and the surrounding medium. The intensities above the threshold are scaled within a range starting from the lower limit of the bone refractive indices ${n}_{\mathrm{min}}$ and up to ${n}_{\mathrm{max}}$—which corresponds to ${I}_{\mathrm{max}}$—and for lower intensities, we assign the refractive index of the immersion medium ${n}_{b}$

## (7)

$$n=\{\begin{array}{cc}{k}_{2}\sqrt{{I}_{2\omega}-{I}_{b}}+{n}_{\mathrm{min}}& I>{I}_{b}\\ {n}_{b}& \text{otherwise}\end{array}.$$Since the intensity of the illumination light is affected by absorption and scattering, we normalize the collected signal intensity for the depth using Beer’s law^{46}

^{47}

^{,}

^{48}We acquired three-dimensional (3-D) images of bone using

*in vivo*SHG imaging in the cranial bone from a 3-week-old male wild-type mouse. Each $Z$ slice was produced by averaging 15 frames to increase signal-to-noise ratio. Each SHG image consists of $256\times 256\text{\hspace{0.17em}\hspace{0.17em}}\text{pixels}$ across a $320\text{\hspace{0.17em}}\mu \mathrm{m}\times 320\text{\hspace{0.17em}}\mu \mathrm{m}$ field of view. To account for anisotropy of the SHG signal due to fiber orientation in the bone, we acquired stacks of images with transverse polarizations of the input laser ranging from 0 deg to 180 deg at intervals of 15 deg. We used the dataset with the highest average intensity as the input for our simulations. The scaled dataset is shown in Figs. 1(a)–1(c); the average thickness of the sample is $80\text{\hspace{0.17em}\hspace{0.17em}}\mu \mathrm{m}$. A range of indices of refraction from 1.528 to 1.604 with an average of 1.564 was used for the mouse cranial bone,

^{49}and a refractive index of 1.33 was used for the ${n}_{b}$ of the immersion medium.

## 2.2.

### Optical Setup

Our two-photon microscope is a home-built setup based on our previous efforts^{10} and an open-source design.^{50} A 1550-nm, 370-femtosecond pulsed fiber laser (Calmar Cazadero) with repetition rate of 10 MHz was used. The beam was frequency doubled with an SHG crystal (Newlight Photonics) to produce a 775-nm beam for two-photon excitation of the sample. Power was modulated using a Pockels cell (Conoptics) and scanned over the sample by a resonant-galvanometer (fast and slow axes) scanner (Sutter Instruments MDR-R). A $60\times $ Olympus ($\mathrm{LUMFLN}60\times $) water immersion objective with NA of 1.1 was used for imaging. $Z$-scanning was performed using an $X\text{-}Y\text{-}Z$ stage from the Sutter Instruments (MPC-200). Emitted SHG signal from the sample was collected using a $390/18\text{-}\mathrm{nm}$ filter (Semrock). Photon multiplier tubes from Hamamatsu (H10770-40) were used for collection of the signal, and their signal was amplified with a transimpedance amplifier (Edmund Optics 59-178). National instruments data acquisitions cards and field programmable gate array module were used for control and synchronization of the system and digitizing of the amplified SHG signal. The MATLAB^{®}-based open-source software, Scanimage,^{51} was employed to control the microscope. More information on the optical setup can be found in Ref. 52.

## 2.3.

### Light Propagation Modeling

The projected wavefront ${\mathrm{\Psi}}_{i}$ was calculated by tracing the accumulation of phase along the propagation path of a ray from point ${p}_{1}$ on the originating plane to ${p}_{2}$ on an intermediate plane before the objective lens in the form

## (9)

$${\mathrm{\Psi}}_{i}(\overrightarrow{\rho})=\mathrm{exp}[-j\frac{2\pi}{\lambda}{\int}_{{p}_{1}}^{{p}_{2}}n(\overrightarrow{r})\mathrm{d}l],$$## 2.4.

### Extraction of Zernike Mode Coefficients and Root-Mean-Square Error

We use Eq. (10) to decompose the calculated wavefront into the Zernike modes

## (10)

$${c}_{i}=\frac{1}{\pi}{\int}_{0}^{1}{\int}_{0}^{2\pi}{\mathrm{\Psi}}_{i}(\rho ,\theta ){Z}_{i}(\rho ,\theta )\rho \mathrm{d}\theta \text{\hspace{0.17em}}\mathrm{d}\rho ,$$^{53}of order $i$ and ${c}_{i}$ is the coefficient of mode ${Z}_{i}$. Equation (10) yields a complete Zernike coefficient set that could be applied to a DM for correction. We take modes 5 to 37 (using Noll’s ordering of the Zernike modes, up to order 4) into consideration because these modes can be corrected by a DM, such as the Mirao 52e, the Alpao DM69, or the Boston Micromachines multi-DM. To find the corrected wavefront shape, we do a summation such that constructed phase equals

## (11)

$${\mathrm{\Psi}}_{c}(\rho ,\theta )=\mathrm{exp}(-j\frac{2\pi}{\lambda}\sum _{i}{c}_{i}{Z}_{i}(\rho ,\theta )).$$The root-mean-square (RMS) wavefront error that is corrected by the Zernike modes 5 to 37 (piston, tip, and tilt are not included) is calculated by $\sigma ={[\sum _{i}{c}_{i}^{2}]}^{1/2}$.

## 3.

## Simulations

## 3.1.

### Wavefront Correction Function Calculated by Zernike Polynomials

We used the scaled-to-refractive-index SHG $Z$-stack from mouse cranial bone to calculate the wavefront from a grid of $3\times 3$ equally spaced ($l=106\text{\hspace{0.17em}\hspace{0.17em}}\mu \mathrm{m}$) positions in the bottom plane [Fig. 1(e)]. 51,471 rays on a circle with radius of 128 pixels in Cartesian coordinates were calculated for each projection, yielding a pupil projection that matched the NA-defined cone angle [Figs. 1(d) and 1(e)]. When the phase of the pupil projections was analyzed, pupils out of the center showed tip and tilt predominately due to the angle of off-axis points and curvature of the sample (Fig. 2). We eliminated the tip/tilt due to the off-axis angle, and the projected wavefront in Fig. 2 includes only tip/tilt due to the natural curvature of the skull. We then used these experimental phase values to extract the Zernike coefficients and reconstruct the phase of Zernike functions for each pupil (Fig. 3). The RMS wavefront error values ($\sigma $) [Figs. 3(a)–3(i)] indicate that the bone produces substantial low-order aberrations generated from modes 5 to 37. Therefore, it is likely that low-order aberration correction would improve image quality. However, the difference between the Zernike modeled phase (Fig. 3) and the experimentally measured phase (Fig. 2) suggests that remaining high spatial frequency distortions are important contributors to total image degradation.

We used these constructed pupils to calculate estimated PSFs in the tissue (Fig. 4). As expected from the calculated wavefront errors, the PSF size is between 1.5 and $10\text{\hspace{0.17em}\hspace{0.17em}}\mu \mathrm{m}$, which is far from the diffraction limit ($\sim 500\text{\hspace{0.17em}\hspace{0.17em}}\mathrm{nm}$ in our case).

To examine which Zernike modes contributed to the observed PSF degradation, we plotted the coefficients for modes 5 to 37 for each spot in the $3\times 3$ grid (Fig. 5). These values show strong aberrations especially in the lower modes including astigmatism, coma, trefoil, and spherical, which are due to the general shape of the sample. Interestingly, the magnitude of the analyzed modes seems to vary at each point, suggesting differences in bone architecture between each of the analyzed points.

## 3.2.

### Residual Wavefront Error

The calculated pupils and PSFs in the previous sections were all generated from Zernike modes 5 to 37. This essentially results in high-pass filtering of distortions and leaves residual wavefront error that would result in a reduced Strehl ratio for a wavefront corrected system. We calculated the residual wavefront error between the experimental and Zernike modeled pupils such that ${\mathrm{\Psi}}_{e}={\mathrm{\Psi}}_{i}/{\mathrm{\Psi}}_{c}$, which is equivalent to subtracting the phase of the two pupils. We included all of the first 37 Zernike modes (including tip, tilt, and defocus) in our low-order Zernike polynomial aberration pupil modeling, which yielded an understanding of the high-order aberrations that remained in each pupil (Fig. 6). To quantify this residual error, we calculated the root-mean-square error (RMSE) as described by Guo and Wang^{54}

## (12)

$${\sigma}_{\mathrm{res}}{=\left\{\frac{{\iint}_{A}{[{\phi}_{i}(\mu ,\nu )-{\phi}_{c}(\mu ,\nu )]}^{2}\mathrm{d}\mu \text{\hspace{0.17em}}\mathrm{d}\nu}{{\iint}_{A}\mathrm{d}\mu \text{\hspace{0.17em}}\mathrm{d}\nu}\right\}}^{\frac{1}{2}},$$## Table 1

RMS error values of the original, calculated, and residual pupils are calculated. Strehl ratios corresponding to residual wavefront errors are shown.

Experimental pupil RMSE | Calculated pupil RMSE | Residual RMSE | Strehl ratio (%) (with residual error) | ||
---|---|---|---|---|---|

Z 1 to 37 | Z 5 to 37 | ||||

U-L (a) | 5.44 | 5.26 | 2.77 | 1.32 | 17.51 |

U-C (b) | 6.70 | 6.40 | 2.62 | 1.92 | 2.51 |

U-R (c) | 7.01 | 6.87 | 1.72 | 1.25 | 20.96 |

M-L (d) | 3.78 | 3.02 | 2.71 | 2.07 | 1.38 |

M-C (e) | 6.35 | 5.29 | 3.31 | 3.11 | 0.01 |

M-R (f) | 7.61 | 7.41 | 2.05 | 1.64 | 6.79 |

D-L (g) | 7.31 | 7.10 | 2.75 | 1.62 | 7.25 |

D-C (h) | 8.04 | 7.87 | 1.80 | 1.53 | 9.62 |

D-R (i) | 8.99 | 8.89 | 1.54 | 1.25 | 20.96 |

Note: U, M, and D represent up, middle, and down rows, respectively, and L, C, and R represent left, center, and right columns, respectively. Except Strehl ratios, all other values are in radians.

To find the number of segments required for effective correction of the residual wavefront error, we calculate its correlation length, to find the smallest aberrated distance, from which we can calculate the number of segments. We first calculate the autocorrelation of the residual wavefront error for each pupil with itself, normalized by the residual RMSE^{55}

## (13)

$$\gamma (\mathrm{\Delta}\mu ,\mathrm{\Delta}\nu )=\frac{{\iint}_{A}{\phi}_{e}(\mu ,\nu ){\phi}_{e}(\mu -\mathrm{\Delta}\mu ,\nu -\mathrm{\Delta}\nu )\mathrm{d}\mathrm{\Delta}\mu \text{\hspace{0.17em}}\mathrm{d}\mathrm{\Delta}\nu}{{\sigma}_{\mathrm{res}}^{2}}.$$Using the calculated autocorrelation, we can then find the correlation length $\mathrm{\Delta}l$ using

## (14)

$$\mathrm{\Delta}l=\frac{{\left[{\iint}_{A}{|\gamma (\mathrm{\Delta}\mu ,\mathrm{\Delta}\nu )|}^{2}\mathrm{d}\mathrm{\Delta}\mu \text{\hspace{0.17em}}\mathrm{d}\mathrm{\Delta}\nu \right]}^{1/2}}{{\iint}_{A}\mathrm{d}\mathrm{\Delta}\mu \text{\hspace{0.17em}}\mathrm{d}\mathrm{\Delta}\nu}.$$With this calculation, we find a minimum $\mathrm{\Delta}l=1.66\mathrm{\Delta}\mu $ for the center pupil, corresponding to a correction element with 23,727 segments on a circular pupil for full correction of the residual error.

## 3.3.

### Statistical Analysis of Zernike Modes Across the Field of View

Our analysis of the Zernike modes over a $3\times 3$ matrix of points $106\text{\hspace{0.17em}\hspace{0.17em}}\mu \mathrm{m}$ apart (Fig. 5) revealed substantial changes between the mode coefficients in neighboring spots, which suggests that aberrating features in the bone changed at a length scale shorter than the modeled points’ spacing. To evaluate these changes in the aberrations across the field of view, we therefore repeated the simulation on a grid of $20\times 20$ points spaced $16\text{\hspace{0.17em}\hspace{0.17em}}\mu \mathrm{m}$ apart for Zernike mode orders 5 to 37 (Fig. 8). This analysis qualitatively indicates a gradual transition of modes across the field of view.

We then analyzed the Zernike mode information acquired across the whole field of view to evaluate the standard deviation and average of each mode’s coefficients [Fig. 9(a)]. Although the lower order modes were widely variable (high standard deviation), the high-order modes exhibited less variability (lower standard deviation). Analysis of the Zernike modes of stacks acquired in two additional mice suggests consistent trends in aberrations across cranial bone in individual mice of varied age [Figs. 9(b) and 9(c)] with one 9-week-old, and one 13-week-old.

To practically maximize correction of the Zernike modes across the field of view in a scanning system, it is necessary for a deformable element to rapidly respond to the changing tissue aberrations. We therefore use the transition rate of the modes to estimate the additional residual wavefront error that occurs due to a lag in the frequencies of the correction element (such as a DM) behind the fast axis scanner and the gradient of Zernike modes in the sample. To assess the refresh rate of a desirable correction element, we calculate the gradient of modes in horizontal direction (the direction of the fast axis scan). We perform a 9-point first-order numerical derivative

## (15)

$$\nabla {\phi}_{i}=[{Z}_{i}]\otimes \frac{[\frac{1}{280},-\frac{4}{105},\frac{1}{5},-\frac{4}{5},0,\frac{4}{5},-\frac{1}{5},\frac{4}{105},-\frac{1}{280}]}{2\text{\hspace{0.17em}\hspace{0.17em}}h},$$## (16)

$${\sigma}_{s}=\sqrt{\sum _{i}{(\u27e8\nabla {\phi}_{i}\u27e9aN\frac{{f}_{\mathrm{s}}}{{f}_{\mathrm{c}}})}^{2}},$$^{56}using ${S}_{\mathrm{scan}}=\mathrm{exp}(-{\sigma}_{\mathrm{s}}^{2})$, assuming an 8-kHz resonant scanner and a 256 pixel width of the field of view [Fig. 10(a)], where 100% is full correction of Zernike modes 5 to 37. ${S}_{\text{scan}}$ therefore characterizes the reduction in Strehl ratio expected with inadequate scanning frequency.

Having calculated the number of segments, it is important to know how much the size of each segment affects the wavefront correction. In other words, having larger elements would average wavefront errors over a larger region where a lot of variation exists due to smaller features of the sample. We therefore calculated the wavefront error by convolving the residual wavefront error with a uniformly distributed (and normalized—sum equals 1) kernel $K$ that mimics the segment size

## (17)

$${\sigma}_{\mathrm{seg}}={\left\{\frac{{\iint}_{A}{[{\phi}_{e}(\mu ,\nu )-({\phi}_{e}(\mu ,\nu )\otimes {K}_{l})]}^{2}\mathrm{d}\mu \text{\hspace{0.17em}}\mathrm{d}\nu}{{\iint}_{A}\mathrm{d}\mu \text{\hspace{0.17em}}\mathrm{d}\nu}\right\}}^{\frac{1}{2}},$$## 4.

## Discussion

By characterizing the optical aberrations generated when performing SHG imaging, we are able to evaluate the degree of AO correction and to determine DMs, SLMs, or DMDs required to attain near-diffraction-limited imaging deep in the cranial bone. AO correction using these correction elements will allow us to image fine structures in the bone marrow (e.g., subcellular features, such as mitochondria) that would not be resolvable using a lower NA, lower magnification objective lens to reduce distortions;^{57} or by moving to longer wavelength two-photon or three-photon excitation that requires an exotic optical assembly and fluorophores.^{6} Our bone characterization approach can also be used to directly estimate wavefront aberrations and be applied to a correction algorithm; however, it should be noted that the illumination wavelength used to estimate aberrations should match the wavelength to be corrected.

We found that many low-order optical aberrations produced by the bone marrow can be corrected with a DM. However, as shown in Table 1, a minimum of a 1.25 radian RMS wavefront error is anticipated to remain after correcting Zernike modes 5 to 37, which leads to a maximum possible Strehl ratio of 20%. Our results show that a microelectromechanical system (MEMS) DM with stroke of $1.5\text{\hspace{0.17em}\hspace{0.17em}}\mu \mathrm{m}$ can be used to compensate these errors, which can make a perfect match with the correction function.^{58} Using a MEMS DM is especially helpful due to their fast response time ($<20\text{\hspace{0.17em}\hspace{0.17em}}\mu \mathrm{s}$), with a moderate number of elements (52 to 144).

One challenge here is to capture all the high-order aberrations. Our optical setup takes advantage of an objective lens with NA of 1.1, which produces a two-photon beam waist of 326 nm.^{59} Given the field of view, our resolution produces enough sampling to capture many high-order aberrations. There are expected to be scattering features smaller than our resolution, but our efforts provide a useful initial estimation, and we approximately account for this scattering using Eq. (8).

To further improve the Strehl ratio and achieve near-diffraction-limited imaging *in vivo*, a method for correcting the residual wavefront error is needed. Our estimates indicate that more than 23,000 segments are required to effectively correct for the scattering aberrations and restore the PSF. An SLM with $512\times 512\text{\hspace{0.17em}\hspace{0.17em}}\text{pixels}$ can work in this situation. The increase in the intensity of the focal spot over the average speckle intensity before correction is proportional to the number of segments.^{30}^{,}^{60} Focusing through turbid media can be fairly slow because of the SLM’s response time, the large number of segments to be controlled, and convergence time of the algorithm used.^{32}^{,}^{60}61.62.63.^{–}^{64} The speed of wavefront shaping can be increased dramatically by using a DMD instead of an SLM. By using a DMD, the depth of phase modulation will be replaced by only on/off switching depending on which rays contribute to the focus;^{30}31.^{–}^{32} however, DMDs are capable of much higher modulation speeds of over 32 kHz (TI—DLP7000). DMDs can be used for wavefront shaping by either using off-axis holograms^{65} or binary modulation.^{30}

Evaluation of the rate of transition of aberrations across the field of view demonstrated that wavefront correction across a $320\text{\hspace{0.17em}}\mu \mathrm{m}\times 320\text{\hspace{0.17em}}\mu \mathrm{m}$ field of view with a typical 8-kHz resonant scanner at correction frequency of 50 kHz can achieve an improvement up to 80% of the maximum Strehl ratio of a system correcting for Zernike modes 5 to 37 (i.e., ${\sigma}_{\mathrm{res}}=1.25$, $\text{Strehl ratio}=20\%$). This is due to the gradient of the calculated tissue aberrations and lagging of the typically slower corrective element behind the fast scan. Therefore, a balance between acquisition speed and aberration correction should be sought to balance the demands of video rate scanning, field of view size, and the available speed of correction elements. Since residual aberrations that are not captured by Zernike modes 5 to 37 play a significant role in reducing the overall Strehl ratio, we suggest a combination of a DM and DMD to reduce most of the aberrations. In a system with both correctors working at a 20-kHz refresh rate and a line scanning frequency of 4 kHz, AO corrected two-photon imaging at the speed of 15 frames per second on a $320\text{\hspace{0.17em}}\mu \mathrm{m}\times 320\text{\hspace{0.17em}}\mu \mathrm{m}$ field of view or larger would be within reach.

## 5.

## Conclusion

In conclusion, we calculated the wavefront phase deviations for focusing beams into the highly scattering cranial bone of a mouse, using a linear ray tracing method, and the refractive indices of the bone mapped from an image stack acquired using SHG of collagen. In the current model, bone cavities are treated as having a homogenous refractive index. By calculating the projection of points across the field of view to the back pupil plane, we calculated the projected wavefronts and extracted Zernike polynomials from them. We used the Zernike modes within the current limitations of typical DMs to produce a correction function. We found a minimum of 1.54 radians RMS wavefront error produced in Zernike modes 5 to 37. We further calculated the residual wavefront error, which showed a significant remaining RMSE of 1.25 radians, corresponding to a maximum of 20% Strehl ratio. Based on our calculation of the correlation length of the wavefront RMS error, we suggest that wavefront correction elements with a large number of segments ($>\mathrm{23,000}$) with frequencies of the correction elements and the resonant scanner in a proportion near unity must be used to effectively compensate for distortions produced by a highly scattering medium, such as bone, to restore a diffraction limited imaging system.

We show that the optical aberration measurements that are extracted from the SHG imaging of bone can be used as *a priori* information in an open-loop AO system or as the initial state in a closed-loop AO correction system to speed up the process. This information can be very helpful especially for the binary correction to enhance the convergence of the algorithm. In future work, we will extend our investigation to more fully characterize multilayered biological environments.

## Acknowledgments

This work was supported in part by University of Georgia (UGA) startup funds, a UGA Faculty Research Grant, and the Soft Bones Foundation Maher Family grant to L.J.M., and the National Science Foundation Grant No. DBI1350654 to P.K.

## References

## Biography

**Kayvan Forouhesh Tehrani** is a postdoctoral research associate at the University of Georgia. He received his PhD in biological engineering from the University of Georgia in 2015 and his MSc degree in optical engineering from the University of Nottingham in 2009. His current research interests include adaptive optics, multiphoton microscopy, super-resolution microscopy, and bioimaging.

**Peter Kner** has been an associate professor of engineering at the University of Georgia since 2009. He received his PhD in physics from the University of California, Berkeley, in 1998.

**Luke J. Mortensen** has been an assistant professor of Regenerative Medicine and Engineering at the University of Georgia since 2014. He received his PhD in biomedical engineering from the University of Rochester in 2011 and trained as a postdoctoral research fellow at Harvard and Massachusetts General Hospital.