## 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

S. Hell and E. H. K. Stelzer, “Fundamental improvement of resolution with a 4Pi-confocal fluorescence microscope using two-photon excitation,” Opt. Commun. 93(5–6), 277–282 (1992).OPCOB80030-4018http://dx.doi.org/10.1016/0030-4018(92)90185-TGoogle Scholar

C. Xu and W. W. Webb, “Measurement of two-photon excitation cross sections of molecular fluorophores with data from 690 to 1050 nm,” J. Opt. Soc. Am. B 13(3), 481–491 (1996).https://doi.org/10.1364/JOSAB.13.000481Google Scholar

P. R. Callis, “Two-photon-induced fluorescence,” Ann. Rev. Phys. Chem. 48(1), 271–297 (1997).ARPLAP0066-426Xhttp://dx.doi.org/10.1146/annurev.physchem.48.1.271Google Scholar

A. Diaspro et al., “Multi-photon excitation microscopy,” Biomed. Eng. Online 5, 36 (2006).http://dx.doi.org/10.1186/1475-925X-5-36Google Scholar

W. Denk, J. Strickler and W. Webb, “Two-photon laser scanning fluorescence microscopy,” Science 248(4951), 73–76 (1990).SCIEAS0036-8075http://dx.doi.org/10.1126/science.2321027Google Scholar

D. Sinefeld et al., “Adaptive optics in multiphoton microscopy: comparison of two, three and four photon fluorescence,” Opt. Express 23(24), 31472–31483 (2015).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.23.031472Google Scholar

E. Chaigneau et al., “Impact of wavefront distortion and scattering on 2-photon microscopy in mammalian brain tissue,” Opt. Express 19, 22755–22774 (2011).http://dx.doi.org/10.1364/OE.19.022755Google Scholar

O. Nadiarnykh and P. J. Campagnola, “Retention of polarization signatures in SHG microscopy of scattering tissues through optical clearing,” Opt. Express 17(7), 5794–5806 (2009).http://dx.doi.org/10.1364/OE.17.005794Google Scholar

K. Chung et al., “Structural and molecular interrogation of intact biological systems,” Nature 497(7449), 332–337 (2013).http://dx.doi.org/10.1038/nature12107Google Scholar

L. J. Mortensen et al., “Femtosecond laser bone ablation with a high repetition rate fiber laser source,” Biomed. Opt. Express 6(1), 32–42 (2015).BOEICL2156-7085http://dx.doi.org/10.1364/BOE.6.000032Google Scholar

D. Jeong, P. S. Tsai and D. Kleinfeld, “Prospect for feedback guided surgery with ultra-short pulsed laser light,” Curr. Opin. Neurobiol. 22(1), 24–33 (2012).COPUEN0959-4388http://dx.doi.org/10.1016/j.conb.2011.10.020Google Scholar

D. C. Jeong, P. S. Tsai and D. Kleinfeld, “All-optical osteotomy to create windows for transcranial imaging in mice,” Opt. Express 21(20), 23160–23168 (2013).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.21.023160Google Scholar

R. Turcotte et al., “Characterization of multiphoton microscopy in the bone marrow following intravital laser osteotomy,” Biomed. Opt. Express 5(10), 3578–3588 (2014).BOEICL2156-7085http://dx.doi.org/10.1364/BOE.5.003578Google Scholar

X. Tao et al., “Adaptive optical two-photon microscopy using autofluorescent guide stars,” Opt. Lett. 38(23), 5075–5078 (2013).OPLEDP0146-9592http://dx.doi.org/10.1364/OL.38.005075Google Scholar

K. Wang et al., “Direct wavefront sensing for high-resolution in vivo imaging in scattering tissue,” Nat. Commun. 6, 7276 (2015).NCAOBW2041-1723http://dx.doi.org/10.1038/ncomms8276Google Scholar

M. Rueckel, J. A. Mack-Bucher and W. Denk, “Adaptive wavefront correction in two-photon microscopy using coherence-gated wavefront sensing,” Proc. Natl. Acad. Sci. U. S. A 103(46), 17137–17142 (2006).http://dx.doi.org/10.1073/pnas.0604791103Google Scholar

D. Débarre et al., “Image-based adaptive optics for two-photon microscopy,” Opt. Lett. 34(16), 2495–2497 (2009).OPLEDP0146-9592http://dx.doi.org/10.1364/OL.34.002495Google Scholar

P. N. Marsh, D. Burns and J. M. Girkin, “Practical implementation of adaptive optics in multiphoton microscopy,” Opt. Express 11(10), 1123–1130 (2003).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.11.001123Google Scholar

L. Kong and M. Cui, “In vivo neuroimaging through the highly scattering tissue via iterative multi-photon adaptive compensation technique,” Opt. Express 23(5), 6145–6150 (2015).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.23.006145Google Scholar

L. Kong and M. Cui, “In vivo deep tissue imaging via iterative multiphoton adaptive compensation technique,” IEEE J. Sel. Top. Quantum Electron. 22(4), 40–49 (2016).IJSQEN1077-260Xhttp://dx.doi.org/10.1109/JSTQE.2015.2509947Google Scholar

L. Kong, J. Tang and M. Cui, “Multicolor multiphoton in vivo imaging flow cytometry,” Opt. Express 24(6), 6126–6135 (2016).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.24.006126Google Scholar

M. J. Booth, “Wave front sensor-less adaptive optics: a model-based approach using sphere packings,” Opt. Express 14(4), 1339–1352 (2006).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.14.001339Google Scholar

O. Albert et al., “Smart microscope: an adaptive optics learning system for aberration correction in multiphoton confocal microscopy,” Opt. Lett. 25(1), 52–54 (2000).OPLEDP0146-9592http://dx.doi.org/10.1364/OL.25.000052Google Scholar

A. J. Wright et al., “Exploration of the optimisation algorithms used in the implementation of adaptive optics in confocal and multiphoton microscopy,” Microsc. Res. Tech. 67(1), 36–44 (2005).MRTEEO1059-910Xhttp://dx.doi.org/10.1002/(ISSN)1097-0029Google Scholar

B. Thomas et al., “Enhanced resolution through thick tissue with structured illumination and adaptive optics,” J. Biomed. Opt. 20(2), 026006 (2015).JBOPFO1083-3668http://dx.doi.org/10.1117/1.JBO.20.2.026006Google Scholar

D. Debarre, M. J. Booth and T. Wilson, “Image based adaptive optics through optimisation of low spatial frequencies,” Opt. Express 15(13), 8176–8190 (2007).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.15.008176Google Scholar

J. R. Fienup and J. J. Miller, “Aberration correction by maximizing generalized sharpness metrics,” J. Opt. Soc. Am. A 20(4), 609–620 (2003).JOAOD60740-3232http://dx.doi.org/10.1364/JOSAA.20.000609Google Scholar

D. Débarre et al., “Adaptive optics for structured illumination microscopy,” Opt. Express 16(13), 9290–9305 (2008).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.16.009290Google Scholar

K. F. Tehrani et al., “Adaptive optics stochastic optical reconstruction microscopy (AO-STORM) using a genetic algorithm,” Opt. Express 23(10), 13677–13692 (2015).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.23.013677Google Scholar

D. Akbulut et al., “Focusing light through random photonic media by binary amplitude modulation,” Opt. Express 19(5), 4017–4029 (2011).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.19.004017Google Scholar

D. B. Conkey, A. M. Caravaca-Aguirre and R. Piestun, “High-speed scattering medium characterization with application to focusing light through turbid media,” Opt. Express 20(2), 1733–1740 (2012).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.20.001733Google Scholar

X. Zhang and P. Kner, “Binary wavefront optimization using a genetic algorithm,” J. Opt. 16(12), 125704 (2014).http://dx.doi.org/10.1088/2040-8978/16/12/125704Google Scholar

J. Tang, R. N. Germain and M. Cui, “Superpenetration optical microscopy by iterative multiphoton adaptive compensation technique,” Proc. Natl. Acad. Sci. U. S. A. 109(22), 8434–8439 (2012).http://dx.doi.org/10.1073/pnas.1119590109Google Scholar

J.-H. Park, W. Sun and M. Cui, “High-resolution in vivo imaging of mouse brain through the intact skull,” Proc. Natl. Acad. Sci. U. S. A. 112(30), 9236–9241 (2015).http://dx.doi.org/10.1073/pnas.1505939112Google Scholar

K. Wang et al., “Rapid adaptive optical recovery of optimal resolution over large volumes,” Nat. Methods 11(6), 625–628 (2014).1548-7091http://dx.doi.org/10.1038/nmeth.2925Google Scholar

M. Schwertner et al., “Measurement of specimen-induced aberrations of biological samples using phase stepping interferometry,” J. Microsc. 213(1), 11–19 (2004).JMICAR0022-2720http://dx.doi.org/10.1111/j.1365-2818.2004.01267.xGoogle Scholar

M. Schwertner, M. Booth and T. Wilson, “Characterizing specimen induced aberrations for high NA adaptive optical microscopy,” Opt. Express 12(26), 6540–6552 (2004).OPEXFF1094-4087http://dx.doi.org/10.1364/OPEX.12.006540Google Scholar

M. Schwertner, M. J. Booth and T. Wilson, “Simulation of specimen-induced aberrations for objects with spherical and cylindrical symmetry,” J. Microsc. 215(3), 271–280 (2004).JMICAR0022-2720http://dx.doi.org/10.1111/j.0022-2720.2004.01371.xGoogle Scholar

M. S. Starosta and A. K. Dunn, “Three-dimensional computation of focused beam propagation through multiple biological cells,” Opt. Express 17(15), 12455–12469 (2009).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.17.012455Google Scholar

S. A. Prahl et al., “A Monte Carlo model of light propagation in tissue,” Proc. SPIE 5, 102–111 (1989).PSISDG0277-786Xhttp://dx.doi.org/10.1016/j.procir.2013.01.005Google Scholar

T.-W. Wu and M. Cui, “Numerical study of multi-conjugate large area wavefront correction for deep tissue microscopy,” Opt. Express 23(6), 7463–7470 (2015).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.23.007463Google Scholar

G. Cox et al., “3-dimensional imaging of collagen using second harmonic generation,” J. Struct. Biol. 141(1), 53–62 (2003).JSBIEM1047-8477http://dx.doi.org/10.1016/S1047-8477(02)00576-2Google Scholar

P. J. Campagnola et al., “Second-harmonic imaging microscopy of living cells,” J. Biomed. Opt. 6(3), 277–286 (2001).JBOPFO1083-3668http://dx.doi.org/10.1117/1.1383294Google Scholar

Y. Liu and P. H. Daum, “Relationship of refractive index to mass density and self-consistency of mixing rules for multicomponent mixtures like ambient aerosols,” J. Aerosol Sci. 39(11), 974–986 (2008).JALSB70021-8502http://dx.doi.org/10.1016/j.jaerosci.2008.06.006Google Scholar

P. J. Campagnola and L. M. Loew, “Second-harmonic imaging microscopy for visualizing biomolecular arrays in cells, tissues and organisms,” Nat. Biotech. 21(11), 1356–1360 (2003).NABIF91087-0156http://dx.doi.org/10.1038/nbt894Google Scholar

V. V. Tuchin, “Lasers and fiber optics in medicine,” Proc. SPIE 1981, 2 (1993).http://dx.doi.org/10.1117/12.146456Google Scholar

S. L. Jacques, “Optical properties of biological tissues: a review,” Phys. Med. Biol. 58(11), 37–91 (2013).PHMBA70031-9155http://dx.doi.org/10.1088/0031-9155/58/11/R37Google Scholar

Q. Q. Zhang et al., “Scattering coefficients of mice organs categorized pathologically by spectral domain optical coherence tomography,” Biomed. Res. Int. 2014, 478012 (2014).http://dx.doi.org/10.1155/2014/471082Google Scholar

A. Ascenzi and C. Fabry, “Technique for dissection and measurement of refractive index of osteones,” J. Biophys. Biochem. Cytol. 6(1), 139–142 (1959).JBBCAH0095-9901http://dx.doi.org/10.1083/jcb.6.1.139Google Scholar

D. G. Rosenegger et al., “A high performance, cost-effective, open-source microscope for scanning two-photon microscopy that is modular and readily adaptable,” PLoS One 9(10), e110475 (2014).http://dx.doi.org/10.1371/journal.pone.0110475Google Scholar

T. A. Pologruto, B. L. Sabatini and K. Svoboda, “ScanImage: flexible software for operating laser scanning microscopes,” Biomed. Eng. Online 2, 13 (2003).http://dx.doi.org/10.1186/1475-925X-2-13Google Scholar

K. F. Tehrani et al., “Deep tissue single cell MSC ablation using a fiber laser source to evaluate therapeutic potential in osteogenesis imperfecta,” Proc. SPIE 9711, 97110D (2016).PSISDG0277-786Xhttp://dx.doi.org/10.1117/12.2213292Google Scholar

C. Y. Zhao and J. H. Burge, “Orthonormal vector polynomials in a unit circle, part I: basis set derived from gradients of Zernike polynomials,” Opt. Express 15(26), 18014–18024 (2007).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.15.018014Google Scholar

H. Guo and Z. Wang, “Wavefront reconstruction using iterative discrete Fourier transforms with Fried geometry,” Optik–Int. J. Light Electron. Opt. 117(2), 77–81 (2006).http://dx.doi.org/10.1016/j.ijleo.2005.06.003Google Scholar

J. W. Goodman, Statistical Optics, 1st ed., Wiley Interscience, New York (1985).Google Scholar

V. N. Mahajan, “Strehl ratio for primary aberrations in terms of their aberration variance,” J. Opt. Soc. Am. 73(6), 860–861 (1983).JOSAAH0030-3941http://dx.doi.org/10.1364/JOSA.73.000860Google Scholar

A. Singh et al., “Comparison of objective lenses for multiphoton microscopy in turbid samples,” Biomed. Opt. Express 6(8), 3113–3127 (2015).BOEICL2156-7085http://dx.doi.org/10.1364/BOE.6.003113Google Scholar

B. P. Wallace et al., “Evaluation of a MEMS deformable mirror for an adaptive optics test bench,” Opt. Express 14(22), 10132–10138 (2006).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.14.010132Google Scholar

W. R. Zipfel, R. M. Williams and W. W. Webb, “Nonlinear magic: multiphoton microscopy in the biosciences,” Nat. Biotech. 21, 1369–1377 (2003).http://dx.doi.org/10.1038/nbt899Google Scholar

I. M. Vellekoop and A. P. Mosk, “Phase control algorithms for focusing light through turbid media,” Opt. Commun. 281(11), 3071–3080 (2008).OPCOB80030-4018http://dx.doi.org/10.1016/j.optcom.2008.02.022Google Scholar

M. Cui, “Parallel wavefront optimization method for focusing light through random scattering media,” Opt. Lett. 36(6), 870–872 (2011).OPLEDP0146-9592http://dx.doi.org/10.1364/OL.36.000870Google Scholar

D. B. Conkey et al., “Genetic algorithm optimization for focusing through turbid media in noisy environments,” Opt. Express 20(5), 4840–4849 (2012).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.20.004840Google Scholar

S. A. Goorden, J. Bertolotti and A. P. Mosk, “Superpixel-based spatial amplitude and phase modulation using a digital micromirror device,” Opt. Express 22(15), 17999–18009 (2014).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.22.017999Google Scholar

X. Tao et al., “High-speed scanning interferometric focusing by fast measurement of binary transmission matrix for channel demixing,” Opt. Express 23(11), 14168–14187 (2015).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.23.014168Google Scholar

D. B. Conkey, A. M. Caravaca-Aguirre and R. Piestun, “High-speed scattering medium characterization with application to focusing light through turbid media,” Opt. Express 20(2), 1733–1740 (2012).OPEXFF1094-4087http://dx.doi.org/10.1364/OE.20.001733Google Scholar

## 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.