Jan Philippe

Thomas Braun

Cátia, Melánia, Carla, Olexandr, Miguel Yannick - Gabriela

Rui A \huge

Biker's Friends -Elena

Linda

Laure

Geoffrey

Thomas

Keywords: aberrations, 2, 2 Default numerical microscope simulation parameters, 2, 3 Numerical microscope simulation parameters fo

algorithm . . . . . . . .

The following lines have the purpose of expressing my gratitude to all my friends, colleagues and professors who indirectly or directly contributed to achieve the conclusion of this thesis.

I want to ensure the reader that all analogies that follows are merely to enhance the qualities and not to enhance physical or psychological characteristics. The following order does not translate into a grade of empathy or friendship. Of course, some people contributed more than other to this achievement and I'm very grateful for that.

After a long reflection I realize that this long journey of three years in which I developed this PhD thesis can be compared with the journey of Frodo Baggins to destroy the One Ring (see The Lord of the Rings). The reader should not mistake the journey with the goal (the idea of destroying this thesis just came to my mind once). Thus, as in Frodo's journey, I could not have accomplished my journey without the help of some honorable persons. To keep this acknowledgments section "fun" and original, I will kindly compare these persons with the characters of the Frodo's journey. I'm quite sure that almost everyone agrees with me about the choice of the character to represent their contribution to my thesis. Still, I would like to express my sincere gratitude especially to: i • Carlos Correia for nourishing in me the willingness to leave the Shire to seek new adventures, the same way he went on adventures a not long time ago with the Gandalf of this story.

• Jean-Marc Conan for his wisdom, his patience and for sharing the difficulties of the path and battles we came along.

• Laurent Mugnier for accepting to be the director this journey. His wisdom, his experience from past battles and his contribution on the last battle of my journey are very appreciated.

I would like to express my gratitude to all the members of the Haute Résolution Angulaire team (my Fellowship of the Thesis) for contributing to the accomplishment of this journey.

Note -for the reader who is following a similar journey and is reading the acknowledgements of other thesis instead of doing something productive: I would suggest the listening of The Lord of the Rings soundtrack during the writing of your thesis. It really helped me to keep me concentrated and motivated. I believe that it may have influenced the writing of this small text. (If you have the courage, try to watch the movies and write your thesis simultaneously \wink\wink).

This journey would have not be so amazing without the other hobbits Dr. Sébastien, Dr. Adrien and Dr. Kassem (you should not pronounce the K letter). It was very fun to share with you this experience as a whole: thanks a lot. Some special thanks goes to Elena for your backstage help and to Serge and Cyril for your mentoring in the art of taking a break during the thesis journey. And finally, thanks to Nicolas for sharing the same workspace and your stapler. I will surely not forget the sound of your phone ringing all day .

I'm done with the Tolkien references.

I am deeply grateful to all the members of my defence jury -Delphine Débarre, Michael Atlan, Gérard Rousset and Arnaud Dubois. I appreciated the questions and the discussion we could have around the different topics of this thesis. I would like to thank to the collaborators of the research project that motivated this thesis: Hervé Rigneault, Serge Monneret and Dorian Champelovier from Institut Fresnel; Arnaud Malvache and Rosa Cossart from INMED. I profit to thank the ONERA and the Fondation pour la Recherche Médicale for financing this thesis. I would also like to thank to Professor Filipe Mena, Professora Suzana Mendes, Professor João Nuno Tavares, Professor Carlos Menezes and Professor André Marçal for their influence in the path I chose to follow several years ago.

I would also like to take this opportunity to acknowledge and recognize the efforts of my friends Viola, Lucile, Loïc, Aurélien and Baptiste who supported me during the less good moments and who were present in the very good moments. Thank you also for the friends who I had the pleasure to encounter during this thesis -Marie, Bernadette, 2.1 Computation of the complex amplitude Apρ x , ρ y ; zq. The truncated Gaussian distribution is the multiplication of the Gaussian distribution Gpρ x , ρ y q with a binary mask P pρ x , ρ y q representing the back aperture. The complex amplitude is calculated by multiplying the truncated Gaussian distribution with the exponential of the phase plus the right amount a d of defocus that must be added to simulate a 2D PSF at a distance z from the focal plane. 12 Axial cuts at the center of the diffraction-limited 3D PSF 2 (x " 0, y " 0) 44 2.13 Illustration of the 3D PSF 2 for 2 rad of coma aberration (Z 7 ) . . . . . . . 46 2.14 3D PSF 2 cuts for 2 rad of coma aberration (Z 7 ) . . . . . . . . . . . . . . . 47 2.15 Illustration of the 3D PSF 2 for 2 rad of spherical aberration (Z 11 ) . . . . 48 2.16 3D PSF 2 cuts for 2 rad of spherical aberration (Z 11 ) . . . . . . . . . . . . 49 2.17

List of Figures

Introduction

This thesis lies in the framework of a multidisciplinary project that gathers three laboratories: ONERA, Institut Fresnel and INMED. The purpose of this collaboration is the development of a two photon microscope assisted by adaptive optics for the study of neuronal calcium activity in the hippocampus of the living mouse.

In vivo calcium imaging using two-photon microscopy is a method increasingly used to study neuronal activity at microcircuit level. In the hippocampus, this technique allows for the recording, in the dorsal CA1 region, of large fields of view containing hundreds of cells. It has led to pioneering descriptions of multineuron dynamics including, for example, spatial navigation, epilepsy or quiet rest [Dombeck et al., 2010;[START_REF] Lovett-Barron | Dendritic inhibition in the hippocampus supports fear learning[END_REF]Sheffield and Dombeck, 2015;[START_REF] Danielson | Sublayer-specific coding dynamics during spatial navigation and learning in hippocampal area ca1[END_REF]Villette et al., 2015;[START_REF] Muldoon | Gabaergic inhibition shapes interictal dynamics in awake epileptic mice[END_REF]. However, the implementation of this technique requires a surgery to remove the overlying cortex in order to implement a cranial window, which introduces a high variability of "optical access" to the tissue.

In order to obtain more detailed information on the origin of the epileptic events but also on the processes that originates the propagation of information in the hippocampus, it is necessary to image the dentate gyrus. However, the dentate gyrus is positioned deep in the hippocampus (approximately 700 µm deep). Due to light scattering and optical aberrations, the focusing of the excitation beam decreases as one goes deeper into the biological medium. As a consequence, the amount of generated fluorescence also decreases. This problem must be tackled in order to recover the fluorescence signal, which is associated to an improvement of the image contrast. Thus, even a mild increase in contrast should lead to the detection of neural activity that otherwise would be masked by background fluorescence. This increase can be achieved using adaptive optics, a promising tool increasingly used for microscopy. Adaptive optics is the process of quantifying optical aberrations through wavefront measurement and correcting them by the use of an adaptive correction element (deformable mirror DM or spatial light modulator SLM).

The key issue is the sensing of the wavefront. The latter can either be directly measured or indirectly estimated.

Direct wavefront sensing methods rely on introducing a wavefront sensor such as a Shack-Hartmann in the detection part of the microscope. A point source in the sample is then imaged on the sensor, which allows to directly measure the aberrations. However, the return flux which is often in the visible range (green) is strongly multidiffused and the wavefront measurement is very difficult to perform. Besides, even if one could perform such a measurement, it would not guarantee an efficient correction at the Introduction wavelength of the excitation beam (red) because of chromaticity. To overcome this, one can use specific fluorescent markers whose two photon emission wavelength is close to the excitation wavelength [START_REF] Wang | Direct wavefront sensing for high-resolution in vivo imaging in scattering tissue[END_REF]. It however adds complexity and is not compatible with all bio-applications. Indirect wavefront sensing does not require a wavefront sensor as it relies on the estimation of aberrations through the analysis of the image scans obtained with the science imaging channel. The two main indirect wavefront sensing approaches for two photon microscopy are the pupil segmentation [Ji et al., 2010] and the modal sensorless wavefront sensing [START_REF] Débarre | Image-based adaptive optics for two-photon microscopy[END_REF] approaches.

The pupil segmentation method is based on the acquisition of sub-pupil scan images, the various sub-pupils being distributed so as to pave the full pupil. [Ji et al., 2010] have shown that shifts observed between two sub-pupil scan images are related to the differential wavefront slope (local tilt) between sub-pupils. This approach can therefore be seen as an adaptation of the Shack-Hartmann wavefront sensor. This method has been implemented in two photon microscopes, successfully correcting aberrations at depths over 400 µm in brain tissue [Ji et al., 2012] and has the advantage that it is able to estimate large aberration amplitudes. However, some authors have claimed that, with a small sub-pupil, the signal is strongly reduced because of the increase of the diffraction effect. The signal detection thus requires a longer integration time making it impracticable for in vivo imaging.

The modal sensorless wavefront estimation is based on an iterative procedure that aims at optimizing the deformable mirror correction in order to optimize an image quality metric. In two-photon microscopy [START_REF] Débarre | Image-based adaptive optics for two-photon microscopy[END_REF] selected, as a metric, the return flux (mean image intensity). They have shown that this criterion can be expressed, in the small phase approximation, as a quadratic form in the aberration coefficients. This technique has the main advantage that it only requires a corrective element in the illuminating excitation path and thus is very easy to implement. However, as it is indirectly inferred, the "optimized" wavefront that maximizes the quality metric is not only linked to the wavefront deformation but also to the distribution of the object used for optimization. This phenomenon known as the sample dependence can severely bias the wavefront estimation when the sample presents a complex heterogeneous distribution. This was observed by [START_REF] Débarre | Structure sensitivity in third-harmonic generation microscopy[END_REF]Olivier et al., 2009;Thayil et al., 2010] for THG microscopy. [Thayil et al., 2010] performed a detailed study of this phenomenon for THG, where different sample geometries were considered. In this study the authors also briefly demonstrated the sample dependence for two photon microscopy considering a particular sample distribution. Later, [Thayil and Booth, 2011] considered that the sample dependence is mainly caused by the displacement of the point spread function (PSF) induced by the aberrations. Then, it has been suggested to construct a "displacementfree" basis mode [Thayil and Booth, 2011;Facomprez et al., 2012]. This particular flavor of the modal sensorless approach has been demonstrated with great success on ex vivo biological samples [Zeng et al., 2012;Facomprez et al., 2012].

Although the displacement-free modal sensorless approach appears to be efficient in practice, a comprehensive study of the impact of the sample dependence in two photon microscopy and of the validity of the displacement-free approach has never been performed.

The main objective of this thesis is to perform such a detailed study of the modal sensorless wavefront sensing approach for two photon microscopy and to present an improved original approach that performs a correct wavefront estimation at large depths and that is suitable for use in very heterogeneous samples such as the hippocampus.

This thesis is divided in 4 Chapters.

Chapter 1 is an introductory chapter. I present here the biomedical context that motivates this thesis and the different notions that are useful to read the following chapters. I also present the different approaches developed in recent years for wavefront sensing in two photon microscopy.

In Chapter 2, a study of the impact of aberrations in two photon microscopy is presented.

In order to obtain a better physical understanding of the effect of aberrations and of the sample structure in the mean image intensity M 1 (return flux), I present a mathematical formulation of M 1 that clearly describes the interplay between the 3D PSF of the excitation beam and the sample distribution. I develop a tool called numerical microscope and I define the simulation parameters that should be considered to adequately compute the 3D PSF with a reasonable computation time. With this tool, I present a study of the impact of aberrations in M 1 for different sample geometries. I also study the impact of aberrations in M 1 for different numerical apertures, which allows me to briefly discuss the pupil segmentation approach limitations.

In Chapter 3, I analyze the standard modal sensorless (SMS) wavefront sensing approach for different sample geometries. Using the numerical microscope, I perform a detailed analysis of the sample dependence for two-photon microscopy and I identify the limitations of the displacement-free variant of the SMS approach (SMS-DF). Taking into account these different analyses, a new modal sensorless approach, named Axially-Locked Modal Sensorless wavefront sensing (ALMS), is defined. This approach is designed to be capable of doing a correct estimation of aberrated wavefronts with any heterogeneous sample such as the hippocampus. This approach was developed during this thesis with the collaboration of our colleagues from Institut Fresnel and INMED [Champelovier* et al., 2017]. The ex vivo and in vivo experimental application of the approach are presented as well as the test bench used.

In Chapter 4, through numerical end-to-end closed loop simulations, I present a comparison of the aberration estimation accuracy between the SMS (with and without displacement-free modes) and the ALMS approaches. For each approach, different regimes of aberrations and different modalities of modal sensorless wavefront sensing are explored. Following [Facomprez et al., 2012], I compare modal sensorless modalities which differ in the number K of transverse scan acquisitions (measurements) used for a given aberration estimation and differ in the optimization strategy (global or sequential DM update). I also briefly study the impact of the detection noise on the SMS-DF and on the ALMS approach.

Chapter 1

Adaptive optics for two photon scanning microscopy and application to calcium imaging of neuronal networks

In this chapter, I present the different notions that are useful to the reading of this thesis.

The first part (Sect. 1.1 and Sect. 1.2). I briefly present the biomedical context, the principle of the two photon fluorescence imaging and the difficulties one can encounter when imaging biological tissues. In Sections 1.3 and 1.4 I present the principles and equations that describes the propagation of Gaussian beams and the image formation, based on Fourier optics. Finally, in Sect. 1.5, I present a summary of the different methods that are used to correct optical aberrations in two-photon microscopy. Among the selected approaches, the modal sensorless wavefront sensing approach is selected and motivates this thesis.

Calcium imaging of neuronal networks in the hippocampus of the living mouse

The brain is the most important and complex organ of the human body. It is composed of a network of billions of neurons connected by thousands of synapses. Among the six functional regions of the brain, one of them, the temporal lobe is the center of many cognitive functions such as memory, learning, or spatial navigation. One of the structures of this lobe, the hippocampus, located near the brain stem, has a central role in the functioning of the lobe and is particularly impacted by certain pathologies such as epilepsy of the temporal lobe [START_REF] Williamson | Anatomic classification of focal epilepsies[END_REF]. The hippocampus plays important roles in the consolidation of information from short-term to long-term memory, and in spatial memory that enables navigation [START_REF] Tulving | Episodic and declarative memory: role of the hippocampus[END_REF]Sheffield and Dombeck, 2015;[START_REF] Danielson | Sublayer-specific coding dynamics during spatial navigation and learning in hippocampal area ca1[END_REF]Villette et al., 2015].

The hippocampus is composed of four substructures respectively called CA1, CA2, CA3 (forming an assembly called the Ammon horn) and the dentate gyrus. These substructures are composed of a compact layer of cells: pyramidal cells for CA1, CA2 and CA3; granular and mossy cells for the dentate gyrus.

Information from other parts of the brain travels through the hippocampus and is treated by the hippocampus through an internal circuit called a trisynaptic circuit [Andersen, 1975]. This circuit corresponds to a series of connections between the dentate gyrus (input of the hippocampus), CA3 and CA1.

In rodents as model organisms, the hippocampus has been studied extensively as part of a brain system responsible for spatial memory and navigation. Many neurons in mouse hippocampus respond as place cells: that is, they fire bursts of action potentials when the animal passes through a specific part of its environment. Since different neuronal cell types are neatly organized into layers in the hippocampus, it has frequently been used as a model system for studying neurophysiology.

In the mouse, the study of the hippocampus can be done in different ways, but if one wants to measure in real time the activity of the neurons composing the networks present in this region, only two techniques are possible. These are electrophysiology [START_REF] Hubbard | Electrophysiological analysis of synaptic transmission[END_REF][START_REF] Kandel | Electrophysiology of hippocampal neurons: Ii. after-potentials and repetitive firing[END_REF] and fluorescence imaging [START_REF] Stosiek | In vivo two-photon calcium imaging of neuronal networks[END_REF].

The first consists of recording directly the action potentials via electrodes inserted in the area of the brain studied. The advantage of this technique lies in the temporal resolution of the acquired signals up to several kilohertz. However, even if multiple cells can be 1.1. Calcium imaging of neuronal networks in the hippocampus measured at the same time, the number of cells studied remains small and it is difficult to obtain spatial information linking them. Fluorescent microscope imaging modes can be categorized as point-scanning or widefield methods. In widefield microscopes, a whole 2D image in acquired by imaging the field onto a camera. In point-scanning microscopes or scanning fluorescence microscopy, the image is acquired by scanning a laser focus through a sample. This technique makes it possible to visualize a large part of neuronal networks (several hundred cells at the same time). Nevertheless, the acquisition of such large images takes time, the acquisition speed of this technique is much lower than in electrophysiology and the response time of the used fluorescent markers also limits this speed. Despite this, the possibility of observing a large population of neurons at the same time is essential to better understand the overall behavior of neural networks, the use of scanning fluorescence imaging techniques is then favored.

To visualize neuronal activity, the use of specific fluorescent markers (called calcium markers) are necessary. These fluorophores have the property of having their rate of generation of fluorescence photons related to the concentration of calcium ions Ca 2p resent in the labeled cells.

The adoption of fluorescent labels inherently involves the use of fluorescence imaging techniques, but not only. Indeed, in the mouse the hippocampus is about one millimeter deep under the skull. It is therefore impossible to image it directly by a simple craniotomy (removal of a small piece of skull). It is then necessary to remove a small volume of cortex to reach the upper layers of the hippocampus [Dombeck et al., 2010]. The presence of blood (from the capillaries and also sometimes from small hemorrhage) as well as the quality of the interface between the glass window and the brain surface are a main limitation to the imaging process. The former causes optical absorption and can be reduced by performing the surgery following water restriction to increase the viscosity of the blood. The latter causes optical aberrations. Furthermore, the densely packed layer of CA1 pyramidal neurons is located 200 µm below the glass window covering the brain: the incoming laser beam becomes more by light scattering and optical aberrations during the propagation within the tissue. This problem should be tackled in order to improve the fluorescence signal which is associated to an improvement of the image contrast. Even a modest improvement in contrast should lead to the detection of neuronal activity that otherwise is masked by background fluorescence from brain tissue.

To reduce the light scattering issue, one technique commonly used is the two photon scanning microscopy.

Obs: A more detailed explanation of the biomedical context and the principles of fluorescence imaging can be found in the thesis of our colleague Dorian Champelovier from Institut Fresnel.

Two photon scanning microscopy for neuronal imaging of the hippocampus and its limitations

Before introducing the principle of two photon scanning microscopy I present the principles of single and multi photon absorption.

Single photon absorption

One-photon absorption fluorescence is the simplest and most widely used imaging technique in laboratories. It directly uses the phenomenon of absorption of the excitation photons emitted by a monochromatic source to directly generate fluorescence photons. This process is called a linear process because the absorption of a photon results in the generation of a fluorescence photon, making the intensity of the generated signal proportional to that of the incident signal.

Multi photon absorption

Let's consider that the energy necessary to activate the transition from an electron to an excited state is E " hc{λ where h corresponds to the Planck's constant, c the speed of light and λ the wavelength of the incident photon. One can think of an alternative way to activate this transition not with a single photon but with the accumulation of several photons. To obtain fluorescence photons resulting from the simultaneous absorption of several photons, it is therefore necessary to excite the fluorophore with photons whose energy is a sub-multiple of the transition energy of the molecule. This means that, for example, to achieve two photon absorption, photon energy should be equal to half the single photon absorption energy of the fluorophore. Figure 1.1 illustrates the emission process in the case of single, two and three photon absorption. Since the likelihood of such phenomena is low, this will require a large number of photons in the same place and at the same time to hope to achieve sufficient levels of fluorescence. Thus, it is necessary to carry out a spatio-temporal concentration of the photons. Spatial 1.2. Two photon microscopy and its limitations concentration will be achieved using a lens with a large numerical aperture, while the use of femtosecond pulsed laser sources will allow the temporal concentration of the photons. These very short pulses delivered by the laser make it possible to retain an average power of the incident beam sufficiently low so as not to damage the samples while having a gigantic peak power, making the local density of photons sufficient for the effect to be possible.

Two photon microscopy

The two photon absorption phenomenon was first predicted by [Göppert-Mayer, 1931] and then observed 30 years later by [START_REF] Kaiser | Two-photon excitation in ca f 2: Eu 2+[END_REF]. It consists in the simultaneous absorption by a molecule of two photons of energy E i causing the deexcitation of the latter by the emission of a fluorescence photon of energy E f " 2E i .

The wavelength of the excitation photons must be then equal to λ i " 2λ f , where λ F represents the wavelength of the fluorescence photon.

The first application in an organic medium was performed by [START_REF] Peticolas | Double photon excitation in organic crystals[END_REF]. Some years later, laser microscopy based on two photon absorption was proposed by [START_REF] Sheppard | Resonant scanning optical microscope[END_REF]. The first experimental application of the laser microscopy based on two photon absorption was reported by [START_REF] Denk | Two-photon laser scanning fluorescence microscopy[END_REF].

Two photon microscopy uses a pulsed laser source emitting in the near infrared to excite the fluorescent markers. This technology offers the possibility of imaging at large depths (the pyramidal layer of CA1 being approximately 200 µm deep under the imaging window) and the use of a scanning microscope will allow in vivo observation of this region at a rate large enough to measure neuronal activity. The advantages of this technique related to the conventional fluorescence microscopy relies in two facts:

• Since the two photon absorption process is non-linear, an enormous photon density is required. Therefore, only the area where the excitation laser is most confined allows to sufficiently concentrate the photons to generate the fluorescence. This constraint makes it possible to have a highly localized fluorescence photon emission volume.

• The second advantage is due to the excitation wavelengths required to obtain the two photon effect. In fact, the working wavelengths must be in the nearinfrared, which positions us in the so-called window of the water. Since the tissues are composed of 70% water, working in the near-infrared will allow us a better penetration in the tissue compared to the wavelengths in the visible range.

Limitations in biological imaging

By the use of two photon microscopy it is possible to observe epileptic events in the hippocampus [START_REF] Muldoon | Gabaergic inhibition shapes interictal dynamics in awake epileptic mice[END_REF] but also to observe the cells taking part in the processes of spatial memory [Villette et al., 2015]. However, as explained above, on the upper layer of the hippocampus CA1, one measures an epileptic event in this region that results of an event located elsewhere in the hippocampus or temporal lobe.

In order to obtain more detailed information on the origin of the epileptic events but also on the processes originating the propagation of the information in the hippocampus, it is necessary to image the dentate gyrus (Figure 1.2). However, even with the use of microscopy techniques allowing deep fluorescence imaging, the dentate gyrus (DG) is positioned far too deep in the brain (about 500 µm below the pyramidal layer of CA1) to be observed with the conventional techniques currently available. In fact, the imaging quality of the system will decrease as one enters the tissue and thus will gradually decrease the amount of fluorescence photons generated. The progressive deterioration of the imaging conditions will be caused by the diffusion and absortion of the exciting photons and by optical aberrations generated by the sample itself, the effects of which will increase with the portion of matter traversed by the incident wave. These disturbances will thus evolve during the crossing of the pyramidal layer of CA1 but also when the incident wave will encounter the region having a strong presence of blood vessels lying exactly between the end of CA1 and the beginning of the dentate gyrus.

Optical aberrations alter the quality of beam focusing, which in turn leads to reduced spatial resolution but also to lower signal and contrast. Thus, even when objects of interest are one order of magnitude larger than the diffraction limited laser focus (e.g. neurons' somas are 10 ´15 µm in diameter), the reduction of optical aberrations is critical to increase the contrast of the fluorescence images. This improvement can be achieved using adaptive optics, a promising tool increasingly used for microscopy [Booth, 2014;Kubby, 2013;Booth et al., 2015]. Its contribution to two photon microscopy gives the possibility of greatly reduce the impact of optical aberrations on the incident wave. This makes it possible to retain sufficiently good excitation properties to attempt to reach the dentate gyrus (approximately 700 µm deep) and thus allows imaging the origins of the hippocampus neuronal activity.

I will now present the principles and equations that describe the propagation of Gaussian beams and the image formation based on Fourier optics. Then, in Sect. 1.5, I present a summary of the most recent adaptive optics methods used to correct these aberrations

Propagation of Gaussian excitation beams

in two photon microscopy.

Propagation of Gaussian excitation beams

The propagation of the Gaussian excitation beam is described by the electromagnetic field equation [Verdeyen, 1995].

Epx, y, zq " E 0 ˆw0 wpzq exp " ´r2 w 2 pzq  ˆexp " ´i ˆkz ´tan ´1 ˆz z R ˙˙ ˆexp " ´i kpr 2 q 2Rpzq  (1.1)
where, r " x 2 `y2 is the radial distance from the center axis of the beam, z is the axial distance from the beam's focus, k " 2π{λ is the wave number for a wavelength λ,

wpzq " w 0 d 1 `ˆλz πw 2 0 ˙2 " w 0 d 1 `ˆz z R ˙2, (1.2)
is the radius at which the field amplitudes fall to 1{e of their axial values, at the plane z along the beam, w 0 " wpz " 0q is the waist size,

Rpzq " z « 1 `ˆπw 2 0 λz ˙2ff (1.3)
is the radius of curvature of the beam's wavefront at z and

z R " πw 2 0 λn (1.4) is called the Rayleigh distance.
The first term in Eq. (1.1) describes the amplitude of the field as a function of the radial coordinate r and how this changes as the beam propagates along z (Figure. 1.3).

The intensity of the excitation beam, also called focal volume or 3D point spread function (3D PSF), is represented by the squared modulus of the electromagnetic field equation:

hpr, zq " |Epr, zq| 2 " E 2 0 ˆw2 0 w 2 pzq ˆˆexp " ´r2 w 2 pzq ˙2 . (1.5)
The peak of the 3D PSF is then given by E 0 . Assuming that E 0 " 1, the evolution of the 3D PSF along the z-axis (optical axis) is given by the following equation:

hpr " 0, zq " |Epr " 0, zq| 2 " w 2 0 w 2 pzq . (1.6)
At a distance from the waist equal to the Rayleigh distance z R , the width w of the beam is ? 2 larger than it is at the focus where w " w 0 the beam waist Extracted from [Verdeyen, 1995]. The 1{e point of the field is plotted as a function of the z coordinate. As the beam propagates along z, the spot size, w, becomes larger; hence, the 1{e points become farther from the axis. The beam expands from its minimum value of w 0 by a factor of ? 2 when z " z 0 the Rayleigh distance (to avoid a misunderstanding later in this thesis I adopted the notation z R instead of z 0 to represent the Rayleigh distance).

wpz R q " w 0

d 1 `ˆz R z R ˙2 " ? 2w 0 . (1.7)
We then obtain that .8) the intensity of the excitation beam drops in half at z " z R .

hpr " 0, z " z R q " w 2 0 w 2 pz R q " 1 2 , ( 1
In two photon microscopy the 3D PSF is equivalent to calculated the square of the single photon 3D PSF. We obtain then: .9) This means that the axial resolution r z for two photon 3D PSF can be estimated taking the value z 1 where h 2 pr " 0, z " z 1 q " 1 4 .

h 2 pr " 0, z " z R q " ˆw2 0 w 2 pz R q ˙2 " 1 4 . ( 1
In microscopy, the half of angle of divergence θ of the Gaussian beam is related to the numerical aperture NA " n sin θ (1.10) and the waist can then be defined by the expression: .11) The Rayleigh distance can also be expressed as a function of the numerical aperture:

w 0 " λn πNA . ( 1
z R " πw 2 0 λn " π λn ˆλn π ˙2 1 NA 2 " λn πNA 2 .
(1.12)

PSF and image formation 13

The axial resolution can be defined as 2 times de Rayleigh distance, so:

r z " 2z R " 2λn πNA 2 (1.13)
and the transverse resolution is often defined by the waist r xy " w 0 " λn πNA . (1.14) This model (Eq. (1.1)) is an accurate description of the propagation of the excitation beam, however it does consider neither the diffraction effects induced by the finite aperture nor the perturbation of the wavefront phase induced by the optical aberrations.

Point spread function and image formation through a finite aperture and in the presence of aberrations

I present here the imaging formation process and the general equations, based on Fourier optics, that allow to calculate the 3D point spread function for a finite aperture and in the presence of aberrations. Optical aberrations induced by the biological medium distort the wavefront phase of the excitation beam degrading its confinement and consequently reducing the fluorescence excitation.

Modal representation of aberrations

In order to easily manipulate the phase, it is usual to express the wavefront phase on a discrete mode basis. A very frequently used basis is the basis of the Zernike polynomials [Zernike, 1934]. It is in this base that the phase will be described throughout the remainder of this manuscript.

Zernike polynomials

The infinite number of Zernike polynomials form an orthonormal mathematical basis where the radial and azimuthal components are separable. This basis presents many interests to microscopy:

• the Zernike basis is defined is a circular domain;

• the first polynomials correspond to the most frequent optical aberrations;

The Zernike polynomials are represented for p0 ď r ď 1q by: .16) where m, n P IN are the radial and azimuthal components.

Z j pr, θq " Z m n pr, θq " $ & % ? n `1R m n prq ? 2 cospmθq for m ‰ 0, j even; ? n `1R m n prq ? 2 sinpmθq for m ‰ 0, j odd; ? n `1R 0 n prq ? 2 for m " 0; (1.15) with R m n prq " pn´mq{2 ÿ k"0 p´1q k pn ´kq! k!ppn `mq{2 ´kq!ppn ´mq{2 ´kq! r n´2k , ( 1
A conventional mapping of the two indices n and m to a single index j has been introduced by [Noll, 1976].The association Z m n Ñ Z j for the first 11 modes (sequence A176988 in the OEIS) is presented in Fig. 1.4.

Phase decomposition

The decomposition of the phase on the basis of Zernike polynomials is given by: ϕ "

N ÿ i"1 a i Z i (1.17)
where a i represent the decomposition coefficients, called Zernike coefficients, with N the number of modes considered.

3D Point Spread Function (3D PSF)

The point spread function (PSF) affected by the set of aberrations a " xa 1 , ..., a N y can be theoretically calculated through the inverse Fourier transform of the complex amplitude of the back aperture by the following expression:

h a px, yq " |F ´1 tApρ x , ρ y qu | 2 (1.18)

PSF and image formation

where Apρ x , ρ y q " P pρ x , ρ y qGpρ x , ρ y q exp ti ϕpρ x , ρ y qu (1.19) represents the complex amplitude of the back aperture. Here

P pρ x , ρ y q " " 1 if ||pρ x , ρ y q|| 2 ď D{2 0 otherwise
represents de pupil back aperture, G represents the excitation light distribution on the back aperture and ϕ represents the wavefront phase. In this thesis, a Gaussian distribution is considered to represent the excitation light distribution on the back aperture. I will also briefly discuss in Chapter 3 the use of an uniform distribution and the pertinence of it to overcome some limitations that I will present in this thesis.

The PSF can be extended to the axial direction by extending the representation of the complex amplitude to the axial direction. This can be done by different approaches. I will explain in Sect. 2.2 p. 28 the approach adopted to calculate the 3D PSF for each depth z.

The 3D point spread function (hereafter called 3D PSF) h a is described by:

h a px, y; zq " |F ´1 tApρ x , ρ y ; zqu | 2 . (1.20)
The optical transfer function can be computed through the 2D Fourier Transform of each 2D PSF:

OTFpf x , f y ; zq " Fth a px, y; zqu (1.21) The cutoff frequency is given by:

f p1q c " 2NA λn . (1.22) I denote it f p1q c
to precise that it is the single photon cutoff frequency. The transverse resolution of the PSF can be defined by the inverse of the cutoff frequency of the PSF: .23) Another definition is the full width at half the maximum (FWHM) .24) The axial resolution can be defined as the distance, along the axial direction, between the maximum and the first minimum of intensity [Sibarita, 2005]:

r xy " 1{f p1q c " λn 2NA . ( 1
r xy " FWHMphq « λn 2NA . ( 1
r z " 2λn NA 2 .
(1.25)

Chapter 1. AO for two photon microscopy

Two photon 3D Point Spread Function (3D PSF 2 )

In two photon microscopy, the two photon fluorescence excitation is directly proportional to the square value of the power density of the excitation light at the focal volume. So, the focal volume of the two photon excitation beam (3D PSF 2 ) is given by: frequency is then given by:

f p2q c " 4NA λn (1.27)
and consequently, the transverse resolution in two photon microscopy is .28) One can also measure the full width as one quarter of the maximum (FWQM), which corresponds to the FWHM of the single photon 3D PSF r xy " FWQMph 2 q " FWHMphq « λn 2NA .

r xy " λn 4NA . ( 1
(1.29)

Chapter 1. AO for two photon microscopy

Following the same definition of the single photon 3D PSF case, the two photon 3D PSF 2 axial resolution remains

r z " 2λn NA 2 .
(1.30)

Image formation

A z-stack image is obtained by the 3D-convolution of the 3D PSF 2 with the sample distribution η:

I 3D px, y; zq " h 2 a px, y; zq ‹ 3D ηpx, y; zq " h 2 a px ´x1 , y ´y1 ; z ´z1 q ¨ηpx 1 , y 1 ; z 1 q dx 1 dy 1 dz 1 .
(1.31)

A transverse scan at z " z 0 is obtained by integrating along z the transverse 2Dconvolution of each plane of the 3D PSF 2 centered at z " z 0 with the sample distribution η:

I 2D px, y; z " z 0 q " h 2 a px ´x1 , y ´y1 ; z 0 ´z1 q ¨ηpx 1 , y 1 ; z 1 q dx 1 dy 1 dz 1 " ż " h 2 a p¨, ¨, z 0 ´z1 q ‹ 2D ηp¨, ¨, z 1 q ‰ px, yq dz 1 . (1.32)
The return flux, or mean image intensity, of the transverse scan at z " z 0 can be calculated by the expression: M 1 pa; z " z 0 q " I 2D px, y; z " z 0 q dx dy " ż " h 2 a p¨, ¨, z 0 ´z1 q ‹ 2D ηp¨, ¨, z 1 q ‰ px, yq dz 1 dx dy.

(1.33)

Correction of aberrations by adaptive optics

Adaptive optic is a technique, developed first for astronomy, that allows to correct in real-time, with an adaptive element such as a deformable mirror (DM), the deformations of the phase measured by a wavefront sensor.

The first idea of this system was published by [Babcock, 1953] and the first astronomical demonstration has been made by [START_REF] Rousset | First diffraction-limited astronomical images with adaptive optics[END_REF]. A more detailed description of the principle of classical adaptive optics systems can be found in [Roddier, 1999].

Adaptive optics has been, in the last 20 years, applied in ophthalmology [START_REF] Roorda | Adaptive optics ophthalmoscopy[END_REF] and microscopy [Booth, 2014]. A more detailed presentation of the application of adaptive optics to biological imaging can be found in [Kubby, 2013].

One of the main challenges of the integration of an adaptive optics system in scanning fluorescence microscopy is the aberration measurement. It is this challenge that drives this PhD work. Figure 1.7 is a schematic illustration of an adaptive optics system for two photon scanning microscope.

Both direct methods, using wavefront sensors, and indirect methods, using optimization Chapter 1. AO for two photon microscopy routines, have been employed in recent years for two photon microscopy. I discuss in this section the main methods and their limitations.

Direct methods for aberration correction

Conventional wavefront sensing devices, such as the Shack-Hartmann sensor, are widely used in adaptive optics. However, their use in microscope systems are strongly limited. The return flux is strongly multi-diffused and, due to their cromaticity, one can not efficiently correct at the wavelength of excitation (red) the aberrations measured in the visible range (green).

To overcome this, one should use specific fluorescent markers which two photon emission wavelength is near to the excitation wavelength [START_REF] Wang | Direct wavefront sensing for high-resolution in vivo imaging in scattering tissue[END_REF] or fluorescent beads [START_REF] Aviles-Espinosa | Measurement and correction of in vivo sample aberrations employing a nonlinear guide-star in two-photon excited fluorescence microscopy[END_REF]. The first approach was demonstrated to be able to perform a direct wavefront measurement down to 700 µm depth in the mouse cortex in vivo.

Yet, these approaches require the injection of additional markers/beads that may affect the biological properties or the behavior of the living mouse. Also, they are not compatible with many other bio-imaging applications, requiring thus the preparation of animal models for a specific application, which can not be easily performed in all laboratories.

A solution to this issue could be the use of auto-fluorescent feature of the sample to produce the localized point source [START_REF] Azucena | Adaptive optics wide-field microscopy using direct wavefront sensing[END_REF][START_REF] Aviles-Espinosa | Measurement and correction of in vivo sample aberrations employing a nonlinear guide-star in two-photon excited fluorescence microscopy[END_REF][START_REF] Tao | Live imaging using adaptive optics with fluorescent protein guide-stars[END_REF]Tao et al., 2013].

Indirect methods for aberration correction

The most common approaches to aberration correction in adaptive optic microscopy are based on indirect measurements, where the wavefront phase is not measured directly with a dedicated sensor, but rather via a sequence of measurements obtained with the science imaging channel. These methods are easier to implement as they only require an adaptive element in the illumination path. These methods can be divided in two categories: intensity-based methods and imagebased methods.

In intensity-based methods, the aberrations are estimated through the maximization of the return flux of a single fixed point (no scan is used) [Tang et al., 2012;Galwaduge et al., 2015]. Image-based methods, rely on successive image measurements with an engineered illuminating laser beam displaying different spatial shapes either in intensity (pupil segmentation) or in phase (modal sensorless). We concentrate here in image-based methods since for heterogeneous media, such as the mouse brain, images provide useful information for the wavefront estimation.

The pupil segmentation approach

The pupil segmentation [Ji et al., 2010] technique is based on the acquisition of sub-pupil scan images, the various sub-pupils being distributed so as to pave the full pupil. [Ji et al., 2010] have shown (see Fig. 1.8 for illustration) that shifts observed between two sub-pupil scan images are related to the differential wavefront slope (local tilt) between sub-pupils. This approach can therefore be seen as an adaptation of the Shack-Hartmann wavefront sensor to the context of laser scanning two-photon imaging where the return beam can not be directly used for wavefront sensing. This method has been implemented in two photon microscopes, successfully correcting aberrations at depths over 400 µm in brain tissue [Ji et al., 2012] and has the advantage to be able to estimate large aberration amplitudes. However, this method, using the fluorescence signal is considered slow: with a small pupil segment, the diffraction effect increases leading to a strongly reduced signal, whose detection requires longer integration time making it impracticable for in vivo. [START_REF] Wang | Multiplexed aberration measurement for deep tissue imaging in vivo[END_REF]. In this thesis I don't study this approach but I will discuss this disadvantage of the pupil segmentation method (see Sect. 2.5 p. 50).

The modal sensorless approach

The modal sensorless wavefront sensing approach (originally developped for two photon microscopy by [START_REF] Débarre | Image-based adaptive optics for two-photon microscopy[END_REF]) is a very common method used to estimate aberrations in many different applications [START_REF] Débarre | Image based adaptive optics through optimisation of low spatial frequencies[END_REF]Débarre et al., 2008;[START_REF] Jesacher | Adaptive harmonic generation microscopy of mammalian embryos[END_REF]Olivier et al., 2009;[START_REF] Bourgenot | 3d adaptive optics in a light sheet microscope[END_REF][START_REF] Gould | Adaptive optics enables 3d sted microscopy in aberrating specimens[END_REF][START_REF] Antonello | Optimization-based wavefront sensorless adaptive optics for multiphoton microscopy[END_REF][START_REF] Wong | In vivo imaging of human photoreceptor mosaic with wavefront sensorless adaptive optics optical coherence tomography[END_REF]Wahl et al., 2016;[START_REF] Tao | A three-photon microscope with adaptive optics for deep-tissue in vivo structural and functional brain imaging[END_REF].

This method is based on an iterative procedure that aims at optimizing the deformable mirror correction in order to optimize an image quality metric (see illustration on Fig. 1.9). In two-photon microscopy [START_REF] Débarre | Image-based adaptive optics for two-photon microscopy[END_REF] selected, as a metric, the maximization of the mean image intensity M 1 (Eq. (1.33)). They have shown that this criterion can be expressed, in the small phase approximation, as a quadratic form in the aberration coefficients. The optimum aberration coefficients can then be deduced from full aperture scan images recorded with an adequate sequence of trial aberrations. For a correction by N aberration modes, one has to record pK ´1qN `1 or KN scans, with K between 3 and 9, depending on the chosen trial strategy [Facomprez et al., 2012]. This technique has been demonstrated with great success on ex vivo biological samples [Zeng et al., 2012;Facomprez et al., 2012].

The ability to estimate aberrations with the minimal image acquisition is important to avoid the exposure of the sample which can increase the photobleaching effect. This PhD work concentrates on the modal sensorless wavefront sensing approach.

Chapter 1. AO for two photon microscopy

Sample dependence of the modal sensorless approach

With the modal sensorless approach it is expected that the mean image intensity metric is maximized when there are no aberration in the system. However, for certain spatial distributions of fluorophores, the modal sensorless method may lead to a biased wavefront estimation. This so-called sample dependence was observed by [START_REF] Débarre | Structure sensitivity in third-harmonic generation microscopy[END_REF]Olivier et al., 2009;Thayil et al., 2010] for THG microscopy. [Thayil et al., 2010] performed a detailed study of this phenomenon for THG, where different sample geometries were considered. In this study the authors also briefly demonstrated the sample dependence for two photon microscopy: they consider two thin fluorescent layers axially separated by a distance larger than twice the diffractionlimited axial resolution. When the focus is located between the two layers, a negligible amount of fluorescence is detected in a diffraction-limited system. When aberrations are added, the axial spreading of the 3D PSF can lead to an increase in the detected signal at this point, even though the total detected signal drops (see Fig. 1.10). This effect in two photon microscopy is also mentioned by [Zeng et al., 2012;Galwaduge et al., 2015] but has never been strictly studied. In this PhD thesis I perform a detailed study of the aberrations impact and of the sample dependence on two photon microscopy.

Displacement-free approach to reduce the sample dependence

It was observed that the image shifts induced by some aberration modes are one of the effects at the origin of the sample dependence. It was therefore proposed to build a new modal basis that does not induce transverse and axial displacements [Thayil and Booth, 2011;Facomprez et al., 2012], the so-called displacement-free mode.

The displacement-free approach [Thayil and Booth, 2011] consists in the construction of a new mode basis Z' " pZ 1 1 , ..., Z 1 n q which result from the combination of Zernike modes Z " pZ 1 , ..., Z n q with tip, tilt and defocus such that Z' do not induce any transverse or axial 3D PSF displacements. The relative displacements for each direction are estimated by an image cross-correlation method. This process is performed as a calibration step with a specimen consisting of glass beads (of approximate diameter 10 µm) suspended in gelatin. For example, the axial displacement estimation consists in the following steps:

1. the DM is set such that all system aberrations are corrected and a reference z-stack I 0 px, y; zq is acquired;

2. a chosen amplitude a i of a basis mode Z i was added to the DM and a new z-stack I 1 px, y; z; a i q is acquired;

3. Then, the relative displacement between the two z-stacks is calculated by finding the value of z 1 that maximizes the correlation given by: R z pz 1 ; a i q "

x,y;z I 0 px, y; zq I 1 px, y; z ´z1 ; a i q dx dy dz ;

(1.34) 4. After repeating step 2. and step 3. for a range of different mode amplitudes a set of z-stack displacements is obtained. Then, from a linear fit to the measurements, the slope of this linear fit or "gradient" s z i is used to quantify the amount of image displacement per unit amplitude of basis mode Z i .

The procedure is then repeated for each basis mode Z i and for each direction. Assuming that the effects of each mode add linearly, the total image displacements s can be derived from the measurements and are represented by the matrix equation Chapter 1. AO for two photon microscopy s " Ma , (1.35) where s " ´řN i"1 s x i a i ,

ř N i"1 s y i a i , um
ř N i"1 s z i a i ¯and the N coefficients a i are the elements of the vector a. The elements of the 3 ˆN matrix M are the values s x i , s y i and s z i . Finally, the displacement modes (tip, tilt and defocus) are removed from the basis modes Z providing the displacement-free basis modes Z' using the orthogonal projection calculation:

Z 1 " `I ´M: M ˘Z.
( 1.36) where M : is the pseudo inverse of M M : " pM T Mq ´1M T (1.37)

The matrix `I ´M: M ˘is the projection matrix that removes the 3D displacement components.

This approach is based on the assumptions that displacements induced by a summation of aberration modes add linearly and on a stronger assumption that, for a given mode, the displacements are linearly dependent on the mode coefficient. I intend to test the validity of this second assumption.

Conclusion

Two photon scanning microscopy is limited by optical aberrations induced by the biological medium. These aberrations can be corrected using adaptive optics. However, the direct measurement of the aberrated wavefront requires the injection of specific additional markers that may affect the biological properties or the behavior of the living mouse and are not compatible with some other bio-applications. We must then use indirect methods to estimate the aberrated wavefront. The pupil segmentation approach can perform a good correction of aberration up to 400 µm but it is considered slow due to a longer integration time of the fluorescence emission. The modal sensorless wavefront sensing approach has the advantage to perform an efficient aberration estimation with few image acquisitions of short exposition to the excitation beam.

In this PhD work I concentrate my study on the modal sensorless wavefront sensing approach.

Chapter 2

Study of the impact of aberrations on two photon microscopy

There are several techniques to estimate and correct the aberrations induced by biological media. I discussed them in Chapter 1 and this discussion led us to select the modal sensorless approach. The modal sensorless approach consists in the maximization of an image quality metric by changing the shape of a deformable mirror (DM) which controls the excitation beam wavefront phase. The shape of the DM that maximizes this metric is expected to pre-compensate the aberrations induced by both the optical setup and the biological medium. The Standard Modal Sensorless (SMS) approach uses the mean image intensity M 1 (Eq. (1.33) p. 18) of the transverse scan as a quality metric and the wavefront phase is expanded on a basis of Zernike modes (Sect. 1.4.1.1 p. 13).

Here, the tip, tilt and defocus modes (also called displacement modes) are excluded as they only induce a translation effect in the image in both transverse and axial directions.

To perform a good estimation of aberrations it is important to physically understand the impact of aberrations and of the sample on the image quality metric. Before performing a study of the Standard Modal Sensorless (see Chapters 3 & 4), I first study the impact of aberrations both on the two photon excitation beam and on the mean image intensity M 1 . I therefore aim at answering the following questions:

• Could we describe by a simple analytical expression the interplay between the two photon excitation beam focal volume (also known as two photon excitation 3D point spread function, denoted here 3D PSF 2 ) and the sample structure?

• What are the properties of the 3D PSF 2 : axial and transverse resolution, influence of aberrations?

• What is the sensitivity of the mean image intensity M 1 to aberrations? How does it evolve with the sample geometry? And the numerical aperture? How does it evolve in the N -dimensional space of aberrations? Can we approximate M 1 by a quadratic function?

I decided to study all these aspects through refined numerical simulations. Thus, I

A new mathematical formulation for the mean image intensity as a function of aberrations

In Sect. 1.4 p. 13 I defined the mean image intensity M 1 of a transverse scan at depth z " z 0 by the equation:

M 1 pa; z " z 0 q " I 2D px, y; z " z 0 q dx dy " ż " h 2 a p¨, ¨, z 0 ´z1 q ‹ 2D ηp¨, ¨, z 1 q ‰ px, yq dz 1 dx dy (2.1)
where h 2 a represents the 3D PSF 2 which depends on the aberrations a, η represents the sample, ‹ 2D represents the 2D-convolution and I 2D px, y; z " z 0 q represents the transverse scan obtained at z " z 0 . The focusing depth of the excitation beam corresponds to z 0 " 0. This formulation implicitly assumes that the field of view encompasses the entire sample on the transverse scan. By changing the integration order and using the equality ş IR n f pxq dx " F tf u p0q, where F stands for a 2D Fourier transform, we obtain:

M 1 pa; z " z 0 q " ż " h 2 a p¨, ¨, z 0 ´z1 q ‹ 2D ηp¨, ¨, z 1 q ‰ px, yq dx dy dz 1 " ż " F h 2 a pz 0 ´z1 q ( p0, 0q ˆF ηpz 1 q ( p0, 0q ‰ dz 1 " ż " h 2 a px, y; z 0 ´z1 q dx dy ˆ ηpx, y; z 1 q dx dy ı dz 1 " ż h 2 a pz 0 ´z1 q ˆηpz 1 q dz 1 (2.2)
where

h 2 a pz 1 q " h 2 a px 1 , y 1 ; z 1 q dx 1 dy 1 (2.3)
and

ηpz 1 q " h 2 a px 1 , y 1 ; z 1 q dx 1 dy 1 (2.4)
are called hereafter the axial distribution of, respectively, the 3D PSF 2 and the sample (integrated along the transverse coordinates). Equivalently,

M 1 pa; z " z 0 q " ż | h 2 a pz 1 ´z0 q ˆηpz 1 q dz 1 (2.5)
where

| h 2 a pz 1 q " h 2 a p´z 1 q (2.6)
represents the flipped axial distribution of the 3D PSF 2 . In what follows I will call combined axial distribution the multiplication of the 3D PSF 2 axial distribution Chapter 2. Study of the impact of aberrations h 2 a pz 0 ´z1 q with the sample axial distribution ηpz 1 q, or equivalently, the multiplication of the flipped 3D PSF 2 axial distribution | h 2 a pz 1 ´z0 q with the sample axial distribution ηpz 1 q: h 2 a pz 0 ´z1 q ˆηpz 1 q " | h 2 a pz 1 ´z0 q ηpz 1 q.

(2.7)

These two equivalent equations (2.2) and (2.5) will later be useful to understand the interaction of the 3D PSF 2 with the sample. This new formulation makes explicit the interplay between the 3D PSF 2 (embedding the influence of aberrations) and the sample distribution. More precisely, it shows that the mean image intensity M 1 does not depend on the transverse distribution of the sample, it depends only on the 3D PSF 2 axial distribution and on the sample axial distribution. I will show in Chapter 3 the importance of this observation.

Modeling the numerical two photon microscope

To study the impact of aberrations in two photon microscopy one needs to simulate the image formation process. To this aim, I developed a numerical microscope which consists in computing the two photon 3D PSF 2 and convolving it with a numerical sample to obtain a z-stack image. With this tool, on the one hand I can study the evolution of the 3D PSF 2 for different aberrations, which will give us a better understanding of the aberrations impact on the excitation beam. On the other hand I can study the evolution of the z-stack image and of the quality metric for different aberrations, sample distribution and numerical aperture.

The computation of the 3D PSF 2 is based on the construction of the single photon 3D PSF using Eq. (1.20) p. 15. Then I compute the square of this 3D PSF to obtain the two photon 3D PSF 2 . This could be generalized to n-photon microscopy by taking the n-th power of the single photon PSF.

Simulation of the 3D PSF for single and two photon imaging

The computation of the single photon 3D PSF along the axial direction is performed plane by plane by computing the single photon 2D PSF at different values of depth z. To simulate this axial displacement, I use a defocus method which consists in introducing a supplementary amount of defocus on the complex amplitude phase. Thus, the equation that describes the complex amplitude in the back aperture plane (illustrated in Fig. 2.1) becomes:

Apρ x , ρ y ; zq " P pρ x , ρ y qGpρ x , ρ y q exp tpi ϕpρ x , ρ y q `i a d pzqZ 4 pρ x , ρ y qu (2.8)

where

P pρ x , ρ y q " " 1 if ||pρ x , ρ y q|| 2 ď D{2 0 otherwise (2.9)
represents the pupil back aperture support, Gpρ x , ρ y q the illumination distribution on 2.2. Modeling the numerical two photon microscope 29 the back aperture,

ϕpρ x , ρ y q " N ÿ i"1 a i Z i pρ x , ρ y q (2.10)
the wavefront phase and 2.11) corresponds to the amount of defocus that must be added to simulate a 2D PSF at a distance z from the focal plane, where NA represents the numerical aperture, λ the wavelength of the excitation beam and n the refractive index of the medium (see Appendix A p. 127). Note that using a defocus (therefore a parabolic wave-front rather than a portion of sphere) is an approximation for the computation of the 3D PSF in the various transverse planes along z. It could be of course interesting to investigate the consequences of this approximation. This aspect is however beyond the scope of the present study. The truncated Gaussian distribution is the multiplication of the Gaussian distribution Gpρ x , ρ y q with a binary mask P pρ x , ρ y q representing the back aperture. The complex amplitude is calculated by multiplying the truncated Gaussian distribution with the exponential of the phase plus the right amount a d of defocus that must be added to simulate a 2D PSF at a distance z from the focal plane.

a d pzq " πNA 2 2 ? 3λn z (
Numerically, a set of z values is fixed by defining the number of z values N z to simulate and the pitch δ z (distance between two consecutive values of the set). By multiplying these two values we obtain the axial excursion of the 3D PSF:

∆ z " δ z ˆNz . (2.12)
The axial excursion is explored symmetrically around the focusing plane z " 0, i.e., z P r´∆ z {2, ∆ z {2s.

I compute the square modulus of the inverse 2D Fourier transform of each complex amplitude to obtain then, for each value z, a single photon PSF: .13) For each value z, the 2D optical transfer function can be computed through the 2D

h a px, y; zq " |F ´1 tApρ x , ρ y ; zqu | 2 . ( 2
Chapter 2. Study of the impact of aberrations Fourier Transform of the PSF:

OTFpf x , f y q " Fth a px, y; zqu. (2.14) The cutoff frequency is given by:

f p1q c " 2 NA λn .
(2.15)

I denote it f p1q c
to specify that it is the single photon cutoff frequency. The transverse resolution of the PSF is defined by the inverse of the cutoff frequency of the PSF:

r xy " 1{f p1q c " λn 2 NA . (2.16)
The Nyquist-Shannon theorem states that in order to adequately sample a signal it should be periodically sampled at a rate that is at least two times the highest frequency of the signal. In our case, to reproduce the single photon PSF adequately, it should be sampled at at least two times its cutoff frequency. The sampling frequency is then given in the form:

s f " 2k ˆf p1q c " 4kNA λn , k ě 1.
(2.17)

Consequently, the pixel size of the 2D PSF is given by the inverse of the sampling frequency:

δ xy " λn 4k NA , k ě 1. (2.18)
For k " 1 we obtain the Nyquist-Shannon sampling frequency for the single photon PSF.

For k ą 1 we are oversampling, which can be useful to observe a more detailed single photon 2D PSF.

In practice, for each value z, I compute the back aperture plane complex amplitude in a N xy ˆNxy size array, where N xy represents the number of pixels that represents the diameter D of the back aperture diameter. In order to fulfill the Nyquist-Shannon criterion for the single photon PSF, it can be shown that one has to perform a zeropadding on the complex amplitude Apρ After ensuring that each computed PSF array (one for each value of z) has a unitary total energy, i.e., x,y h a px, yq dx dy " 1, I stack them together to form the 3D PSF. Then, we just compute the two photon 3D PSF (3D PSF 2 ) by taking the square of the single photon 3D PSF. However, it can be easily shown that, since we take the square of the PSF, the two photon PSF is more confined and its OTF is twice as large as the single-photon OTF.

Equivalently, the two photon cutoff frequency is twice larger than the single photon cutoff frequency: .20) Consequently, by the Nyquist-Shannon criterion, the sampling frequency should be at least two times the two photon cutoff frequency

f p2q c " 2f p1q c " 4 NA λn . ( 2
s f " 2k ˆ2f p2q c " 8k NA λn , k ě 1 ô s f " 4k 1 NA λn , k 1 ě 2 (2.21)
and the pixel size should be .22) This shows that, in practice, to adequately sample the two-photon 3D PSF 2 , one must consider at least a double zero-padding (k ě 2) in the computation of the single photon 3D PSF.

δ xy " λn 8k N A , k ě 1 ô δ xy " λn 4k 1 N A , k 1 ě 2. ( 2
Once the 3D PSF 2 array is constructed, one can convolve it with a numerical sample array (through the multiplication of the respective Fourier transform) to obtain a z-stack image. To avoid any effect of aliasing of the field of view during the convolution, one has to perform a single 3D zero-padding on both arrays before computing the respective Fourier transforms (see Fig. 2.4). Now, one can use the 3D PSF 2 and the z-stack image to study the aberration impact on the excitation beam confinement and the resulting image quality. One can also study the impact of the sample distribution on the image quality.

Chapter 2. Study of the impact of aberrations To summarize, I present in Table 2.1 the list of parameters that are important for the computation of the 3D PSF 2 . The parameters to be chosen are the oversampling factor k (which defines the transverse sampling frequency), the number of pixels used to represent the diameter of the back aperture N xy , the number of planes N z and the pitch δ z . The remaining quantities are deduced from these four parameters.

In order to study the evolution of the image quality metric as a function of aberrations, one must define an adequate set of simulation parameters for each array such that the computation time is not too demanding and the 3D PSF 2 is correctly simulated. This is the object of Sect.

Choice of the transverse sampling in two photon imaging

As defined before, to respect the Nyquist-Shannon criterion, the sampling frequency should be equal to 4k NA λn , with k ě 2, for the computation of the two photon PSF.

In Figure 2.5 is illustrated the single and two photon 2D PSF at the focusing depth and their respective 2D OTF's (absolute values) when considering the sampling factor k " 2.

One can verify that the two photon 2D PSF is more confined than the single photon 2D PSF, which results in a larger 2D OTF. The lower left plot shows a transverse cut of the single and the two photon 2D PSF. One can observe the "Airy rings" which are created due to the diffraction of the excitation beam and a first minimum located at x « 1.5 λn 2 NA . I will discuss in Sect. 2.3 the effects of the Gaussian illumination distribution on the PSF's structures. In the lower right plot of Figure 2.5 are illustrated the two transverse cuts of the single and two photon 2D OTF's at the focusing depth (blue and red curves). The two cutoff frequencies f p1q c and f p2q c can clearly be identified at 2 NA{λn and 4 NA{λn respectively. It is also illustrated what would occur to the 2D OTF if the two photon 2D PSF was constructed by considering an oversampling factor k " 1: the part of the 2D OTF (red curve) which is located after 2 NA{λn is folded into the lower frequencies (purple dashed curve) and then it is added to the 2D OTF resulting in the green dashed curve. This changes the 2D OTF shape, however it does not change the value of the 2D OTF at the zero frequency: the quantity that is folded at the zero frequency is the value of the 2D OTF at the cutoff frequency f p2q c , which is equal to zero.

From Equation (2.2) one can observe that the mean image intensity metric M 1 at a given depth z 0 can be expressed by integrating, along the axial direction z, the multiplication of the 3D PSF 2 axial distribution at a given depth z 0 which corresponds to the multiplication of the associated 2D OTF at zero-frequency with the sample axial distribution:

M 1 pa; z " z 0 q " ż F h 2 a ( p0, 0, z 0 ´z1 q ˆηpz 1 q dz 1 . (2.23)
The 2D OTF at the zero-frequency does not change if one undersamples the 3D PSF 2 , provided that k ě 1 and consequently the value of M 1 is also preserved. Thus, in order to compute the mean image intensity of a transverse scan, I can take k " 1 to reduce the size of the numerical arrays and consequently to reduce the computation time.

Choice of the back aperture diameter in pixels

In what follows, the figures are presented in physical units. For that, I used the settings of the experimental bench presented in Sect. 3.6, i.e. excitation beam wavelength in air λ " 0.92 µm, medium refractive index n " 1.33 (water) and numerical aperture NA " 0.8.

To simulate the aberrated 3D PSF 2 I explore two different Zernike modes separately (coma and spherical aberrations). I also use a set of seven different aberration amplitudes adapted from the set of amplitudes presented in Fig. 2.6 and extracted from [START_REF] Wang | Direct wavefront sensing for high-resolution in vivo imaging in scattering tissue[END_REF].

Aberrations are the two astigmatisms (Z 5 , Z 6 ), the two comas (Z 7 , Z 8 ), the two trefoils (Z 9 , Z 10 ) and the spherical aberration (Z 11 ). We discard here the tip, tilt and defocus (Z 2 , Z 3 , Z 4 , also called displacement modes) as they only induce translations of the image in both transverse and axial directions. This set of aberration amplitudes is multiplied by a scalar to obtain a chosen amplitude (σpaq (2.24)

" b ř N i"5 a 2 i ).
The mean image intensity of the scan obtained at the focusing depth and diffraction-limit is given by the integration of the two-photon 3D PSF 2 :

M 1 pz " 0q " ż h 2 pz 1 q ˆηpz 1 q dz 1 " c ż h 2 pz 1 q dz 1 , c P IR " c h 2 px, y, z 1 q dx dy dz 1 , c P IR `. (2.25)
We obtain then a metric that globally involves all the planes of the 3D PSF 2 .

In Figure 2.7 is illustrated the evolution of M 1 as a function of the number of pixels N xy in the back aperture for different aberrations. In each case k " 1, which results in a pixel size of « 0.3824 µm, and the axial sampling parameters were chosen to match the parameters that will be defined later in Sect. 2.2.4 (δ z " 0.375, N z " 401 ô ∆ z " 150 µm). One can observe that for 64 pixels one obtains non physical results with higher values of M 1 when the 3D PSF 2 is aberrated.

From 128 to 512 pixels, M 1 value increases monotonically and tends to converge. With respect to the maximum number of pixels simulated (512 pixels), we obtain for 256 pixels an underestimation of the mean image intensity of « 0.5%.

To better understand this figure, the two photon 2D PSF 2 's at the farthest plane from the focusing depth (z 0 " 0) are illustrated in Figure 2.8 for different values of N xy and for different level of aberrations including the diffraction-limited case. I am interested in the farthest plane, because it is where the 3D PSF 2 becomes the largest and where we can observe the strongest impact of N xy , i.e., the field of view.

One can observe that for 64 pixels, at the plane most distant from the focus plane, the aberrated PSF 2 's (and also the diffraction-limited one) are too large to fit in the simulated field of view hence a strong field aliasing (Figure 2.8 first row). One should consider a higher number of pixels. By increasing the field of view one eventually encompasses the 3D PSF 2 which results on the convergence of M 1 on Fig. 2.7.

Regarding the computation time1 , the simulation of a 3D PSF 2 with a 512 pixel pupil width takes around 18.5 seconds to compute. The equivalent 3D PSF 2 with 256 pixels takes around 4.3 seconds (4 times faster). I consider that, by using N xy " 256, the gain in computation time is very advantageous considering that I only have a reduction of M 1 of « 0.5%. Thus, in what follows, unless specified otherwise, we will consider 256 ˆ256 pixels to represent the pupil, which in our case corresponds to a « 196ˆ196 µm transverse field of view (512 ˆ512 pixels on the image plane).

Difraction-limited

Choice of the axial sampling parameters: pitch and axial excursion

As explained before, the 3D PSF is constructed plane by plane using a defocus in pupil plane to simulate an axial displacement. Choosing the number of planes N z and the pitch δ z means computing a 3D PSF 2 along the axial excursion ∆ z " δ z ˆNz . It is possible to make the pitch δ z very small to obtain a very detailed 3D PSF 2 , however for a given choice of ∆ z it would take a large number of planes to represent the 3D PSF 2 and consequently a large computation time.

In order define appropriate axial sampling parameters, for both diffraction-limited and aberrated 3D PSF 2 , one should explore the two parameters simultaneously. I will first set δ z to 0.1 µm which is much smaller than the axial resolution of the 3D PSF 2 approximated by (see Sect. 1.4.2 p. 14):

r z « 2λn NA 2 ñ r z « 3.8 µm. (2.26)
Then, I calculate M 1 at the focusing depth for different axial excursion ∆ z (between 10 and 250 µm) and for an uniformly infinite sample.

As the axial excursion increases the numerical array encompasses a larger fraction of the 3D PSF 2 . It is then expected a convergence of M 1 as the axial excursion increases.

Here, I simulate the diffraction-limit, the Wang's set of aberration with 5 rad rms of amplitude and the spherical aberration with 5 rad rms of amplitude.

Figure 2.9 illustrates the evolution of M 1 , at the focusing depth, as a function of the axial excursion ∆ z for these different aberrations and for the diffraction-limited case.

Chapter 2. Study of the impact of aberrations

We can verify the convergence of M 1 for all scenarios. The convergence is obtained at around 100 µm for the most demanding case. Thus, for the considered aberration levels, any axial excursion larger than 100 µm can be used. Unless otherwise specified, I take an additional margin and I will consider an axial excursion of 150 µm. Now, with a fixed 150 µm axial excursion, I calculate M 1 as a function of δ z for all aberration levels considered before and for the same sample. Figure 2.10 illustrates the results.

δ z [µm] 0 1 2 3 4 5 6
Normalized M 1 (a;z 0 =0) 0.9 One can observe an important difference between the diffraction-limited case and the aberrated ones: for δ z ą 2 µm, the values M 1 for the diffraction-limited case severely increases while the aberrated cases do not vary considerably. Indeed, the 3D PSF 2 when diffraction-limited is more confined than in the presence of aberrations, it therefore requires a finer axial sampling to obtain a accurate estimation of M 1 . Any δ z lower than 2 µm would be suitable to the simulation of the 3D PSF 2 imposed by the diffractionlimited case.

In two-photon microscopy and for a truncated Gaussian excitation beam the axial resolution is approximately r z « 3.8 µm (see Sect. 2.3). The value δ z " 2 µm is therefore not surprising since it approximately corresponds to half of the axial resolution r z {2 « 1.9 µm.

In the 3D PSF 2 simulations, unless specified otherwise, I take an additional margin and I will consider a pitch δ z " 0.375 µm for the axial sampling parameters. This value also corresponds to the sampling of a specific numerical sample that I will use in Chapter 3 and 4.

Default simulations parameters

In summary the analysis of the simulations parameters and of their influence on the estimation of the metric M 1 (see Sect. NA " 0.8 the numerical aperture of the microscope, λ " 0.92 µm the wavelength of the excitation beam, n " 1.33 the refractive index of the medium in which is inserted the objective of the microscope (water) and r xy " λn{p2 NAq " 0.765 µm the transverse resolution.

Characterization of the diffraction-limited 3D PSF 2

In this section, I discuss the evolution of the transverse and axial resolution in the diffraction-limited case for different scenarios: uniform illumination of a finite back aperture, Gaussian distribution illumination (for different values of waist) on a finite back aperture and Gaussian distribution illumination without back aperture truncation. This study requires a fine sampling on the 3D PSF 2 . I therefore do not use the default sampling parameters of Table 2.2. I use instead the parameters given by Table 2

Characterization of the 3D PSF 2 in the transverse directions

Figure 2.11 illustrates the transverse cuts at the center of the diffraction-limited 3D PSF 2 (y " 0) obtained at the focusing plane (z " 0) for each considered illumination distribution case.

For the uniform distribution illumination of a finite back aperture (black continuous curve) we retrieve the cut of the square of a classic Airy pattern with a first zero located at x " 1.22 λn 2NA . The red continuous curve corresponds to the non-truncated Gaussian distribution illumination case with waist w " 0.5D, derived from the theoretical Gaussian beam equations (see Sect. 1.3 p. 11). This Gaussian beam case, of course, exhibits neither zeros nor rings. The red dashed curve represents the case of a truncated Gaussian distribution illumination still with w " 0.5D. The truncation creates secondary lobes (diffraction effect) enlarging the excitation beam relatively to the non-truncated case. The curve resembles the Airy pattern (black continuous curve) but is slightly wider: the first minimum is located at « 1.5 λn 2NA . We can also observe that with a reduced waist w " 0.25D (blue dashed curve) the 3D PSF 2 is even wider and now resembles to the case of a non-truncated Gaussian illumination distribution. With a larger waist w " D and w " 2D (yellow and green dashed curves), the truncated Gaussian distribution converges towards the Airy pattern.

As presented in Sect. 1.4 p. 13, the transverse resolution of a two photon 3D PSF 2 can be estimated as the full width at one quarter of the maximum (FWQM) to match the full width at half maximum (FWHM) of the single photon 3D PSF. A smaller FWQM results in a better resolution. For non-truncated Gaussian distribution cases, the transverse resolution can be defined by the waist (see Sect. 1.3 p. 11), i.e., the distance at which the field amplitude fall to 1{e of the maximum. This is equivalent to the distance at which the field intensity drops to 1{e 2 and to 1{e 4 of the maximum for the single and the two photon 3D PSF respectively. In this Figure, the horizontal red dashed line represents the quarter of the maximum. The horizontal blue dashed line represents the 1{e 4 of the maximum.

For the non-truncated case, the FWQM is « 2 ˆ0.2868 µm « 0.57 µm. The distance where the 3D PSF 2 is equal to 1{e 4 is « 0.5 µm. One can observe that the two measured transverse resolutions match. For the truncated back aperture cases (dashed curves and black continuous curve) the FWQM is at least « 2ˆ0.3983 µm « 0.8 µm. From Eq. 2.16, the transverse resolution for a truncated pupil can be expressed by r xy " λn{p2NAq « 0.765 µm which approximately matches the measured FWQM. We observe here, that the truncation of the back aperture clearly induces an enlargement of the transverse resolution.

Characterization of the 3D PSF 2 in the axial direction

For what concerns the axial direction, I illustrate in Fig. 2.12 the axial cuts through the center of the 3D PSF 2 (x " 0, y " 0) for each pupil case.

x λn 2NA -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 x λn 2NA -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 x[µm] -2 -1.5 -1 -0.5 0 0.5 1

44

Chapter 2. Study of the impact of aberrations The transverse resolution is given by the full width of the 3D PSF 2 at the quarter of its maximum. All plots are normalized to their maximum.

z 2λn NA 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 z[µm] -8 -6 -4 -2 0 2 4 6 8

Characterization of the 3D PSF 2 in the presence of aberrations 45

One can observe for the uniform distribution illumination case (black continuous curve) the side lobes induced by the back aperture truncation. As presented in Sect. 1.4 p. 13, the axial resolution can be defined as the distance, along the longitudinal axis, between the maximum of intensity and the first minimum of intensity which corresponds to the equation r z " 2λn NA 2 « 3.8 µm. The red continuous curve corresponds to the non-truncated Gaussian distribution illumination case with waist w " 0.5D, derived from the theoretical Gaussian beam equations (see Sect. 1.3). The FWQM is « 2 ˆ0.6 µm « 1.2 µm. The distance where the 3D PSF 2 is equal to 1{e 4 is « 1.5 µm. The two measured transverse resolutions approximately match. The red dashed curve represents the case of a truncated Gaussian distribution illumination with waist w " 0.5D. Similarly to the case of the truncated uniform distribution illumination, the truncation creates secondary lobes. The first minimum can still be observed at z " 2λn NA 2 as in the case of the truncated uniform distribution. The FWQM is « 2 ˆ1.7 µm « 3.4 µm. This approximately matches with the definition of axial resolution for truncated back apertures: r z « 3.8 µm. The truncation also enlarges axially the 3D PSF 2 confinement relatively to the non-truncated case. This enlargement is a lot more accentuated than in the transverse direction. As we observed for the transverse cuts, the reduction of the waist also enlarges the 3D PSF 2 in the axial direction (blue dashed curve) relatively to the case of waist w " 0.5D. The increasing of the waist tends to converge the truncated Gaussian distribution to a truncated uniform distribution resulting on the overlap between the green and black curves.

To summarize, the theoretical equation for the propagation of Gaussian beams (Eq. (1.1) p. 11) can not be used to correctly characterize the propagation of the excitation beam through the finite back aperture. As one could expect, the truncation by the back aperture widens the 3D PSF 2 in both transverse and axial directions, with the axial direction being more impacted.

Characterization of the 3D PSF 2 in the presence of aberrations

In this section I study the impact of aberrations on the 3D PSF 2 . I simulate two 3D PSF 2 's with 2 rad of coma aberration and 2 rad of spherical aberration respectively.

Here, the 3D PSF 2 's are simulated with a truncated Gaussian distribution illumination and a waist w " 0.5D. To better observe the effects of the aberrations on each 3D PSF 2 , I consider the same sampling parameters as those used in Sect. 2.3 except the oversampling factor which was set to k " 8 instead of k " 24 (see Table 2.3).

Figure 2.13 illustrates three different 2D profiles of the 3D PSF 2 for 2 rad of coma aberration. These cuts were extracted at the position px, y, zq where the 3D PSF 2 is maximal.

We can observe that the coma aberration induces a transverse displacement on the main lobe of the 3D PSF 2 . It also induces an elongation of this lobe in both transverse and axial directions, the elongation being more accentuated in the axial direction.

Figure 2.14 illustrates the three cuts that cross the maximum of the 3D PSF 2 for 2 rad of coma aberration.

As expected, one can verify the elongation of the 3D PSF 2 . The FWQM corresponds now to 8.4 µm instead of 3.4 µm, a degradation of the 3D PSF 2 axial resolution by a factor 2.47 relatively to the diffraction-limited case. We can also observe a larger transverse resolution: « 3.11 µm in the x-direction and « 1.06 µm in the y-direction instead of 0.8 µm on both directions on the diffraction-limited case. This represents a degradation of the 3D PSF 2 transverse resolution by a factor 3.89 and 1.33 on each direction respectively.

For what concerns the spherical aberration, Fig. 2.15 illustrates three different 2D profiles of the 3D PSF 2 for 2 rad of spherical aberration. These profiles were extracted at the point where the 3D PSF 2 is maximal. We can observe that the spherical aberration induces an axial displacement (and not transverse) of the main lobe of the 3D PSF 2 . It also induces an elongation of this lobe in both transverse and axial directions.

In Figure 2.16 I illustrate the three cuts that cross the maximum of the 3D PSF 2 for 2 rad of coma aberration. We can verify that the FWQM has increased to « 9.9 µm. When diffraction-limited the FWQM is « 3.4 µm. This represents an degradation of the 3D PSF 2 axial resolution by a factor 2.9.

We can also observe a larger FWQM: « 1.2 µm in both transverse directions instead 2.4. Characterization of the 3D PSF 2 in the presence of aberrations 47

x µm ). The maximum of the 3D PSF 2 is located at x " ´1.44 µm, y " 0 µm and z " 0 µm. (upper) Cut along the transverse x direction (y " 0, z " 0); (center) Cut along the transverse y direction (x " ´1.44 µm, z " 0 µm); (lower) Cut along the axial z direction (x " ´1.44 µm, y " 0 µm); The red dashed horizontal curve represents the quarter of the maximum. The transverse resolution is given by the full width of the 3D PSF 2 at the quarter of its maximum of 0.8 µm of the diffraction-limited case. This represents a degradation of the 3D ). The maximum of the 3D PSF 2 is located at x " 7.9 µm, y " 0 µm and z " 7.9 µm. (upper) Cut along the transverse x direction (y " 0 µm, z " 7.9 µm); (center) Cut along the transverse y direction (x " 0 µm, z " 7.9 µm); (lower) Cut along the axial z direction (x " 0 µm, y " 0 µm); The red dashed horizontal line represents the quarter of the maximum. The transverse resolution is given by the full width of the 3D PSF 2 at the quarter of its maximum.

Evolution of M 1 as a function of aberrations and numerical aperture

I discuss in this section the evolution of the mean image intensity M 1 in the presence of different levels of aberrations, for different numerical apertures. As the numerical aperture is directly related to the back aperture diameter (NA " D{2f ), in order to increase/decrease NA one can respectively increase/decrease the back aperture diameter D.

In the discussion of the pupil segmentation approach (Sect. 1.5.2 p. 20), we recalled that recording transverse scans with a reduced aperture is often considered as a limitation.

It is indeed known that, when diffraction-limited, reducing the numerical aperture increases the diffraction effects on the 3D PSF 2 resulting in a reduction of the value of M 1 proportional to NA 2 . Through a detailed analytical analysis and numerical simulations, I verify here that, for a uniform planar object, the mean image intensity is proportional to NA 2 when diffraction-limited.

In the presence of aberrations, one can expect that, for a large numerical aperture, the value of M 1 is mainly dictated by aberrations. Thus, one should be able to reduce NA with no significant reduction of M 1 . This behavior has been shown by [Meimon et al., 2014a] considering a planar uniform sample and using analytical developments with strong approximations. This behavior is here demonstrated.

An other interesting limit case to consider for the sample is the 3D uniform case. It can be shown in this case that, when diffraction-limited and considering a uniform back aperture distribution, the mean image intensity M 1 does not depend on the numerical aperture. I demonstrate it here through an analytical analysis and numerical simulations. I also evaluate numerically if this independence is verified in the case of a Gaussian beam with fixed waist truncated by an aperture of variable diameter. The evolution of M 1 as a function of aberrations and numerical aperture is also verified for the 3D uniform sample.

Analytical analysis of M 1 for the diffraction limited case

M 1 as a function of numerical aperture for a planar sample

Consider a uniform planar sample at the focusing depth z 0 " 0, i.e. a uniform sample concentrated only in a unique plane.

ηpz 1 q " δpz 1 q pdelta Diracq.

(2.27)

The mean image intensity of the scan obtained at z 0 " 0 at the diffraction-limit is given by the integral of the two photon PSF at the focusing depth:

M 1 pz " 0q " ż | h 2 pz 1 q ˆηpz 1 q dz 1 " ż | h 2 pz 1 q ˆδpz 1 q dz 1 " ż h 2 pz 1 " 0q dz 1 " h 2 px, y, z 1 " 0q dx dy.
(2.28)

Evolution of M 1 as a function of aberrations and NA

51 Hypothesis 1: We adjust the laser power so that the flux of the excitation beam that passes through the back aperture is constant regardless of the selected diameter of the back aperture (let's say unitary flux). As a consequence:

h α px, y, z 1 q dx dy " 1, @z 1 @α (2.29)
where h α px, y, z 1 q represents the 3D PSF 2 obtained by reducing the back aperture by a factor α.

Hypothesis 2: Changing the numerical aperture by a factor α, i.e. NA α " αNA, is to perform a homothecy of a factor α to the complex amplitude of the back aperture plane. Consequently:

h α px, y, z 1 q " γh 1 pαx, αy, α 2 z 1 q (2.30)
where h 1 is the 3D PSF 2 obtained with the full diameter back aperture (α " 1) and γ is a scalar factor. Hypothesis 1 implies that @z 1 h 1 px, y, z 1 q dx dy " h α px, y, z 1 q dx dy " 1 ñ γ h 1 pαx, αy, α 2 z 1 q dx dy " 1

x " αx, y " αy, dx dy " dx dy

α 2 ñ γ α 2 h 1 px, y, α 2 z 1 q dx dy loooooooooooooomoooooooooooooon "1 " 1 ñ γ " α 2 .
(2.31) Therefore:

h α px, y, z 1 q " α 2 h 1 pαx, αy, α 2 z 1 q. (2.32)
Thus, the mean image intensity at the focusing plane for a numerical aperture NA α , which is denoted by M α 1 becomes

M α 1 pz " 0q " h 2 α px, y, z 1 " 0q dx dy " " α 2 h 1 pαx, αy, z 1 " 0q ‰ 2 dx dy " α 4 h 2 1 pαx, αy, z 1 " 0q dx dy x " αx, y " αy, dx dy " dx dy α 2 " α 2 h 2 1 px, y, z 1 " 0q dx dy looooooooooooooomooooooooooooooon "M 1 1 ô M α 1 pz " 0q " α 2 M 1 1 pz " 0q ñ M α 1 pz " 0q 9 NA 2 (2.33)
where M 1 1 pz " 0q is the mean image intensity at the focusing depth obtained with a full diameter back aperture. We have verified that, at diffraction-limit and with a planar sample, M 1 is proportional to NA 2 .

Chapter 2. Study of the impact of aberrations

M 1 as a function of numerical aperture and for a 3D uniform sample

Let us consider a 3D sample. In particular a 3D uniformly distributed sample (see Eq. 2.24). The mean image intensity of the scan obtained at z 0 " 0 at the diffractionlimit is given by the integration of the two-photon 3D PSF 2 (see Eq. 2.25).

From Hypothesis 1 and Hypothesis 2 and from Eq. 2.32 we have that the mean image intensity at the focusing plane for a numerical aperture NA α becomes

M α 1 pz " 0q " c h 2 α px, y, z 1 q dx dy dz 1 " c α 4 h 2 1 pαx, αy, α 2 z 1 q dx dy dz 1
x " αx, y " αy, z' " α 2 z 1 , dx dy dz 1 " dx dy dz' α 4

" c h 2 1 px, y, z'q dx dy dz'

" c M 1 1 pz " 0q, c P IR `(2.34)
We demonstrate here the well known property that states that, at the diffraction limit and for a 3D uniform sample, the mean image intensity does not depend of the numerical aperture.

Remark:

The Hypothesis 2 related to the homothecy in the back aperture plane applies when considering a uniformly illuminated back aperture plane with variable diameter and also to the case of a non-truncated Gaussian beam with variable waist. It does not strictly apply to the case of a Gaussian beam with fixed waist truncated by an aperture of variable diameter. This case is of course the most relevant in practice and will be treated in the numerical analysis that follows.

Numerical analysis of M 1 as a function of NA and of aberrations

In this section, I make use of the numerical microscope. To simulate the 3D PSF 2 with a reduced numerical aperture, I reduce the diameter of the back aperture but keeping the excitation beam distribution and the phase defined on the full back aperture D. Figure . 2.17 illustrates the procedure. The aberrations used are the usual Wang's set of aberration with a adjustment of the amplitude. When comparing the different numerical apertures, I normalize each 3D PSF 2 to ensure that the same quantity of energy passes through the back aperture following the Hypothesis 1 of Sect. 2.5.1.1. This is verified by setting the integral of the 2D PSF at each plane equal to 1.

Here, I intend to use the default parameters presented in .17: Computation of the complex amplitude Apρ x , ρ y ; zq for a reduced back aperture. α represents the factor reduction: for example, α " 1 correspond to the full back aperture diameter and α " 0.5 correspond to a truncation by half of the full back aperture diameter. The truncated Gaussian distribution is the multiplication of the Gaussian distribution Gpρ x , ρ y q with a binary mask P pρ x , ρ y q representing the reduced back aperture. The complex amplitude is calculated by multiplying the truncated Gaussian distribution with the exponential of the phase plus the right amount a d of defocus needed to axially displace the PSF.

Evolution of M 1 as a function of numerical aperture and of aberrations for a planar sample

Here, I intend to analyze the evolution of M 1 as a function of numerical aperture and of aberrations for a planar sample and for different illumination distributions. We consider both the truncated Gaussian distribution (with waist w " D{2) and the truncated uniform distribution. Figure 2.18 presents the results. One can observe that, in the case of the uniform illumination, M 1 follows a clear quadratic dependence in NA when diffraction-limited. This is consistent with the analytical analysis of Sect. 2.5.1.1. For the case of a truncated Gaussian beam, it follows a similar trend although not strictly quadratic. One can also observe, that for large numerical apertures, M 1 is mainly dictated by the aberrations as suggested by [START_REF] Meimon | Sensing more modes with fewer sub-apertures: the lifted shack-hartmann wavefront sensor[END_REF]. One can therefore somewhat reduce the numerical aperture with no significant reduction of M 1 . In this example, one can observe that M 1 can even be increased with a reduced numerical aperture. Of course, eventually for small numerical apertures the beam is again diffraction-limited and M 1 follows again the quadratic trend.

Evolution of M 1 as a function of numerical aperture and of aberrations for a uniform 3D sample

I analyze here the evolution of M 1 as a function of the numerical aperture and of aberrations for a uniform 3D sample. We consider the same two illumination cases of the previous section.

Verification of the axial excursion simulation parameter:

In Sect. 2.5.1.2 we recall that, when imaging a uniform 3D object, the mean image intensity is obtained by integrating the 3D PSF 2 along the three directions (see Eq. 2.25). Of course, in the numerical simulations one has to limit the computation domain and in particular, the axial excursion ∆ z . The results presented in Fig. 2.19 are therefore given for variable ∆ z values in order to check convergence. Of course the convergence is more difficult to obtain in the case of small numerical apertures since the focal volume is very extended in this case.

As said before, it is expected for the uniform distribution illumination case that M 1 does not depend on the numerical aperture. One can observe that the mean image intensity remains globally constant when reducing the back aperture diameter (colored dashed curves). When ∆ z " 150 µm, we observe a reduction of « 6% and « 2% of M 1 when reducing the back aperture respectively to 0.3D and 0.5D (blue dashed curve). This reduction is clearly a numerical effect induced by the limited axial excursion. As we can observe, for an axial excursion of 750 µm there is almost no reduction of M 1 (green dashed curve).

In the case of the variable truncated Gaussian distribution, since the Hypothesis 2 from Sect. 2.5.1.1 does not apply, one do not expect a constant mean image intensity when reducing the numerical aperture. Indeed, one can observe that M 1 decreases monotonically as NA decreases (continuous curves). Also, along with the reduction of NA, the Gaussian distribution illumination converges to a uniform distribution. This justify the convergence of M 1 values, at small NA, to the values of M 1 obtained for the uniform distribution illumination case.

To analyze the behavior of M 1 in the presence of aberrations and different NA values, I compute M 1 as a function of the back aperture diameter for different aberration amplitude (Wang's set of aberration) and different illumination distribution for a uniform 3D sample. This time, the results are given for a fixed ∆ z " 150 µm. Figure . 2.20 presents the results. For comparison, the curves from Fig. 2.18 for the diffraction-limited case with ∆ z " 150 µm are plotted again (blue curves). Analogously to the case of the planar sample, 56

Chapter 2. Study of the impact of aberrations one can observe that for large numerical apertures M 1 is dictated by the aberrations (red and yellow curves). One can reduce the numerical aperture with no reduction of M 1 . In this example, one can even obtain a large increase of M 1 by reducing the diameter. With a fixed numerical aperture, for example α " 1, one can observe that M 1 is sensitive to aberrations. This indicates that one would be able to perform a standard modal sensorless approach to estimate aberrations in a fluorescent dye pool, i.e. with a 3D infinite uniform sample. I analyze with further details the sensitivity of M 1 to aberrations for different sample geometries in the next section.

Evolution of M 1 as a function of aberrations and sample structure

The efficiency of the modal sensorless approach is related (among other factors) to the sensitivity of the image quality metric to aberrations. I investigate here the the evolution of M 1 at the focusing depth as a function of aberration amplitudes (Wang's set of aberrations) for different sample geometries (fluorescent bead and fluorescent uniform slab). I do not consider here any aspects related to the signal to noise ratio. For instance, one can quantify the sensitivity for a given set of aberrations a 0 (for example σpa 0 q " 1 rad rms) with the ratio

R " M 1 pa " 0, z " z 0 q ´M1 pa " a 0 , z " z 0 q M 1 pa " 0, z " z 0 q . (2.35)
R quantifies the relative decrease of the metric with aberrations. Large values of R represent a better sensitivity.

Alternatively the sensitivity to aberrations can be quantified by the amount of aberration a 0 one needs to introduce to obtain half the metric at diffraction-limit:

a 0 : M 1 pa " a 0 , z " z 0 q " 0.5 M 1 pa " 0, z " z 0 q. (2.36)
This metric is equivalent to computing the aberration amplitude a for which R " 0.5. First, we observe that, for any bead radius, the maximum is obtained in the absence of aberration. We obtain a higher sensitivity of M 1 for any aberration amplitudes for the small fluorescent beads (continuous blue curve to yellow curve). One can observe that between a 1 µm diameter bead (blue continuous curve) and a 2 µm diameter bead (light red dashed curve) there is no noticeable difference. Indeed, we observed in Sect. 2.3 that, in the case of a truncated Gaussian distribution illumination, the axial resolution is not smaller than « 3.4 µm when diffraction-limited. Then, structures with size smaller than the axial resolution can not be distinguished, resulting in the same impact in M 1 .

Uniform fluorescent bead with varying diameter

For a 1 µm diameter bead (blue continuous curve), the ratio is R " 0.71. The second sensitivity metric is equivalent to measuring the half width at half maximum (HWHM) of the curve. One obtains a HWHM for σpa 0 q " 0.72 rad rms.

For a very large bead with a diameter of 60 µm (blue dashed curve) and with σpa 0 q " 1 rad rms of aberration amplitude, one obtain a ratio of R " 0.3. In this case, one obtains a HWHM for a 0 " 2 rad rms.

For each sensitivity metric respectively, M 1 is 2.4 and 2.8 times more sensitive than in the case of the 60 µm diameter bead.

Another case of interest is the 10 µm diameter bead, which is representative of a neuron soma. One can observe that, for 1 rad of aberration amplitude, one obtains a ratio R " 0.5. M 1 has a good sensitivity to aberrations when considering a 10 µm bead. We obtain a higher sensitivity of M 1 for any aberration amplitudes for the finer fluorescent slabs. Between a 1 µm thick slab (blue continuous curve) and a 2 µm thick slab (light red dashed curve) there is no noticeable difference in what concerns the sensitivity to aberrations. I recall that structures which size is smaller than the axial resolution can not be distinguished, resulting in the same impact in M 1 .

Uniform fluorescent slab with varying thickness

For a 1 µm thick slab (blue continuous curve), the ratio is R " 0.71 and one obtains a HWHM for σpa 0 q " 0.71 rad rms.

For a slab with a thickness of 60 µm (blue dashed curve) and with σpa 0 q " 1 rad rms of aberration amplitude, one obtain a ratio of R " 0.28 and a HWHM at a 0 " 2.2 rad rms.

For each sensitivity metric respectively, M 1 is 2. To summarize, M 1 has a good sensitivity to aberrations for small and large samples. The modal sensorless wavefront sensing approach can be performed with a sample with large features, like neuron's somas (between 10 and 15 µm diameter). It could even be performed in a infinite uniform 3D sample such as a fluorescent dye pool.

Note also that, when imaging at very large depths, the signal to noise ratio is very weak, the large quantities of aberrations degrade the 3D PSF 2 resolution and one is not able to observe the small features of the sample. The results here presented ensure us that the wavefront sensing could be performed at large depth if one is able to image large structures.

Evolution of M 1 in the N -dimensional aberration space

In the first application of the modal sensorless approach to two-photon microscopy [START_REF] Débarre | Image-based adaptive optics for two-photon microscopy[END_REF] it is stated that, for weak aberrations, the mean image intensity can be approximated by a quadratic approximation 2.37) where M 0 represents the metric value when diffraction-limited, a i and a j represent the coefficients of the Zernike modes Z i and Z j respectively and xZ i , Z j y the correlation between the two modes.

M 1 paq « M 0 ´ÿ i,j a i a j xZ i , Z j y, (
In order to understand how M 1 evolves for a large range of aberration amplitudes, I intend here to observe, through 2D projections, the evolution of M 1 in the N -dimensional space of aberrations and to verify in which domain of aberration a quadratic function is a good approximation. I use then the numerical microscope to measure M 1 at the focusing depth as a function of two aberrations simultaneously when scanning a 10 µm in-focus fluorescent bead.

For each aberration I explore a range of amplitudes between -5 and 5 rad rms. The aberrations explored are the astigmatism (Z We observe that for small aberration amplitudes, between approximately -1 and 1 rad rms, the mean image intensity is well approximated by a quadratic function. But, when looking at higher amplitudes, the evolution becomes more complex and a quadratic approximation is no longer appropriate. This 2D projections allow to evaluate the eigenvectors of the mean image intensity. One can observe, from the illustrated 2D projections, that in a regime of weak aberration amplitudes, the Zernike mode basis correspond to the eigenvectors of M 1 . Observe in Fig. 2.26 the case of Z 5 and Z 11 : if one draw an ellipse that represents all the points where M 1 is equal to a constant (to stay on a regime of weak aberrations let us consider a constant near to the maximum: 0.7), the minor and major axes of the ellipse (the eigenvectors of M 1 ) are parallel to the cartesian axes. This indicates that the Zernike modes form a orthoganal basis mode for M 1 , but only in a regime of weak aberrations.

When in a regime of strong aberration amplitudes the notion of eigenvectors is however no longer applicable as one can not draw such ellipse.

Conclusion

In this chapter I performed a general study of the impact of aberrations in two photon microscopy. I presented a new mathematical expression that describes the mean intensity M 1 of a transverse scan as a function of aberrations and of the sample axial distribution. This new formulation makes explicit the interplay between the 3D PSF 2 (embedding the influence of aberrations) and the sample distribution. More precisely, it shows that the mean image intensity M 1 does not depend on the transverse distribution of the sample, it depends only on the 3D PSF 2 axial distribution and on the sample axial distribution.

Then, I modeled a numerical microscope which consists in the computation of the two photon 3D PSF 2 and in its convolution with a numerical sample to obtain a z-stack image.

With this numerical microscope I verified the different definitions of transverse and axial resolutions. And I characterized the main 3D PSF 2 deformations caused by the coma and spherical aberrations. We observed that the coma aberration displace the main lobe of the 3D PSF 2 in the transverse directions and elongate it mainly in the axial direction. We also observed that the spherical aberration displaces and elongates the 3D PSF 2 along the axial direction. I will show in Chapter 3 how these displacement and elongation effects can be problematic when estimating aberrations with the modal sensorless approach. I also studied the impact of aberrations on the mean image intensity for different numerical apertures and different sample distributions. I could observe that, for larger values of NA, M 1 is dictated by the aberrations. One can therefore reduce the numerical aperture without reducing the mean image intensity. This result shows that the pupil segmentation still can be an interesting approach to the wavefront sensing. I verified that for an in-focus sample the mean image intensity is maximized in absence of aberrations. M 1 is more sensitive to aberrations when imaging small structured samples. But, we still have a good sensitivity to aberrations when imaging very large structures. This ensures that one can perform an estimation of aberrations by the modal sensorless approach at larger depths where only the larger structures can be imaged. Finally, we observed that the mean image intensity does not have a quadratic dependence on aberrations in a regime of strong aberrations. For the lower modes studied, the Zernike mode basis correspond globally to the eigenvector of M 1 in a regime of weak aberration amplitudes. For a regime of strong aberrations, some aberrations present a important crosstalk between them.

To summarize, I performed a detailed study of the impact of aberrations, numerical aperture and sample structure on the mean image intensity. I used some very simple sample examples as a planar sample uniformly distributed, a infinite uniform 3D sample, in-focus beads and in-focus slabs.

In Chapter 3 and 4, I will study the modal sensorless approach for an in-focus bead, and also for an out-of-focus bead. We will see how a more complicated sample can affect the mean image intensity and the Standard Modal Sensorless approach.

Chapter 3

Aberration estimation: Standard Modal Sensorless (SMS) and Axially-Locked Modal Sensorless (ALMS) approaches

As the mean image intensity M 1 depends both on aberrations and on the sample's axial distribution, one may wonder how the sample can impact the aberration estimation procedure. In Sect. 2.4 p. 45 I presented the impact of aberrations on the 3D PSF 2 . I observed that the spherical aberration displaces the 3D PSF 2 in the axial direction. Also, I observed that the coma aberration elongates the 3D PSF 2 symmetrically along the axial direction. When imaging a densely labeled biological medium, the presence of coma or spherical aberration can create the optical illusion of being focused on a feature of interest when, in reality, the feature is out-of-focus. One may wonder how this phenomenon associated to a labeled sample with bright out-of-focus features may affect the aberration estimation.

In this chapter I present the Standard Modal Sensorless (SMS) approach. We will see that, when performing SMS for some particular sample structures, the image quality metric is maximized when aberrations are present. This phenomenon induces a bias in the estimation of aberrations, this corresponds to the so-called sample dependence problem. It has been observed [START_REF] Débarre | Structure sensitivity in third-harmonic generation microscopy[END_REF]Olivier et al., 2009] and studied [Thayil et al., 2010], in third harmonic generation (THG) microscopy, for different sample structures. This effect in two photon microscopy has been also briefly discussed [Thayil et al., 2010;Zeng et al., 2012;Galwaduge et al., 2015] but it has never been strictly studied. I intend here to elaborate this study for two photon microscopy. I discuss the several attempts to solve the sample dependence In particular, I demonstrate that the displacement-free approach does not fully solve the problem.

To fully overcome the sample dependence, we developed a new approach that we call Axially Locked Modal Sensorless (ALMS). This approach does not require the construction of a new set of modes and is based on an automatic and controlled adjustment 66 Chapter 3. The SMS & the ALMS approaches of focusing depth to target a feature of interest by the use of a specifically designed image quality metric. The ALMS approach is then demonstrated on ex and in vivo experiments. The test bench used to execute this experiment is also presented.

In Section 3.1 I present the standard modal sensorless approach for an in-focus fluorescent bead. In Section 3.2 I present an example of the sample dependence problem and I discuss in Sect. 3.3 the limitations of the displacement-free approach. After a brief summary of other approaches in Sect. 3.4, I describe in Section 3.5 the ALMS approach, detailing the aspects of the choice of the image quality metric. Section 3.6 presents the experimental demonstration of the ALMS approach. And in Sect.

Standard modal sensorless for an in-focus fluorescent bead

The modal sensorless approach estimates the aberrations through the maximization of an image quality metric by adjusting a deformable mirror (DM) to control the excitation beam wavefront phase. The shape of the DM that maximizes this metric is expected to pre-compensate the aberrations induced by both optical setup and biological medium.

The standard approach uses the mean image intensity of the transverse scan M 1 (Eq.

Standard modal sensorless for in-focus bead

67

(1.33) p. 18) as a maximization metric and the wavefront phase is expanded on a basis of Zernike modes (Sect. 1.4.1.1 p. 13). Here, the tip, tilt and defocus modes (also called displacement modes) are excluded as they only induce a translation effect in the image in both transverse and axial directions. Additionally, in experimental tests, M 1 is globally decreasing along the depth because of the increase of scattering and absorption effects. So, adjusting the defocus mode while maximizing M 1 would progressively result in moving the focusing depth to the surface of the sample. For this reason, the maximization of M 1 is performed at a fixed depth.

Let us consider an object whose consider a fluorescent bead centered at the focusing depth z " 0 µm. As we could observe in Sect. 2.3 p. 41, when diffraction-limited, the 3D PSF 2 is well confined resulting in a narrow and peaked distribution. It is expected that the integral of the "combined axial distribution" (as defined in Sect. 2.1 -Eq.(2.7) p. 28) is then maximized when the 3D PSF 2 is the most confined, i.e. diffraction-limited. As we can observe, the diffraction-limited 3D PSF 2 is centered on the fluorescent bead, which results, by convolution, in an image centered at the focusing depth. In this ideal scenario, we obtain a maximal M 1 metric value. In Figure 3.2 is presented the evolution of M 1 as a function of coma aberration (Z 7 ) between -5 and 5 radians of amplitude for a in-focus fluorescent bead. One verify a maximum of mean image intensity when the amplitude of coma is equal to zero. The presence of aberrations will decrease the 3D PSF 2 peak and enlarge it and it will consequently decrease the combined axial distribution resulting in a lower M 1 metric value. We can observe this effect in Fig. 3.3: here we represent the interaction between an aberrated 3D PSF 2 (with 2.1 rad of coma aberration) and the in-focus fluorescent bead. As expected, for an in-focus fluorescent bead M 1 is maximal for a diffraction-limited 3D PSF 2 . In experimental tests, this scenario of a single in-focus structure may not occur. For instance, one can have at a given focusing depth both in-focus and out-of-focus bright features. hardly overlap and the combined axial distribution is very weak. Also, because the bead is out-of-focus, at z 0 " 0 µm we collect only fluorescence provided by the axial elongation of the diffraction-limited 3D PSF 2 .

One may therefore wonder if M 1 is maximized in the absence of aberrations. In Figure 3.5 is presented the evolution of M 1 as a function of coma aberration (Z 7 ) between -5 and 5 radians of amplitude. One can actually observe a minimum of mean image intensity when the amplitude of coma is equal to zero. This figure also shows that M 1 is maximized around 2.1 rad and -2.1 rad. Figure 3.6 shows the interaction between an aberrated 3D PSF 2 with 2.1 rad of coma aberration and the out-of-focus bead.

It can be seen that, when adding a moderate value of coma aberrations, we elongate the 3D PSF 2 which induces an increase of the overlapping with the fluorescent bead and consequently it increases the collected fluorescence. However, the reduction of the 3D PSF 2 's confinement results in an important reduction of the fluorescence emission. He have then two opposite effects which maximize the fluorescent for ˘2.1 rad of coma.

Because the coma aberration is axially symmetric, the axial elongation is equivalent for two symmetrical amplitude values. This explains why one obtains two symmetrical maxima. When performing the standard modal sensorless in this scenario, M 1 is always calculated for a transverse scan at a fixed depth (here z " 0 µm), thus the metric is maximized by adding a significant amount of aberrations. It can observed that a maximum of M 1 is obtained for a 11 " ´2.3 rad. Like for the coma aberration, by adding spherical aberration one deforms the 3D PSF 2 which results in an increasing of the mean image intensity.

In Figure . 3.8 is illustrated the interaction between the aberrated 3D PSF 2 (with ´2.3 rad of a 11 ) and the out-of-focus bead.

We observe that the 3D PSF 2 is displaced in the axial direction to compensate the distance of the bead center to the focusing depth. This is equivalent to displacing the symmetrical 3D PSF 2 in the opposite axial direction to increase the overlap with the bead. As a result, the obtained z-stack image is axially displaced so that M 1 is now calculated at the depth where the z-stack image presents the most fluorescence quantity. However, this is a very awkward and inefficient way to refocus the microscope. Also, the spherical aberration does not only displaces the 3D PSF 2 , it also induces an elongation on the 3D PSF 2 and on the z-stack image degrading the axial resolution of the microscope (similarly to the coma aberration). These two different effects (displacement and elongation) of the spherical aberration can strongly bias the wavefront estimation by the SMS approach.

In summary, I have shown here that the maximization of M 1 also depends on the structure sample and that, for samples that present bright out-of-focus features, M 1 is maximized for a important amount of aberration amplitudes. This effect induces a strong bias in the SMS aberration estimation approach.

We have thus demonstrated here the existence of the sample dependence in two-photon microscopy.

Remark: When considering a pupil back-aperture with a non-uniform illumination distribution (here we considered a Gaussian illumination distribution), it is known that the Zernike modes basis is no longer orthogonal in the phase space contrary to the case of a pupil back-aperture with a uniform illumination [Noll, 1976]. However, the notion of orthogonality on the phase space should not be confused with the notion of orthogonality of a basis relatively to a metric to be maximized [START_REF] Débarre | Image-based adaptive optics for two-photon microscopy[END_REF]. More generally, one may wonder how the back aperture illumination distribution may influence the aberrated 3D PSF 2 , the mean image intensity M 1 and sample dependence. In Appendix B p. 129 I present a brief analysis of the 3D PSF 2 's deformations in the presence of the spherical aberration considering a uniformly illuminated pupil backaperture. One could observe that the 3D PSF 2 is again elongated and distorded such as the main lobe is axially displaced relatively to the focusing plane. This analysis shows that even with a uniformly illumination distribution, the 3D PSF 2 's displacements are still present and, we also demonstrate that the sample dependence remains (see Fig.

Displacement-free approach and its limitations

As observed in Sect. 3.2, the axial displacement induced by spherical aberration is one of the effects at the origin of the sample dependence. With a finite transverse field of view one can also similarly show that modes inducing transverse displacements can also cause sample dependence. Staying on the original spirit of SMS that forbids to adjust the displacement modes (tip, tilt and defocus), several authors [Thayil and Booth, 2011;Facomprez et al., 2012] have therefore proposed to build a new modal basis that does not induce transverse and axial displacements. Although this approach obviously does not alleviate the elongation issue (illustrated on coma in Sect. 3.2) I still investigate here the displacement-free procedure. More precisely, I discuss the underlying hypothesis of linearity of the displacement with the aberration amplitude. Section 1.5.2.4 p. 22 of Chapter 1 recalls how the "displacement" is defined and this linearity hypothesis. With the purpose of testing the linearity hypothesis, I calculate the displacements induced by aberrations on the 3D PSF 2 and on a 10 µm fluorescent bead. Because one uses a fluorescent bead which is centered in a very large field of view relatively to the size of the bead, the transverse displacements do not impact the mean image intensity of the transverse scan. Thus, to simplify, only the axial displacements induced by the spherical aberration are calculated as it is the first aberration that induces an axial displacement (it is also the only mode concerned among the modes considered in this thesis). The axial displacement are estimated by the same procedure as the one presented in Sect. 1.5.2.4 p. 22. Figure 3.9 represents the evolution of the 3D PSF 2 axial displacement expressed in equivalent radians of defocus a d (see, Appendix A. p. 127), as a function of spherical aberration a 11 between -5 and 5 rad. I calculated a linear fit to the data between: -5:5 rad, -2:2 rad and -1:1 and the respective slopes of the fits a.k.a. gradients. (right) zoom between -1 and 1 rad; Linear fit between -5 and 5 rad (red dashed line); Linear fit between -2 and 2 rad (yellow dashed line); Linear fit between -1 and 1 rad (green dot-dashed line). The gradient of each fit is given on the legend.

As it can be observed, ∆ 1 fits reasonably well for the large amplitudes of aberrations (red dashed line) and ∆ 3 fits better the measurements for the small amplitudes (green dashed line). To better understand the impact of these different fits in the construc- It can be seen that, none of the different displacement-free spherical aberration fully correct the displacement for the whole range of spherical aberration. For ∆ 1 one obtain a new spherical aberration that corrects the axial displacement for large amplitudes, however the 3D PSF 2 is still displaced for 1 and 2 rad of Z 1 11 . For ∆ 3 , it can not fully correct the axial displacement for larger amplitudes: for 5 rad the 3D PSF 2 displacement (originally « 30 µm) is still « 10 µm. The displacement-free procedure therefore partially neutralizes the axial displacement induced by the spherical aberration and in any case the elongation effect remains. As in the case of coma this is of course a source of sample dependence. One can see that the displacement-free spherical aberration tries with difficulty to keep the z-stack image at the depth where is located the fluorescent bead. Also, one can observe from Fig. 3.13 that M 1 is still maximized for a non-zero amount of aberration. This results from the residual displacement that is not corrected and also from the elongation effect.

In summary, the displacement-free approach does not fully cancel the displacements of the 3D PSF 2 because they are not linearly dependent on aberrations besides one still faces, for an out-of-focus bead, the elongation problem presented in Fig. 3.6. [Thayil et al., 2010] proposed to solve the sample dependence by measuring the mean image intensity in an axially scanned plane. Instead of fixing a focusing depth z " z 0 , the image is obtained by fixing one transverse direction and scan in the other transverse direction for a range of focusing depths (line by line). For example, by fixing x " x 0 one obtains the following image:

Other attempts to solve the sample dependence

I 2D py, z; x 0 q " h 2 a py ´y1 , z ´z1 ; x 0 ´x1 q ¨ηpy 1 , z 1 ; x 1 q dy 1 dz 1 dx 1 " ż " h 2 a p¨, ¨; x 0 ´x1 q ‹ 2D ηp¨, ¨; x 1 q ‰ py, zq dx 1 . ( 3.1)
The metric would be now the integration of this image in the transverse and axial direction:

M 1 pa; x 0 q " I 2D py, z; x 0 q dy dz " ż " h 2 a p¨, ¨; x 0 ´x1 q ‹ 2D ηp¨, ¨; x 1 q ‰ py, zq dx 1 dy dz.

(3.2)

However, I consider that this would only solve the problem when considering an uniform transverse distribution of fluorosphore. For a more complex sample with structures sparsely distributed in both transverse and axial direction this will not solve the problem. Indeed, in the same way that the mean image intensity of a transverse scan is affected by bright features dispersed on the axial distribution, the mean image intensity of a axial scan will be affected by the bright features dispersed in the transverse directions.

Another solution for the sample dependence could be the choice of the mean z-stack image intensity as the image quality metric. Because it performs a 3D integration, this metric should be independent of the sample structure. However, the standard modal sensorless wavefront sensing approach would require a large number of z-stack image acquisitions, which would be very time-consuming, and it would surely increase the photobleaching phenomenon. All these issues of the sample dependence severely limit the efficiency of the current modal sensorless approaches. Because none of the attempts presented here are capable to fully solve the sample dependence issue, one needs to rethink the SMS approach.

The Axially-Locked Modal Sensorless approach

To fully overcome the sample dependence limitation, we have suggested to exploit our prior knowledge on the sample, in our case the presence of 10 µm size neurons' somas, in order to obtain a unbiased aberration estimation. Instead of constraining the optimization to "stay away" from a strong fluorophore concentration, we take the opposite strategy to "lock" on it, and then we estimate the aberrations on this bright feature of the sample. In this sense, we make use of the strongest light source in the vicinity, instead of fighting its influence during the optimization procedure.

Description of the estimation procedure

We thus designed a procedure that we called "Axially-Locked Modal Sensorless" (ALMS) wavefront sensing and correction, which consists in performing the following steps (the procedure is illustrated on Fig. 3.14):

1. Find a local maximum of an intensity related metric in the axial pzq dimension and set the focus to this depth; 2. At this focusing depth, estimate the aberrations beyond focus and apply the corresponding shape to the deformable mirror;

3. Repeat step 1 and step 2 to perform a fine tuning of both aberration estimation and focusing depth. Contrary to previous works, the ALMS strategy therefore allows controlled shifts in focusing depth -initially the procedure operates a coarse focusing while fine tuning of defocus is performed iteratively. ALMS uses bright structures as guide stars naturally Chapter 3. The SMS & the ALMS approaches present in the sample to eliminate the risk of introducing aberrations during the optimization process.

However, as already mentioned before, the mean image intensity globally decreases along with the imaging depth, due to scattering and absorption. Using M 1 as optimization metric would therefore progressively move the focusing depth towards the sample's surface. We therefore have to look for another metric capable to target a feature of interest, in our case 10 µm size neurons' somas.

Choice of the adequate image quality metric for the axial locking

The axial locking step of the ALMS approach requires an intensity-related metric that presents local axial maxima around the structures of interest. In the case of neuronal imaging, this structure is a labeled soma. To study the locking efficiency of various metrics, I used a 3D digitized sample representing a brain slab, including two neuron' somas (centered at z « ´7.5 µm and z « 8 µm) as well as dendrites. The digitized brain slab was built using confocal images of GFP-expressing neurons in fixed hippocampus slices (Fig. 3.15). With this sample I calculate the metric for each focusing depth and then I analyze the efficiency of the metric to perform the axial locking on both neurons' somas. We observe that M 1 presents two main local maxima at z " ´7.5 µm and z " 1.125 µm, and does not have a local maximum around 8 µm (where the second soma is located).

To understand this, I illustrate in Fig. 3.17 three diffraction-limited transverse scans obtained at z " ´7.5 µm, z " 1.125 µm (i.e. the 2 maxima) and z " 7.875 µm (the plane nearest to 8 µm due to the sampling parameters: δ z " 0.375 µm). The mean image intensity for each scan are 0.27, 0.21 and 0.17, respectively. The maximum located at z " ´7.5 µm corresponds to a scan where is located one of the two neurons' somas together with dendrites. The second local maximum correspond to a scan where only dendrites are imaged. Actually, I recall that Eq. ( 2.2) shows that the mean image intensity does not depend on the transverse structure of the object, it depends on its mean axial distribution. So, a scan where we have only few bright pixels (like the scan at z " 7.875 µm) can obtain a lower mean value than a scan where we have many bright pixels (even if these are not so bright, like the scan at z " 1.125 µm).

In order to perform a good axial locking it is important to be able to detect efficiently a neuron's soma in the neighborhood of the initial focusing depth. In this example we fortunately obtained a maximum of M 1 on one of the neurons' somas. However, this is not always the scenario encountered. For instance, if I consider only the digitized slab from -3 to 20 µm in the axial direction, axial locking does not target a neuron's soma. I therefore need to investigate other intensity-related metrics which are able to better detect neurons' somas and exhibit a clear local maximum on each of them. Ideally, the difference between the metric values of a scan with a neuron's soma and a scan with other structures must be as high as possible.

Image intensity variance (M 2 )

A metric widely used in signal and image-processing is the image intensity variance (also known as image sharpness) [START_REF] Fienup | Aberration correction by maximizing generalized sharpness metrics[END_REF]. This metric is given here by the equation: M 2 pzq " Var rIpx, y; zqs , (

where Var denotes the empirical variance in 2 dimensions px, yq. One can observe a new local maximum at z " 7.5 (near the second neuron's soma) and a strong reduction of the second maximum at z " 1.125 µm. To evaluate the efficiency of M 2 , I will compare the metric values at z " ´7.5 µm, z " 1.125 µm and z " 7.875 (scans of Fig. 3.17). The image intensity variance for each scan are 5.53, 2.32 and 3.36, respectively. For M 1 one obtains at z " 7.875 µm a metric value 0.81 times smaller that the metric value at z " 1.125 µm (Fig. 3.16). With M 2 one obtains a metric value at z " 7.875 µm that is 1.44 times higher than the metric value at z " 1.125 µm. This shows that one now clearly detects the second neuron's soma. Indeed, it is known that the image variance will emphasize scans with few and very bright pixels instead of scans with many not so bright pixels, which makes M 2 better than M 1 for the axial locking on neuron's somas.

Pre-filtered Image intensity variance (M 3 )

However, one can still exploit more information from the obtained scans. Neurons' somas are " 10 µm diameter compact structures. The presence of such structures can be highlighted by pre-filtering out low and high spatial frequencies of the image, to increase the contrast between somas and dendrites, before computing the image intensity variance. We call this metric "pre-filtered image variance" M 3 . The filter here considered is illustrated in Fig. 3.19 and the metric can be expressed by: M 3 pzq " Var rIpx, y; zq ‹ 2D F px, yqs , (3.4) with F the filter kernel which is written in the form:

F px, yq " F ´1 " exp ˆ´pρ ´ρ0 q 2 2σ 2 ˙ (3.5)
where F ´1 represents the inverse Fourier transform and ρ " pρ x , ρ y q represents the frequency coordinates. I use here σ " ρ 0 " 1{20 µm ´1. We can observe that we enhanced the contrast between the plane where no neuron's soma is located (z " 1.125 µm) and the planes where are centered the two neuron's somas (z " ´7.5 µm and z " 7.875 µm). Also the second maximum is now located at the exact depth of the second neuron's soma: z " 7.875 µm. M 3 locates the neuron's somas with a better precision than M 2 .

The pre-filtered image intensity variances for each scan are 0.25, 0.04 and 0.18, respectively. We obtain a metric value at z " 7.875 µm that is now 4.31 times higher than the metric value at z " 1.125 µm. By increasing the metric difference between the scan of interest and the other ones the axial locking step is likely to require less iterations to converge onto a neuron's soma. As consequence, the ALMS procedure is likely to converge faster to the better solution. All this makes M 3 a strong candidate for the image quality metric to consider for the ALMS approach.

Remark: Other metrics were considered for the axial locking step. I choose to not present them here as they does not present additional advantages relatively to the M 3 metric. For instance, we considered the mean intensity of the squared image M 2 " I 2 px, yq dx dy and the mean image intensity of the pre-filtered image M 3 " rIpx, y; zq ‹ 2D F px, yqs dx dy.

M 2 can perform a detection of the neuron's somas, but it is not better than the M 2 or M 3 metrics. M 3 is equal to the zero-frequency of the pre-filtered image which is in turn proportional to the zero-frequency of the image unfiltered. Thus, the mean image intensity of the pre-filtered image M 3 is proportional to the mean image intensity of the image unfiltered M 1 . It is therefore strictly equivalent to M 1 and brings no advantage.

Comparison of the metrics by their sensitivity to aberrations

We saw that M 3 is better than M 2 and M 1 for the axial locking on neurons' somas. One may also wonder if M 3 can perform better than M 1 and M 2 on the aberration estimation step. In that sense, one can observe the sensitivity of each metric to aberrations. As presented in Sect. 2.6 p. 56, the sensitivity to aberrations can be quantified by the amount of aberration a 0 one needs to introduce to obtain one half of the metric at diffraction-limit: a 0 : M 1 pa " a 0 , z 0 q " 0.5 M 1 pa " 0, z 0 q.

(3.6) Figure 3.22 presents the evolution of the three metrics presented as functions of coma and spherical aberration when imaging the digitized brain slab at z " 7.875 µm (second maximum given by M 3 ). We can clearly observe that M 2 and M 3 presents a better sensitivity than M 1 with almost no difference between the two. However, I have not included detection noise in the scans before measuring each metric. It could be interesting to study the sensitivity to aberrations with the presence of detection noise.

Comparison of the metrics by their sensitivity to aberrations with detection noise

In Figure 3.23 I illustrate the evolution of the three metrics as functions of coma and spherical aberration at the same focusing depth. I added to the simulated transverse scan a homogeneous white Gaussian noise. The standard deviation of noise added is the same for each transverse scan computed: 1/35 of the z-stack image maximum. It can be observed that M 3 is less affected by the detection noise.(indeed M 3 filters out a large portion of the noise) and presents globally a better sensitivity to aberrations. Thus, using M 3 on the aberration estimation step should lead to a better solution of the optimization procedure.

Comparison of the metrics by their sensitivity to aberrations with detection noise with an out-of-focus neuron's soma

One may also wonder how the metrics evolve as a function of aberrations when we are not focused on a neuron's soma. Figure 3.24 presents the evolution of the three metrics presented as functions of coma and spherical aberration when imaging the digitized brain slab at z " ´0.875 µm (focusing depth between the two neuron's somas). We can observe that at this depth, M 3 can be maximized when adding aberrations. Of course, M 3 is designed to be more sensitive to the presence of neuron's somas, so it is more affected by the presence of out-of-focus bright neurons' somas. This shows that, when performing the SMS approach (no axial locking), M 2 and M 3 may be less efficient than M 1 for the aberration estimation. Note that when performing the ALMS approach, by adjusting the focusing depth to match the center of a neuron's soma, this scenario (Fig. 3.24) will not occur and we will find us with an in-focus neuron's soma (Fig. 3.23) where M 3 is maximized for a zero amount of aberrations and has a better sensitivity to aberrations.

In summary, the axial locking step of our approach (step 1 of Fig. 3.14) consists in computing M 3 values as a function of the focusing depth, and then setting the imaging plane at the focusing depth that maximizes M 3 . Comparing the different metrics, we observed that M 3 has a higher sensitivity to aberrations. Thus, we also use M 3 in the aberration estimation step of the ALMS procedure (step 2 of Fig. 3.14).

The end-to-end simulations of the estimation and correction by the ALMS procedure are described in Chapter 4.

The experimental application of the procedure is performed and presented in the following pages.

The ALMS approach is a result of the collaborative work between the three laboratories.

The axial locking idea came from the joint analysis and discussion of the sample dependence systematic study I performed during my thesis. The pre-filtered image variance metric M 3 was first proposed in this application by our colleague Arnaud Malvache from INSERM. A preliminary exploration and a first experimental evaluation of the three metrics was performed during his thesis by our colleague Dorian Champelovier from Institut Fresnel.

Ex vivo and in vivo application of ALMS

Now that we have defined the ALMS approach and selected a metric that allows to perform a good axial locking, we present a first ex vivo and in vivo experimental application of ALMS. The ex vivo application is performed on hippocampus samples and the in vivo application is performed on the hippocampus of the living mouse. A first version of the ALMS approach and its experimental application was the subject of an article submitted in September 2016 and published in February 2017 in the journal Scientific Reports.

The paper summarizes the main elements of this chapter, it presents and discusses the results obtained from the experiments ex vivo and in vivo application of the ALMS approach. A schematic representation of the test bench used for this experiments is presented in Fig. 3.25 and is detailed in the paper's section Two-photon Laser Scanning AO microscope.

Reader's guide

The text from page 1 to the first 3 paragraphs of page 4 summarizes the theoretical work presented in this chapter of the thesis. This part can be skipped if the reader has read The text from the second to the last paragraphs of page 4 discusses the sensitivity to aberrations of the different metrics used. We compare the numerical simulation already presented in Fig. 3.23 with experimental results (Figure 3 of the paper). Note that there are slight differences between the numerical results of the two figures. The range of aberrations is different. In Figure . 3.23 we calculated the different metrics between -5 and 5 radians of amplitude, while in the article the metrics were calculated between -1.5 and 1.5 radian of amplitude. Also, since the publication of the paper in September 2016, the simulation parameters and the 3D digitized brain slab were slightly modified to match the new simulation parameters that were defined later and presented here in Sect. 2.2.1 p. 28. These updates do not modify the comments and conclusions of the article.

From the last paragraph of page 3 to the end of page 5 (before In vitro use of the method) we present the procedure performed during the experimental tests. This procedure slightly differs from the one presented in this chapter. We redesigned the procedure after the publication of the paper to better differentiate the axial locking step and the aberration estimation step:

• in the procedure presented in Sect. 3.5.1 the best focus is always estimated and directly applied to the setup separated from the estimated aberrations;

• in the procedure presented at the end of page 3 of the article, we perform a first focus estimation which is directly applied, however during the estimation of the N aberrations the axial locking (focus) is treated together with aberrations and is only applied to the setup after the N estimations. And we repeat this step until convergence.

By performing the axial locking step separately of the aberration estimation step, one ensures that the axial locking is performed with the "best" 3D PSF 2 .

From the end of page 5 to first paragraph of page 7 we present the experimental test performed on fixed slices of the hippocampus (Figure 4 of the paper). Finally, on page 7 we present the in vivo experimental resultS obtained on an anesthetized mouse (Figure 5 of the paper), then we discuss the results. At the end of page 7 the experimental setup is described. Adaptive optics is a promising technique for the improvement of microscopy in tissues. A large palette of indirect and direct wavefront sensing methods has been proposed for in vivo imaging in experimental animal models. Application of most of these methods to complex samples suffers from either intrinsic and/or practical difficulties. Here we show a theoretically optimized wavefront correction method for inhomogeneously labeled biological samples. We demonstrate its performance at a depth of 200 μm in brain tissue within a sparsely labeled region such as the pyramidal cell layer of the hippocampus, with cells expressing GCamP6. This method is designed to be sample-independent thanks to an automatic axial locking on objects of interest through the use of an image-based metric that we designed. Using this method, we show an increase of in vivo imaging quality in the hippocampus.

Scientific

In vivo imaging of neuronal calcium dynamics using two-photon microscopy is an increasingly used method of choice to study neuronal activity at microcircuit level. In the dorsal region CA1 of the hippocampus (the most optically accessible), this technique allows neuronal activity recording, in large fields of view containing hundreds of cells 1 . It has led to pioneering discoveries of multineuron dynamics including, for example fear conditioning 2 , spatial navigation 3-5 , epilepsy 6 or quiet rest 7 . However, the implementation of this technique remains challenging as it requires, prior to cranial window implantation, surgery to remove the overlaying cortex, which introduces a high variability of "optical access" to the tissue. The main issues are the presence of blood from the capillaries and sometimes from small hemorrhage as well as the quality of the interface between the glass window and the brain surface. The former causes optical absorption and can be reduced by performing the surgery following water restriction to increase the viscosity of the blood 1,5 , while the latter causes optical aberrations. Furthermore, the densely packed layer of CA1 pyramidal neurons is located 200 μ m below the glass window covering the brain; the incoming laser beam is also perturbed by light scattering and optical aberrations during the propagation within the tissue. This problem should be tackled in order to improve detection of calcium probes which is impaired by the lowered contrast of the aberrated images. Even a modest improvement in contrast should lead to the detection of neural activity that otherwise is masked by background fluorescence from brain tissue. Optical aberrations alter the quality of beam focusing, which in turn leads to reduced spatial resolution but also to lower signal and contrast. Thus, even when objects of interest are one order of magnitude larger than the diffraction limited laser focus (e.g. neurons' somata are 10-15 μ m in diameter), the reduction of optical aberrations is critical to increasing the contrast of the fluorescence images. This improvement can be achieved using adaptive optics, a promising tool increasingly used for microscopy 8 . Adaptive optics is the process of quantifying optical aberrations through wavefront measurement and correcting them by the use of an adaptive correction element (deformable mirror DM or spatial light modulator SLM). Note that in point-scanning two-photon microscopy the correction is applied on the excitation beam alone and no correction is needed on the detection path. In such microscopes, the wavefront can either be directly measured or indirectly estimated. Direct wavefront measurement relies on introducing a wavefront sensor such as a Shack-Hartmann in the detection part of the microscope. A point source in the sample is then imaged on the sensor. Direct methods have been proposed for two-photon imaging in weakly scattering samples where auto-fluorescence signals can be used to generate a highly localized signal 9,10 , but more complex methods such as coherence gating 11 or near-IR guide stars 12 are required to avoid out-of-focus fluorescence in highly scattering samples. Indirect or sensorless wavefront estimation has the advantage of being easy-to-implement on existing systems as it relies on conventional imaging systems. Indeed, this technique, called image-based adaptive optics, relies on successive image measurements with an engineered illuminating laser beam displaying different spatial shapes either in intensity (pupil segmentation) or in phase (modal optimization).

The pupil segmentation method is based on illuminating the sample through one pupil segment at a time and measuring the image shift induced by an optical aberration consisting mainly of a local phase gradient. By comparing a reference image to images acquired with these different segments of the illuminating laser beam or beamlets, one can quantify the local phase gradient (tip/tilt) of each segment 13,14 . A potential issue is the loss of signal and resolution due to lower NA focusing with a truncated laser beam 15 . In the modal optimization method, one maps signal intensity or an image quality metric in phase space by applying successive wavefront deformations to the adaptive optics element. These image-based techniques, which rely on fluorescence metrics, have the main advantage that they merely require a corrective element in the illuminating laser path. However, as the aberration is indirectly inferred, the "optimized" wavefront that maximizes the quality metric is not only linked to the wavefront deformation but also to the object used for optimization. For certain spatial distributions of fluorophores, the modal optimization method may lead to a biased wavefront estimate. Thus, the quality metric and the basis used to describe the phase space as well as the method used to find the metric maximum should be carefully chosen. To address this issue we propose here an improvement of the original modal optimization scheme 16 . Note that recent so-called multiplexed methods 17-19 can be seen as variations of the modal optimization scheme designed to speed up the wavefront control. Although in practice these methods may also limit the bias 18 , this has not been thoroughly studied.

The basic solution for modal optimization is the use of the mean image intensity as a metric and the Zernike modes as a basis for the phase space, the Zernike modes for tip, tilt and defocus being excluded. This intuitive approach was demonstrated in vivo in the mouse retina 20 . However, Zernike modes are not an orthogonal basis for our optimization problem; to be rigorous, one should iterate several times the Zernike optimization cycle to converge onto the optimal wavefront 21 . One could think of improving the optimization convergence through the use an orthogonal basis defined for the considered metric. This basis can be either theoretically computed 22 or experimentally calibrated 16,23 . Such an orthogonal basis allows in principle to perform the optimization in a unique cycle, reducing the total number of measurements to a minimum of 2 images per mode plus a reference image (2 N + 1 method 23 ). Note however that the very notion of orthogonal modes is only properly defined for quadratic metrics, and thus the validity of methods based on orthogonality is restricted to small aberrations for which the quality metric can be approximated by a quadratic function of the aberrations. Additionally, even in the quadratic setting, the orthogonal modes are difficult to compute theoretically because they depend on the relative geometry of {laser beam, deformable mirror, back-aperture plane}, which is not perfectly known. And the alternative experimental calibration of these modes is not an ideal solution either because it is subject to the unavoidable noise and other measurement errors. Also, as discussed in the results Section, the volumetric distribution of fluorophores induces limitations to modal optimization 24 . These limitations are only partially addressed with the construction of displacement-free modes 21,25,26 .

Even though they do not overcome all the problems, the previously proposed methods are suitable in homogeneously labeled samples 21,25,26 or in sparsely labeled samples by selecting isolated objects 27 . However, in other cases such as in vivo calcium imaging in the CA1 region of hippocampus, the presence of highly inhomogeneous labeling can induce a bias in the correction (explained in the next section) that should be removed. We propose a new easy-to-implement image-based method suitable for calcium imaging in brain tissue where all these limitations are addressed. We demonstrate its performance in imaging the hippocampus both in vitro and in vivo.

Results

As the amount of aberrations increases, the focal volume (i.e. the point spread function of the input beam) is distorted and enlarged, so that the maximum intensity in the focal volume decreases. It is therefore expected that the image intensity metric (mean intensity in the image) is maximum when there is no aberration in the system. However, when considering a heterogeneously labeled 3D sample, this is not true anymore. For instance, if a high fluorophore concentration is in the vicinity of the focal plane, an iterative modal optimization of the aberration will lead to adding tip/tilt and defocus to shift the focal plane onto this location. This is why one generally forbids tip/tilt and defocus to avoid changing the actual location of the scan. Still, even with these precautions, the optimization will lead to "stretching" the point spread function so that it reaches the location of the bright fluorophore source. In other words, for some fluorophore distributions, an increase of aberrations can increase the intensity metric value while worsening the quality of the laser beam focus and thus degrading the overall resolution and contrast of the data. In such undesirable situations, the wavefront estimation is thus biased and is called "sample dependent". Note that this bias effect has been shown in third harmonic generation (THG) microscopy, where increasing the amount of aberrations could increase the THG mean intensity for some specific sample geometry 22,24 . This effect is also expected in two-photon excitation fluorescence microscopy 24,27 .

To quantify this phenomenon, we have developed a numerical tool simulating a two-photon laser scanning microscope. The two-photon excitation laser focal volume is calculated using a diffraction model, and then convolved with an object (see methods for more details). Figure 1 shows the evolution of the mean image intensity metric M 1 for a given transverse scan for different amplitudes of coma and spherical aberration when imaging a 10 μ m fluorophore bead in-focus and out-of-focus. As expected, when focusing on the bead (Fig. 1A,B), the maximum is obtained in the absence of aberrations. However, we observe that, if the bead is 12 μ m out-of-focus (Fig. 1C,D) the metric maxima are obtained for a large amount of aberration. Increasing the amount of coma causes an elongation/distortion of the focal volume and increases its interaction with the bead (Fig. 1C). For the spherical aberration, increasing the amount of aberrations causes a distortion and a displacement of the focal volume also resulting in a better interaction with the bead (Fig. 1D). This example on an isolated object can be generalized to any heterogeneously labeled sample. The modal optimization method may therefore lead to a biased estimation of the aberration that is linked to the volumetric distribution of contrast agent in the object.

Several groups have attempted to overcome this so-called sample dependency by the use of a basis of displacement-free modes 21,25,26 . However, with these displacement-free modes, the issue concerning the elongation/distortion of the focal volume remains (for example, see the effect induced by the coma aberrations on Fig. 1), as already noted in ref. [START_REF] Galwaduge | Simple wavefront correction framework for two-photon microscopy of in-vivo brain[END_REF]. To overcome the sample dependency problem one may also think of using a different metric. We however show that sharpness type metrics do not solve the elongation/distortion issue (see Fig. S1). A metric based not on a single image but on the volume intensity is a solution 24 , but it requires the acquisition of several z-stacks for each optimization mode. Such a time consuming procedure is not applicable to in vivo imaging.

The inhomogeneous labeling of biological media thus results in the sample dependency problem with the current modal optimizations. In contrast, we wish here to exploit our prior knowledge on the object characteristics, in our case the presence of 10 μm size neurons, in order to access wavefront measurements that are not biased by the detailed 3D structure of the sample. Instead of constraining the optimization to "stay away" from a strong fluorophore concentration such as neuron somata, we take the opposite strategy of "locking" on it, and optimizing the aberrations around it. In this sense, we make use of the strongest light source in the vicinity, instead of fighting its influence on the optimization.

We thus designed a procedure called "axially-locked modal optimization", which consists in performing the two following steps:

1. Find a local maximum of an intensity related metric in the axial (z) dimension. 2. At this depth, optimize the metric iteratively for each Zernike mode including defocus. Contrary to previous works, our new strategy therefore allows controlled shifts in depth (defocus)-the first step operates a coarse focus while fine tuning of defocus is performed in the second step. Our approach is opposite to the displacement-free modal optimization principle which implements optimization at a fixed depth and suffers from the inherent limitation mentioned earlier. In contrast, our strategy of locking focuses on bright structures to eliminate the risk of introducing aberrations during the optimization process which helps us to image structures of our interest with improved contrast.

The first step of our axially-locked modal optimization method requires a specific intensity-related metric that presents local maxima around the region of interest. In our case, it has to be able to locate the depth of labeled somata. To compute such a metric, we used a 3D digitized sample representing a brain slab (Fig. 2A) including two somata (centered at z = -8 μm and z = 8 μm, respectively) as well as dendrites, built using confocal images of GFP-expressing neurons in fixed hippocampal slices. Figure 2B shows the evolution of different intensity-related metrics as a function of depth, on simulated transverse scans of the 3D model. We observe that the mean image intensity M 1 does not allow determining the depth of the somata; it does not distinguish layers with many small structures (e.g. around z = 0 μm) from layers with a well-defined soma (around z = -8 μm). One can actually show that the mean image intensity does not depend on the transverse (xy) structure of the object and only depends on its mean axial distribution (see Suppl. Mat.) which forbids object-locking. We therefore need to investigate other intensity-related metrics.

We can observe that the image intensity variance (also known as sharpness metric) M 2 (see Suppl. Mat.) displays two local maxima close to the positions of the two somata (Fig. 2B). However, it also displays a local maximum in between the somata due to the presence of dendrites. We thus defined a new metric M 3 which consists in filtering out low and high spatial frequencies of the image, to increase the contrast between somata and dendrites, before calculating the intensity variance (we call this metric "filtered image sharpness metric", see Suppl. Mat.). The exact filtering parameters are defined such that the objects of interest (i.e. neurons somata) are highlighted. As displayed in Fig. 2B, M 3 improves the precision in localization. Thus, step 1 of our method consists in computing M 3 values as a function of depth, and then setting the imaging plane at the depth that maximizes M 3 .

In the next step of optimizing aberration corrections (step 2), the relative sensitivity of the different intensity related metrics to aberrations can be compared using our simulation with the digitized sample (Fig. 3A,B) and experimental results obtained in hippocampal slices GAD67KI-GFP of mice in which 10-20% of the neurons, the GABAergic ones, express GFP (Fig. 3C,D). We observed that the mean signal intensity M 1 is less sensitive to aberrations than metrics M 2 and M 3 . We also observed that M 3 is the most sensitive, both in simulations and experiments. To conclude, the filtered image sharpness metric (M 3 ) appears well-suited for both steps 1 and 2 of the axially-locked modal optimization method, in samples that contain objects well defined in shape.

In order to test our axially-locked modal optimization method, we built a custom-made point-scanning two-photon microscope (see methods and Fig. S1) similar to the commercial one we used for hippocampal in vivo large scale calcium imaging 5-7 . Wavefront control was performed using a deformable mirror (IrisAO, PTT111-5) placed into the illuminating laser path. We applied the following procedure in fixed hippocampal slices of GAD67KI-GFP mice and in the hippocampus of living mice.

Experimental procedure for axially-locked modal optimization:

1. Acquisition of a 40 μ m z-stack around the field of view (FOV) of interest using a default wavefront (setup correction). 2. Calculation of M 3 (z). 3. Setting the imaging plane at the depth z0 that maximizes M 3 . 4. Explore all the N Zernike modes amplitudes (4N + 1, including defocus) around the current wavefront from -1.5 to 1.5 rad and compute M 3 . For each mode, store value of coefficient that maximizes M 3 . 5. Update the wavefront by using the coefficients computed in step 4. 6. Repeat steps 4 and 5 twice (i.e. 3 iterations in total). 7. Image the FOV with the final correction and with the initial wavefront for comparison.

For the method to be robust and efficient, we applied 4 different amplitudes to each Zernike mode (4N + 1 method) with 3 iterations to account for the couplings between the Zernike modes 21 . As explained in the introduction, couplings are difficult to avoid in practice hence our choice to rather iterate on a standard Zernike basis. The initial setup correction was first defined using the above procedure on calibration samples (1 μ m fluorescent beads), using the M 1 metric.

In vitro use of the method. We tested this method on fixed hippocampal slices (see methods) from GAD67KI-GFP mice at depths ranging from 180 μ m to 200 μ m. We focused on 400 × 400 μ m 2 fields-of-view (FOVs) with densely packed neurons (the pyramidal cell layer of CA1 and CA3 or the granular cell layer of the dentate gyrus). An example of FOV is displayed in Fig. 4A. We then applied our method with N = 8 Zernike modes, for 5 different FOVs, 200 μ m deep (n = 3 slices). Photobleaching was compensated for by taking into account the exponential decay of intensity across all images. A local maximum of M 3 was typically found within 10 μ m around the chosen ROI (Fig. 4B). To estimate the performance, 3D images were recorded (512 × 512 × 40px 3 , FOV 400 × 400 × 40 μ m 3 ) with and without correction and the axial profile of selected somata was fitted (Fig. 4C). The axial profile was calculated by averaging the signal on a 12 μ m-diameter disk centered on the soma. The function used for the fit was the square of the Gaussian beam axial profile which is a reasonable approximation of the aberrated two-photon PSF convolved with a neuron (see methods). For a given neuron, the signal was defined as the difference between the maximum of the fit and its minimum (background signal), the axial resolution was defined as the Full Width at Quarter Maximum of the fit. We obtained a signal increase of 14% and an axial resolution improvement of 8.5% (median value, n = 36 somata, Fig. 4D). The corrected wavefront mainly contained astigmatism (Z5 and Z6) and spherical aberration (Z11) (Fig. 4E). It closely resembled the one obtained for setup correction only (Fig. 4E), which explains why the signal and resolution improvements with setup correction and sample correction were not statistically different. Thus, at depths of 200 μ m in fixed brain slices, the sample induced wavefront aberrations on the laser were minimal. However, this result shows that the axially-locked modal optimization can reliably be used in brain tissue with fluorescently labelled neurons.

In vivo use of the method. We finally used this correction method for in vivo imaging of the CA1 pyramidal cell layer through a previously developed chronic cranial window implanted above the hippocampus after the removal of the overlaying cortex 1,5 . The expression of the calcium indicator GCamP6f was virally-induced (see methods). Aberration correction was performed in anesthetized mice on a 400 × 400 μ m 2 FOV (Fig. 5A), no photobleaching was observed. Doing so, a local maximum of the metric M 3 was found within the pyramidal cell layer (Fig. 5B). The axial profile of 11 somata located within this layer were calculated (Fig. 5C), and a signal enhancement of 21% and an axial resolution enhancement of 21% (median values, Fig. 5D) were obtained. This enhancement of image quality was significantly higher than just setup correction, which led to a 6% signal and 4% resolution enhancement (median values, Wilcoxon rank-sum test, Fig. 5D). Most of the correction originated from the horizontal coma (Z6 in Fig. 5E) which can be explained by the curved shape of the different layers of CA1.

Discussion

We propose a new image-based adaptive optics method that is designed for imaging heterogeneously labeled scattering samples such as the pyramidal cell layer of the hippocampus. It relies on a specific metric which consists in filtering out low and high spatial frequencies of the image before calculating the intensity variance. Thanks to this 'filtered image sharpness metric' , we exploit the stereotyped motif of the labeling (e.g. the neurons) to lock on the optimal layer depth before performing aberration estimation. Most importantly, we show that this axially-locked modal optimization is well-suited to enhance the image quality of CA1 pyramidal cells in in vivo large scale imaging of neural activity, where previously reported modal optimization methods are not optimal because of the highly inhomogeneous labeling.

Compared to direct measurement methods, our method is easy-to-implement as it only requires adding a wavefront correction device in a standard microscope to manipulate the canonical Zernike modes. Furthermore, it can readily be applied on biologically relevant samples such as GCamP expressing neuron because it does not require isolated objects thanks to its low sensitivity to inhomogeneous labeling. Thus, this technique is suitable for all kinds of applications which involve fluorescence imaging in deep tissues.

As far as acquisition time is concerned, 3 iterations of the 4 N + 1 scans of 8 Zernike modes requires 99 images which would take160 s for 512 × 512px 2 image size (in vitro) and 10 s for 128 × 128px 2 image size (in vivo). However, if one wants to apply this method to non-anesthetized mice, the variability in fluorescence related to spontaneous neuronal activity will have to be taken into account. One can take advantage of the sparse spontaneous activity -by performing multiple measurements and using quantification metrics which are robust to outliers, it should be possible to obtain a reliable correction.

Although a relatively mild improvement in signal and resolution (~20%) could be obtained, it should be sufficient to increase the probability of detecting small changes in fluorescence such as neurons firing sparsely in time. For example, in the case of hippocampal reactivations where assemblies of neurons fire a few action potentials 7 , the image quality was critical to reliably detect these events: typically 50% of detected events had calcium signals less than 20% above noise level. Signal enhancement could also be used to facilitate imaging the hippocampal dendritic activity in vivo, which also displays weak fluorescence changes 3 . We thus expect that applying axially-locked modal optimization will significantly improve the data quality of in vivo calcium imaging in the hippocampus and in other regions of the brain.

Methods

All protocols were performed under the guidelines of the French National Ethics Committee for Sciences and Health report on "Ethical Principles for Animal Experimentation" in agreement with the European Community Directive 86/609/EEC. The experimental protocols were approved by the French National Ethics Committee under agreement #01413.03.

Simulated imaging.

A simulated two-photon laser scanning microscope based on a diffraction model for 3D PSF in the presence of aberrations was used to compare intensity-related metrics (M 1 , M 2 and M 3 ) and the different strategies (standard and axially-locked). The parameters of the microscope were chosen to match the experimental setup. The 3D PSF is convolved by different objects (for example, beads and 3D model of brain slice, possibly adding detection noise) to obtain the z-stacks and the different metrics (see supplementary materials for more details).

Two-photon Laser Scanning AO microscope. The system is a wavefront corrected two-photon imaging system (see Fig. S2). The NIR excitation beam (920 nm) from a pulsed laser (Chameleon Ultra II, Coherent Inc.) goes through a power control system consisting of a half-wave plate and a polarized beam splitter. Then it is expanded and collimated by a pair of lenses (L1 = -50 mm and L2 = 150 mm). The collimated NIR beam slightly overfills the aperture of a deformable mirror (DM, PTT111-5, IrisAO, Inc.) and is reflected with a shaped wavefront. The DM is imaged onto the two scanning galvanometric mirrors (6200 H, Cambridge Technology, Novanta, Inc.) by two pairs of relay lenses (focal lengths: L3 = 750 mm, L4 = 1000 mm, L5 = 400 mm and L6 = 400 mm) and then to the back pupil of the objective (16X/0.8, Plan Fluorite Physiology, Nikon Instruments Europe B.V.) by another pair of relay lenses (focal lengths: L7 = 50 mm and F8 = 200 mm). The back-aperture of the objective was just filled with the image of DM in order to reach maximum numerical aperture. The objective focuses the beam into the sample and collects the excited fluorescence. Fluorescence is reflected by a dichroic mirror D (FF757-Di01, Semrock, Inc.) placed immediately after the objective and guided by a pair of lenses (focal length: L9 = 150 mm and L10 = 50 mm) onto a photomultiplier tube PMT (H7422P-40, Hamamatsu Photonics K.K.). Two short pass filters (2xSPF, FESH750, Thorlabs, Inc.) are added between the two lenses and a GFP emission filter (GFPEF, MF525-39, Thorlabs, Inc.) is added in front of the detector to clean the fluorescent signal from any unwanted light. In vitro preparation. Adult GAD67-green fluorescent protein-knock-in (GAD67-GFP-KI) mice 28 were anesthetized with a ketamine (250 mg/kg) and xylazine (25 mg/kg) solution (i.p.) and transcardially perfused with 4% paraformaldehyde in PBS (1 ml/g). Brains were postfixed overnight, washed in PBS, and kept at -20 °C for long-term storage. 600 μ m thick coronal brain sections were prepared and processed.

In vivo preparation. Mice were handled before recording sessions to limit head restraint-associated stress and experiments were performed during the dark cycle. The analgesic (Buprenorphine, 0.1 mg/kg) was administrated before any surgery. Viral infection was previously described 5 , however the virus stock solution was diluted by 1:5 (D-PBS Sigma-Aldrich) and the resultant solution was injected 2 times 200 nl of AAV2/1.Syn.GCamP6f. WPRE.SV40 (Penn Vector Core) (AP -2.0/2.5, ML 1.6/2.1 and DV -1.3). The head-fixation bar (custom-made aluminum bar) was firmly secured with dental cement (GripCement, SuperBond, Sun Medical). Behavioral handling and imaging procedures were optimized and performed similarly as described previously 5 .

Axial profile fit.

In order to fit the axial profile of neurons, we used the square of the Gaussian beam axial profile

= + + - ( ) f z a b ( ) 1 (1) z c d ( ) 2 2 2
where a, b, c and d are adjustable parameters. a represents the background level, b is the maximal intensity of the neuron, c its depth and d its the Full Width at Quarter Maximum.

Discussion about the construction of an orthogonal basis mode

In the context of methods aiming at the maximization of a multi-variable metric it can be shown that if the metric is a quadratic form, and if the orthogonal modes are known, then the maximum can be found in one iteration. I briefly discuss here in this section the possibility to define such an orthogonal basis mode in our context.

First, there is the assumption that the chosen metric can be expressed by a quadratic form. As observed in Sect. 2.7 p. 58, the quadratic form is generally only a local approximation of the true metric to be optimized around zero or a local maximum. One can for instance see in Fig. 3.23 and in Fig. 3.24 that none of the metrics here presented are quadratic beyond a few 0.1 rad of aberration. Also, we can verify that the metric is not always maximal for zero aberration (see Fig. 3.5,Fig. 3.7,Fig. 3.13 or Fig. 3.24).

We therefore understand that a truly orthogonal mode basis does not exists in our context.

Even if one could assume that the chosen metric was a perfect quadratic form in a region neighboring its maximum, the orthogonal modes are difficult to compute theoretically, because since they depend on the relative geometry of laser beam, deformable mirror, back aperture pupil and other characteristics, which are not perfectly known. Such a computation would also imply a very precise model of the modes generated by the DM. Attempts to build these orthogonal modes therefore generally rely on an experimental calibration procedure [Débarre et al., 2008;[START_REF] Débarre | Image-based adaptive optics for two-photon microscopy[END_REF]. Such an experimental calibration has its inherent uncertainties (operating point, noise...) and leads only to an imperfect estimation of these orthogonal modes, therefore the aberration estimation step will need more than one iteration.

To conclude, the construction of an orthogonal basis mode could be performed only to represent small amounts of aberrations and with no certainty about its efficiency.

In practice and as mentioned in the experimental application of the ALMS approach (Sect. 3.6), only three iterations of the procedure were used, which is quite reasonable in the context of scientific experiments. We therefore decide to keep the Zernike modes as a basis. We then avoid performing a delicate calibration which introduces more uncertainties into the study.

Conclusion

In this chapter I have presented the standard modal sensorless approach to aberration estimation for two-photon microscopy. I demonstrated, through numerical simulations, that for some structures the aberration estimation with the standard modal sensorless can be biased, i.e., the maximization of the image quality metric is reached for a nonzero amount of aberration. This occurs when we either displace or elongate the 3D PSF 2 such that it can maximize its interaction with out-of-focus bright features. This bias is quantified for specific geometries. This effect had never been studied in detail.

I have discussed several attempts proposed in the literature to solve these issues. In particular, I analyzed the one that consists in the construction of a new basis, called "displacement-free" modes. This new mode basis assumes that the 3D PSF 2 displacements are linearly dependent on aberrations. I demonstrated here that this linearity is only an approximation. Also, it is shown that removing the displacements from the modes does not fully solve the sample dependence issue. Aberrations like coma and spherical aberration induce an elongation of the 3D PSF 2 which also limits the efficiency of the SMS approach.

To fully overcome the sample dependence, we have developed the Axially-Locked Modal Sensorless (ALMS) wavefront sensing which is presented in our Scientific Reports paper. To summarize the approach and its experimental application, I reproduce here the discussion of the paper as it is.

"We propose a new image-based adaptive optics method that is designed for imaging heterogeneously labeled scattering samples such as the pyramidal cell layer of the hippocampus. It relies on a specific metric which consists in filtering out low and high spatial frequencies of the image before calculating the intensity variance. Thanks to this 'filtered image sharpness metric', we exploit the stereotyped motif of the labeling (e.g. the neurons) to lock on the optimal layer depth before performing aberration estimation. Most importantly, we show that this axially-locked modal optimization is well-suited to enhance the image quality of CA1 pyramidal cells in in vivo large scale imaging of neural activity, where previously reported modal optimization methods are not optimal because of the highly inhomogeneous labeling.

Compared to direct measurement methods, our method is easy-to-implement as it only requires adding a wavefront correction device in a standard microscope to manipulate the canonical Zernike modes. Furthermore, it can readily be applied on biologically relevant samples such as GCamP expressing neuron because it does not require isolated objects thanks to its low sensitivity to inhomogeneous labeling. Thus, this technique is suitable for all kinds of applications which involve fluorescence imaging in deep tissues.

As far as acquisition time is concerned, 3 iterations of the 4N+1 scans of 8 Zernike modes requires 99 images which would take 160 s for 512 ˆ512px 2 image size (in vitro) and 10 s for 128 ˆ128px 2 image size (in vivo). However, if one wants to apply this method to non-anesthetized mice, the variability in fluorescence related to spontaneous neuronal activity will have to be taken into account. One can take advantage of the sparse spontaneous activityby performing multiple measurements and using quantification metrics which are robust to outliers, it should be possible to obtain a reliable correction. Although a relatively mild improvement in signal and resolution (" 20%) could be obtained, it should be sufficient to increase the probability of detecting small changes in fluorescence such as neurons firing sparsely in time. For example, in the case of hippocampal reactivations where assemblies of neurons fire a few action potentials, the image quality was critical to reliably detect these events: typically 50% of detected events had calcium signals less than 20% above noise level. Signal enhancement could also be used to facilitate imaging the hippocampal dendritic activity in vivo, which also displays weak fluorescence changes. We thus expect that applying axially-locked modal optimization will significantly improve the data quality of in vivo calcium imaging in the hippocampus and in other regions of the brain."

In Chapter 4 I will compare in more details the SMS approach with the ALMS approach with the different metrics presented thorough end-to-end numerical simulations. I will analyze the performance for what concerns: the bias of aberration estimation, speed of convergence/number of iterations, and other aspects related to the aberration estimation.

Chapter 4

Study of the ALMS approach performance through end-to-end simulations

Chapter 3 presents a new approach to estimate aberrations called Axially-Locked Modal Sensorless (ALMS). This approach is designed to perform a good estimation of aberrations even for the most complex inhomogeneous samples. It relies on a two-step iterative procedure which consists in: an axial locking step, where we seek to find a optimal focusing depth and an aberration estimation step. Contrary to the Standard Modal Sensorless (SMS), ALMS is designed to be sample independent. An experimental application of the ALMS approach was presented and a good improvement of the image quality was obtained. However, we have not performed so far a direct comparison of the SMS and the ALMS approaches neither experimentally nor numerically.

In this chapter, I intend to compare numerically, through end to end simulations, the aberration estimation accuracy between the ALMS approach, the SMS approach and the SMS approach with the use of displacement-free modes (SMS-DF). For each approach, different aberration amplitudes and different modalities of modal sensorless wavefront sensing are explored. Following [Facomprez et al., 2012], I compare modal sensorless modalities with different number K of transverse scan acquisitions (measurements) used for a given aberration estimation and different optimization strategy (global or sequential update of the DM). I also briefly study the impact of the detection noise on the SMS-DF and on the ALMS approach.

In Section 4.1 I detail the different modalities considered for the modal sensorless wavefront sensing and I discuss in Sect. 4.2 the results of the simulations.

Optimization strategy

The main difference between the ALMS and the SMS approaches is the additional step called the Axial Locking. At each iteration of the ALMS approach one performs an axial locking before proceeding with the aberration estimation. The next two subsections describe how these two steps are performed.

Axial locking

The axial locking step consists in selecting the better focusing depth to estimate the aberrations. Through a z-stack image one measures a chosen image quality metric for each transverse scan of the z-stack. The depth corresponding to the scan with the larger value of the metric is then selected to be the new focusing depth.

We decided here not to worry about the practical axial locking algorithm. The z-stack image is therefore acquired all along the axial excursion (150 µm) with a fine step (1.125 µm).

Aberration estimation -1D optimization algorithm

Consider the initial state of the DM characterized by the Zernike coefficients a dm " pa 1 , ..., a N q (N represents the number of Zernike modes used). As explained is Sect. 3.1 p. 66, by changing the shape of the DM, I seek to find the values a dm " pa 1 , ..., a N q that maximize a chosen image quality metric. In the 1D optimization performed for each aberration mode Z i , i " 1, ..., N , two different algorithms can be performed to find a i : the exhaustive search of the maximum and the estimation of the maximum through a Gaussian fit on the measurements.

Exhaustive search of the maximum algorithm

The exhaustive search algorithm consists in the following procedure:

1. Considering a i the current amplitude of the aberration Z i of the DM initial state a DM , one applies to the DM K different amplitude values between a i ´∆a and a i `∆a separately. For each amplitude (a i inclusive) one measures an image quality metric m j pj " 1, ..., Kq;

2. One identifies the larger value m k and the two adjacent measures m k´1 and m k`1 .

Then one records their respective amplitude coefficients a 1 k´1 and a 1 k`1 ;

3. One applies now to the DM K different amplitude values equally spaced between a 1 k´1 and a 1 k`1 . For each one an image quality metric n j pj " 1, ..., Kq is measured;

1st measurements = m j 1st maximum = a' k 2nd measurements = n j 2nd maximum = b' k a i + ¡ a a i -a a' k-1 =a i m k n k m k+1 m k-1 a' k a' k+1 b' k Figure 4
.1: Illustration of the exhaustive search algorithm. The blue circles represent the first K measurements m j , j " 1 : K. The pink circle is the maximum m k of the first K measurements. The yellow crosses are the second K measurements n j , j " 1 : K. The red diamond represents the maximum n k of the second K measurements.

Chapter 4. Study of the ALMS approach performance

This algorithm has a final sampling step of

δ a " 2∆ a pK ´1q 2 ,
where 2∆ a represents the range of exploration in the 1D optimization. To obtain a small sampling step a large number of measurements is required which makes this approach not suitable for experimental tests.

Estimation of the maximum through a Gaussian fit algorithm

In order to estimate the maximum of the metric through a reduced number of transverse scans, one can perform a fit on the measurements. Following [Facomprez et al., 2012], an adequate choice is a Gaussian fit using three free parameters per mode: the width, centre and amplitude of the curve. The estimation of the maximum through a Gaussian fit algorithm consists in the following procedure:

1. Considering a i the current amplitude of the aberration Z i of the DM initial state a DM , one applies to the DM K different amplitude values a 1 i i P t1, ..., Ku between a i ´∆a and a i `∆a separately. For each one (a i inclusive), one measures an image quality metric m j j P t1, ..., Ku;

2. One computes a Gaussian fit through the K measurements and one estimates the amplitude b corresponding to the maximum. As a consequence of the three free parameters of the Gaussian fit, a minimum of 3 measurements for each aberration mode are required to locate the maximum. A better accuracy of the algorithm can be obtained by increasing the number of measurements.

Following [Facomprez et al., 2012], to limit the exposition of the sample, 5 measurements appears an optimal compromise between limited exposure of the sample and stability of the algorithm. This small number of transverse scan acquisitions makes this algorithm well suitable for experimental tests.

Updating the DM -N D optimization algorithm

During the aberration estimation step two optimization algorithms are used and differ in their DM update strategy:

• global DM update algorithm -each 1D optimization is performed on the same DM initial state. The result of all 1D optimizations are applied all together to update the DM.

• sequential DM update algorithm -after each 1D optimization, one updates the DM with the coefficient obtained.

In the case of the global DM update algorithm, when the Gaussian fit algorithm is used for the 1D aberration estimation, the scan corresponding to the initial aberration is commonly used for the N 1D aberration optimizations. One can therefore show that the total number of measurements required is pK ´1qN `1. In the case of the sequential DM update algorithm and the Gaussian fit algorithm, each 1D optimization requires K scans, hence a total number of measurements equal to KN . Figure 4.3 presents an illustration of the steps of these two optimization algorithms. In this case, the maximum of the metric is estimated with a Gaussian fit algorithm with K " 3 and considering only coma and spherical aberrations (N " 2). [Facomprez et al., 2012] In the simulations here presented, I explore N " 7 different aberrations in the aberration estimation step. Considering K " 5, the aberration estimation through a Gaussian fit requires pK ´1qN `1 " 4 ˆ7 ´1 " 29 transverse scans for the global DM update algorithm and KN " 5ˆ7 " 35 transverse scans for the sequential DM update algorithm.

For instance, if one perform 3 iterations of the SMS approach, one obtain 87 and 105 transverse scans for each algorithm respectively.

In the case where the image quality metric is a quadratic function of aberrations and the eigen vectors correspond to the Zernike modes, the aberration estimation should converge in a single iteration with both N D optimization algorithms. In this case, in what concerns the number of acquisitions, the global update algorithm is the most advantageous as it requires fewer transverse scans. However, in the case of a non-quadratic image quality metric (which is the practical case) and depending on the level of aberrations, multiple iterations of the aberration estimation procedure are needed. It is then not evident which N D optimization algorithm presents a faster convergence or a better aberration estimation.

The two algorithms are therefore compared in Sect. 4.2.

Overall optimization strategies

In the comparisons presented in the following section, the three sensorless approaches are performed with different optimization strategies. I describe in this section the different strategies and parameter choices used for these simulations.

SMS ans SMS-DF approaches use the mean image intensity M 1 as image quality metric for the aberration estimation step. Before the aberration estimation, I also decided to set the initial focus using the axial locking algorithm. This is performed only once in these approaches. M 1 is used also for this initial step.

The axial displacement, in the SMS-DF approach, is addressed by applying for each radian of spherical aberration a given amount ∆ DF of defocus. As observed in Sect. 3.3 p. 72, because of the non-linearity of the axial displacements, the choice of ∆ DF is somewhat arbitrary. Here I chose to use ∆ DF " ∆ 1 " 2.3402 rad which corresponds to a fit performed in the range -5 to 5 rad. (see Fig. 3.9 p. 73). Unlike the standard approaches, ALMS uses M 3 , the pre-filtered image variance, as image quality metric in both axial locking and aberration estimation steps.

To simulate the initial aberrated wavefront I used the Wang's set of aberrations (see Fig. 2.6 p. 35). The results obtained for this set of aberrations did not present a significant difference between the SMS-DF and the ALMS approach. I observed that the difference between the approach performances depends, in part, on the initial amplitude of spherical aberration. In particular, ALMS performs better than the standard approaches when the initial spherical aberration amplitude is equal to zero. I thus decided to remove the spherical aberration from the Wang's set and I used this set in the simulations presented in this chapter. An adjustment in the wavefront amplitude is performed to simulate the cases of weak, strong and very strong aberrations (initial residual wavefront standard deviation: 1 rad rms, 2.82843 rad rms and 5 rad rms respectively).

For the 1D optimization strategies, the exploration range is set to ∆ a " 2 rad. As demonstrated in [Facomprez et al., 2012], this value allows to perform a better aberration estimation for large aberration amplitudes.

For the weakly and strongly aberrated wavefront cases 5 iterations of each approach were performed. In the cases of a very strongly aberrated wavefront, 10 iterations were simulated so as to this would ensure the convergence of the aberration estimation.

In a first comparison, I don't address the practicability of the optimization. I thus use the exhaustive search of the maximum method for the 1D optimization strategy to study the aberration estimation accuracy of the SMS, the SMS-DF and the ALMS approaches. 11+11 measurements are acquired and a sequential DM update algorithm is used. By using these 22 measurements one obtains a final sampling step of δ a " 0.04 µm. I chose the sequential DM update algorithm because it is considered in [Facomprez et al., 2012] to be a more statistically accurate optimization strategy.

In a second comparison, the maximum of the image quality metric is estimated through a Gaussian fit on the measurements. Here, I compare the different optimization strategies for the ALMS approach. I compare the two DM update algorithms with K " 3 and K " 5 measurements. I also compare these different cases with the SMS-DF approach with K " 5 and sequential DM update strategy. The detection noise is not simulated.

The same comparison was also made with detection noise. As it was performed in Chapter 3, I added to the simulated transverse scan a homogeneous white Gaussian noise. The standard deviation of noise added is the same for each transverse scan computed: 1/35 of the image maximum.

To reduce the computation time of the simulations I adopted a set of numerical parameters different than the ones presented in the previous chapters. The main differences are the axial sampling parameters: the number of planes is reduced from N z " 401 to N z " 135 scans. To keep an axial excursion of ∆ z " 150 µm, the pitch is changed from δ z " 0.375 µm to δ z " 1.125 µm. The numerical parameters used in this chapter are presented in Table 4 The simulations results here presented are performed on a single numerical sample (the numerical sample presented in Fig. 3.15 p. 78) and with a unique set of aberrations where the amplitude was adjusted to simulate different cases of weakly and strongly aberrated wavefronts. In this context, the comparisons here presented should not be considered as a generic comparison of the different approaches. A more developed statistical study following, for example, the study of [Facomprez et al., 2012] should be performed.

Comparison of the SMS and the ALMS approach

The simulations results here presented are divided in three sections:

• In Section 4.2.1 I compare the accuracy of the aberration correction between the SMS, the SMS-DF and the ALMS approaches. I intend here to demonstrate that ALMS can perform a better correction that the standard approaches.

• In Section 4.2.2 I compare the accuracy and convergence speed of the aberration correction between different optimization configurations of the ALMS approach. The detection noise is not simulated. I intend here to define which optimization strategy would be more suitable to be applied in experimental tests.

• As observed in Sect. ?? p. ??, M 3 is less affected by the detection noise. I intend here to briefly demonstrate the robustness to the noise of the ALMS approach compared to the SMS-DF approach. Thus, Section 4.2.3 presents the same comparison as Sect. 4.2.2 however, the detection noise is simulated. In order to compare the accuracy of the aberration estimation for the different cases, the following simulation results are presented with figures illustrating the evolution of the residual aberration standard deviation as a function of iterations. The evolution of the focusing depth as a function of iterations is also illustrated. Remark that, in the case of the SMS-DF approach, this figure does not truly represent a change of focusing depth. It represents the amount of defocus aberration (in µm) meant to keep the 3D PSF 2 's main lobe at the same depth.

Aberration estimation accuracy comparison between the SMS, the SMS-DF and the ALMS approaches

In order to compare the SMS, the SMS-DF and the ALMS approaches I use here the exhaustive search method for the aberration estimation (1D optimization) and the sequential DM update strategy for the overall optimization. precise First, no adjustments of the focusing depth were observed. I recall that it was shown in Sect. 3.5.2 p. 78 that, in the absence of aberrations (diffraction-limited case) the maximum of both M 1 and M 3 as functions of the focusing depth is at the center of a neuron's soma. The amount of aberrations here simulated is quite small and consequently, the 3D PSF 2 shape is nearly diffraction-limited. The initial focusing depth is then still near the center of the neuron's soma « ´8.5 µm (see Fig. the focusing depth are performed by the axial locking in ALMS.

Result for weak aberrations

One can observe that all approaches converge to the same good estimation of the aberrations: the standard deviation of the residual wavefront tends to « 0.048 rad rms which is negligible. I recall that the exhaustive search with the 11 `11 measurements has a final sampling step of 0.04 rad rms. If one observes the values at convergence for each aberration (Sect. C.1 p. 133), one can observe that they are all smaller than 0.04 rad.

When added together, they form this residual wavefront amplitude, which is still very small. Both standard approaches set the initial focusing depth at « ´4.5 µm. Of course, by construction, the SMS approach does not change defocus. The SMS-DF approach, however, adds a given amount of defocus together with spherical aberration to compensate for the axial displacement.

Result for strong aberrations

The ALMS approach set the initial focusing depth at « ´10 µm, near the center of the neuron's soma (see Fig. D.2 p. 150) and after one iteration, the focusing depth converges to near the neuron's soma center. I recall that, to accelerate the simulation computation, the axial sampling step was changed to 1.125 µmwhich defines the sampling step for the axial locking.

For what concerns the aberration estimation, the three approaches converge in about three iterations. The SMS-DF approach obtains a residual wavefront with « 0.24 rad rms of amplitude. The SMS approach obtains a residual wavefront with « 0.16 rad rms of amplitude. These two biases are due to the addition of spherical aberration. Because the focusing depth is near the border of the neuron's soma, by adding some amount of spherical aberration one increase M 1 as predicted in Chapter 3. The SMS-DF approach does not perform better than the SMS approach. This may be due to the value ∆ DF chosen to add defocus. Because the non-linearity of the axial displacements, the value ∆ 1 does not apply the adequate amount of defocus. Residual axial displacements remain. At convergence, this results in a larger amplitude a 11 than in the case of the SMS approach ( With the ALMS approach, the residual wavefront has « 0.03 rad rms of amplitude. I consider then that the ALMS approach performs here a non-biased aberration estimation. In this case, the ALMS approach set the initial focusing depth at « ´11.1 µm and converges to the neuron's soma center in two iterations.

Result for very strong aberrations

For what concerns the aberration estimation, the results are similar to the previous case.

The three approaches converge in three iterations. At the last iteration, the residual wavefront amplitudes for the SMS, SMS-DF and ALMS approaches are respectively 0.1, 0.17 and 0.06 rad rms: the SMS-DF performs slightly worse than the SMS and the ALMS approaches. Like in the case of a weak aberrations, the small residual wavefront obtained for the ALMS approach is due to the sampling step of the exhaustive search algorithm (see Sect. C.3 p. 136).

Accuracy and convergence speed comparison between the SMS-DF and the ALMS approach without detection noise

In this section I compare the accuracy and convergence speed of the aberration correction between different optimization configurations of the ALMS approach. The detection noise is not simulated. For comparison, the SMS-DF approach is also simulated with K " 5 and a sequential DM update algorithm. I intend here to define which optimization strategy would be more suitable for the application of the ALMS approach in experimental tests.

Result for weak aberrations

Figure 4.8 presents the evolution of the focusing depth and the evolution of the residual wavefront standard deviation as a function of iterations for the case of weak aberrations: 1 rad rms standard deviation. First, no relevant adjustments of the focusing depth are observed (ă 1 µm). The initial focusing depth is set near the center of the neuron's soma. The oscillations observed for the different ALMS modalities are, in part, due to the sampling step of the axial locking procedure which does not allow to focus at the real center of the neuron's soma. Since this effect was not observed in the previous section, where the exhaustive search was used, these oscillations may be related to the Gaussian fit. A more detailed study about the fit estimation error would thus be required. As a consequence of these oscillations, very small oscillations are also observed for the spherical aberration (see Fig. C.16 p. 139) which are reflected in the evolution of the residual wavefront standard deviation. Globally, at convergence, the ALMS approach performs a better aberration estimation than the SMS-DF approach. At the last iteration, the residual wavefront amplitudes for the SMS-DF, the ALMS 2N+1, the ALMS 3N, the ALMS 4N+1 and the ALMS 5N approaches are respectively 0.056, 0.015, 0.020, 0.012 and 0.029 rad rms. These ampli- tudes obtained for the ALMS approach are very small and also affected by oscillations. I thus consider that, for this case of weak aberrations and at convergence, one can not take any conclusion about the aberration estimation accuracy for the different strategies. However, considerable differences are observed at the first iterations. Some conclusions can be obtained for what concerns the convergence speed of the optimization strategies.

One can observe that the approaches that use 5 measurements (SMS-DF inclusive) achieve the convergence with less iterations than the approaches with 3 measurements.

In particular, by performing 2 iterations of the ALMS 5N approach (i.e 70 measurements) one obtains a smaller residual wavefront amplitude than if one performs 4 iterations of the ALMS 3N approach (84 measurements). Remark that the given number of measurements exclude here the axial locking which number of measurements is the same for all ALMS approaches. This is clearly an example where taking more measurements in the 1D optimization can provide a better estimation with a smaller number of iterations.

For what concerns the choice of the DM update strategy, I can not observe relevant differences in this particular case. When considering K " 3, the global DM update algorithm performs a better aberration estimation than the sequential algorithm at all iterations except the last one. At the last iteration the sequential algorithm obtains a smaller residual amplitude, but this may be due to the oscillations of the focusing depth. When considering K " 5, the sequential algorithm performs better than the global algorithm in the first two iterations. In the remaining iterations, both DM update algorithms change following the focusing depth oscillations. of defocus are added to compensate for the spherical aberration axial displacement.

Result for strong aberrations

The ALMS approach sets the initial focusing depth at « ´10 µm. After one iteration, the focusing depth converges to the neuron's soma center for all optimization strategies except for the 4N+1 which converges after the second iteration. Small oscillations are again observed for the ALMS modalities.

For what concerns the aberration estimation accuracy, the ALMS approach performs, at the last iteration, a better aberration estimation than the SMS-DF approach: the residual wavefront amplitudes for the SMS-DF, the ALMS 2N+1, the ALMS 3N, the ALMS 4N+1 and the ALMS 5N approaches are respectively 0.113, 0.1014, 0.080, 0.026 and 0.013 rad rms. For the ALMS approach, the strategies that use K " 3 measurements (2N `1 & 3N ) performs a less accurate aberration estimation than the strategies with K " 5 (4N `1 & 5N ). However, these values obtained at the last iteration do not reflect the aberration estimation accuracy at the convergence (at least not for 2N `1 & 3N ): more than 5 iterations are necessary to achieve the convergence. Still, one can observe that the SMS-DF achieves the convergence after two iterations.

For the ALMS approach, the sequential DM update algorithms (3N & 5N ) perform a better estimation than the equivalent global DM update algorithms (2N `1 & 4N `1).

Only after the third iteration the ALMS approach performs better than the SMS-DF.

The two optimization algorithms that use 5 measurements performs better than the other two after these three iterations. In summary, in this simulation case, it is clear that the better strategy to adopt is the ALMS approach with K " 5 and the sequential DM update algorithm. The SMS-DF approach sets the initial focusing depth at « ´5.8 µm. Again, small quantities of defocus are added to compensate for the spherical aberration axial displacement.

Result for very strong aberrations

The ALMS approach sets the initial focusing depth at « ´11 µm. After three iterations, the focusing depth converges to near the neuron's soma center for all optimization strategies. Small oscillations are again observed for the ALMS approaches after the fifth iteration.

For what concerns the aberration estimation accuracy, the ALMS approach performs again a better aberration estimation than the SMS-DF approach: the residual wavefront amplitudes for the SMS-DF, the ALMS 2N+1, the ALMS 3N, the ALMS 4N+1 and the ALMS 5N approaches are respectively 0.094, 0.000, 0.020, 0.011 and 0.014 rad rms.

Similarly to the previous case, one can observe that the SMS-DF has a slightly faster convergence. In that strongly aberrated case and in the first iterations (not considering the first iteration), the global DM update algorithms (2N `1 & 4N `1) perform a better estimation than the sequential DM update algorithms (3N & 5N ).

Accuracy and convergence speed comparison between the SMS-DF and the ALMS approach with detection noise

In this section I perform a comparison similar to Sect. 4.2.3 but this time a detection noise is considered in the simulation. As it was performed in Chapter 3, I added to the simulated transverse scan a homogeneous white Gaussian noise. The standard deviation of noise added is the same for each transverse scan computed: 1/35 of the image maximum. First of all, one observes that, for the SMS-DF approach, the initial focusing depth is different than in the case of weak aberrations in Sect. 4.2.2.1. This is clearly an effect of the detection noise which affects M 1 (see Sect. D.4 p. 151). For different occurences of noise, different initial focusing depth are obtained. Again, small quantities of defocus are added to compensate for the spherical aberration axial displacement. I recall that, in the case of SMS-DF approach, this change of focus does not reflect the axial position of the 3D PSF 2 . The convergence of the curve to ´8.3 µm is misleading and does not represent an correction of the focusing depth to the center of the neuron's soma. The evolution of the focusing depth for the ALMS approach is similar to the case without detection noise. The focus stays around the center of the neuron's soma and small oscillations are again observed.

Result for weak aberrations

For what concerns the aberration estimation accuracy, at the last iteration, the residual wavefront amplitudes for the SMS-DF, the ALMS 2N+1, the ALMS 3N, the ALMS 4N+1 and the ALMS 5N approaches are respectively 0.145, 0.014, 0.020, 0.013 and 0.040 rad rms. Once again, the values obtained for the ALMS approach are very small to be compared and also depend on the oscillations induced by the focusing depth. Yet, the ALMS approach clearly performs better than the SMS-DF approach. The differences between SMS-DF and ALMS are more accentuated than in the case where detection noise is not considered. The impact of the detection noise is also observed on the convergence of the SMS-DF. While in the absence of detection noise the SMS-DF converges after two iterations, here, it converges in one iteration to a higher value (« 0.145 instead of « 0.05). This shows that, once reaching a given amount of residual aberrations, the detection noise is a dominant effect. For the ALMS approach, results very similar (if not the sames) to Sect. 4.2.2.1 are obtained. I recall that M 3 filters out a large portion of the noise. Thus, it is less affected by detection noise than M 1 . Hence, the ALMS approach still performs a good aberration estimation.

Result for strong aberrations

Figure 4.12 presents the evolution of the focusing depth and the evolution of the residual wavefront standard deviation as a function of iterations for the case of strong aberrations: 2.82843 rad rms standard deviation. The results are very similar to the results presented in Sect. 4.2.2.2. The observations obtained for the case without detection noise are also here applied:

• In the SMS-DF approach small quantities of defocus are added to compensate for the spherical aberration axial displacement. The ALMS approach focusing depth converges to the neuron's soma center for all optimization strategie and small oscillations are again observed

• The ALMS approach performs, at the last iteration, a better aberration estimation than the SMS-DF approach. However, these values obtained at the last iteration do not reflect the aberration estimation accuracy at the convergence (at least not for 2N `1 & 3N ): more than 5 iterations are necessary to achieve the convergence.

• Again, the SMS-DF converges after two iterations. For the ALMS approach, it is clear that the better strategy to adopt is the sequential DM update algorithm with K " 5.

In summary, this simulation shows that the detection noise does not clearly affect the SMS-DF approach. For the noise level here considered, the aberrations are, in this case, still a dominant effect. For what concerns the evolution of the focusing depth, the results are very similar to the results presented in Sect. 4.2.2.3. Globally, the ALMS approach performs better than the SMS-DF approach. At the last iteration, the residual wavefront amplitudes for the SMS-DF, the ALMS 2N+1, the ALMS 3N, the ALMS 4N+1 and the ALMS 5N approaches are respectively 0.122, 0.006, 0.008, 0.003 and 0.015 rad rms. Compared to the case without detection noise these amplitude values are slightly larger. However, for the ALMS approach, they are still very small and are affected by the oscillations of the focusing depth.

Result for very strong aberrations

Similarly to the previous case, one can observe that the SMS-DF has a slightly faster convergence. For the ALMS approaches, the global DM update algorithms (2N `1 & 4N `1)perform better than the sequential DM update algorithms (3N & 5N ). This simulation shows that the detection noise does not clearly affect the SMS-DF approach. For the noise level considered, the aberrations are still a dominant effect. However, this represents one particular case of the detection noise. If a stronger noise level is considered, a more significant impact may be visible in the strong aberrations cases.

Conclusion

In this chapter I presented a comparative study of the aberration estimation (and implicitly of the wavefront correction) accuracy of the ALMS approach and of the standard approaches (with and without displacement-free modes). Different optimization algorithms, which differ in the number of transverse scans required and in the DM update strategy, are considered. This study was performed with an unique numerical sample and unique set of aberrations which amplitude was adjusted to simulate the case of a weakly, strongly and very strongly aberrated wavefront. Thus, this comparison reflects only a particular case and should not be interpreted as a generic comparison of the different approaches and optimization strategies. For that, a more elaborated statistical study is necessary following, for example, the study elaborated for the SMS-DF approach presented in [Facomprez et al., 2012]. Nevertheless, our study presents here an overview of the ALMS approach performance that should be expected.

A first comparison is performed to study the aberration estimation accuracy of the SMS, the SMS-DF and the ALMS approach. In this study, the aberration estimation is performed through an exhaustive search algorithm with 11+11 measurements and with the sequential DM update strategy.

As expected, one could observe that when the initial focusing depth does not correspond to the presence of a neuron's soma in the transverse scan, the ALMS approach is progressively changing the focusing depth towards the center of the neuron's soma. Hence, the ALMS approach performs a more accurate aberration estimation than the standard approaches: in the latter, spherical aberration is added to increase the mean image intensity. This confirms the observations made in Sect. 3.3 p. 72. Also, one can observe that the SMS-DF approach can perform worse than the SMS approach. This is due to the non-linearity of the axial displacements. The slope ∆ DF , used here for the construction of the displacement-free variant of the spherical aberration, corresponds to a fit performed in the range -5 to 5 rad. Some residual displacements remain and affect the performance of the SMS-DF approach. This shows that the use of displacement-free modes does not always lead to a better estimation.

A second comparison is performed to study the aberration estimation accuracy for the ALMS approach with different optimization algorithms. The detection noise is not simulated. K " 3 and K " 5 measurements are considered for the 1D aberration optimization algorithm. For the overall optimization algorithms, a sequential and a global DM update strategy are simulated. These cases are also compared to the SMS-DF approach with K " 5 measurements for the 1D optimization, and with a sequential DM update strategy. Globally, all optimization algorithms considered for the ALMS approach perform, at convergence, a non-biased aberration estimation. In line with the results obtained in [Facomprez et al., 2012] for the SMS-DF approach, a faster convergence is observed when considering K " 5 measurements in the 1D optimization for the ALMS approach.

Relatively to the DM update strategy, one could not identify a considerable difference: in some cases the sequential strategies present a faster convergence; in other cases the global strategies converge faster or one can not observe any remarkable difference between them. Finally, the same comparison was performed with detection noise. One could observe that, for all cases of aberrations, the ALMS approach performance is not affected by detection noise. For the SMS-DF approach, in the case of a weak aberrations, it is considerably affected by the detection noise. This results in a worse aberration estimation than in the case without detection noise. For the strong or very strong aberrations cases, the SMS-DF approach is not considerably impacted by detection noise. However, a more significant detection noise may lead to a stronger impact in these cases.

One disadvantage of the ALMS approach is that it requires more iteration to converge to a solution than the SMS-DF approach. This happens because, in the ALMS approach, one alternates between the aberration estimation step, which may induces a focal volume displacement, and the axial locking step, which in particular compensates for the displacement first introduced. An improvement of the ALMS approach could be obtained considering the displacement-free modes (ALMS-DF) for the aberration estimation step. This should indeed improve the decoupling between the axial locking step and the aberration estimation step. Several other parameters were not explored in this study and should be considered in future studies, for example: the value ∆ a of amplitude exploration in the 1D optimization, the fit parameters, the order in which the Zernike mode are explored and the initial focusing depth. Also, one should study different axial locking optimization and explore different trials of aberration sets and of detection noise level. A more detailed statistical study should also be performed.

Conclusion

In-depth imaging of neuronal networks in the hippocampus was greatly improved in recent years by the use of adaptive optics. However, the optical accessibility of deep brain structures such as deeper regions of the surgically exposed hippocampus remains limited, due to aberrations created by the sample. Adaptive optics can correct for these aberrations, the key issue being then the ability to perform an accurate and reliable wavefront sensing (WFS). The approach called modal sensorless wavefront sensing is an appealing method which consists in the estimation of the aberrated wavefront through the maximization of a quality metric of the images obtained from the scientific channel. However, this approach is affected by the sample dependence which may severely biases the estimation of strong aberrations with strongly heterogeneous sample distributions.

The objective of this thesis was to analyze the Standard Modal Sensorless (SMS) approach and its limitations, and then develop an improved approach capable to correctly estimate a strongly aberrated wavefront for a very heterogeneous sample.

I started by a detailed study of the impact of aberrations in two-photon microscopy. I presented a new mathematical formulation to describe the mean image intensity (return flux) of a transverse scan. This new formulation makes explicit the interplay between the two photon 3D PSF and the object distribution. It shows that the mean image intensity does not depend on the transverse distribution of the sample, it however depends on its axial distribution in addition to the dependence on aberrations. Through a tool, called numerical microscope, developed in this thesis, I explored various aspects: the impact of aberrations on the mean image intensity for different sample geometries and for different numerical apertures and the impact of the aberrations on the two photon 3D PSF.

For what concerns the analysis for the different sample geometries, it was shown that a better sensitivity to aberrations is obtained when imaging small structures, but that one still obtains a good sensitivity when imaging very large fluorescent structures. This is convenient since, at large depths, one has a weak signal-to-noise ratio and only large structures can be observed. This result ensures that the modal sensorless approach can be performed at large depths.

With regard to the analysis of the evolution of the mean image intensity as a function of numerical apertures, we verified that in the absence of aberrations, the mean image intensity is proportional to the square of the numerical aperture. We also demonstrated that, in the presence of large amplitude of aberrations, it is possible to reduce the nu-122 Conclusion merical aperture without reducing the mean image intensity. Contrarly to what some authors assumed before, in certain situations the pupil segmentation can thus be performed with negligible reduction of the mean image intensity.

Relatively to the impact of aberrations in the two photon 3D PSF, it could be observed that aberrations induce an elongation and displacement of the 3D PSF's main lobe. Depending on the sample distribution, this deformation can increase the interplay between the two photon 3D PSF and the sample axial distribution. As a consequence, it may increase the mean image intensity values and may induce a strong bias in the aberration estimation by the Standard Modal Sensorless approach. This effect is known as the sample dependence.

We performed here a first comprehensive analysis, in two photon microscopy, of this effect. We also discussed one existing attempt to solve the sample dependence: the displacement-free variant of the Standard Modal Sensorless approach (SMS-DF). This approach is based on the hypothesis that the two photon 3D PSF displacements follows a linear dependence on aberrations. I demonstrated that this linearity is only an approximation, that residual displacements are still observed and that the elongation effect is not adressed by this approach.

Taking into account these different analyses, a new modal sensorless approach, named Axially-Locked Modal Sensorless wavefront sensing (ALMS), is presented. ALMS is designed for imaging heterogeneously labeled samples such as the pyramidal cell layer of the hippocampus. It relies on a specific metric which consists in filtering out low and high frequencies before calculating the variance of the image. With this metric one can exploit the sample's structure to iteratively lock on a bright feature of the sample before in parallel of the aberration estimation step. This locking step allows us to change the focusing depth in order to avoid the elongation and the displacement of the 3D PSF.

Most importantly, we show that the ALMS approach is well-suited to enhance the image quality of CA1 pyramidal cells in in vivo large scale imaging of neural activity. This technique is actually suitable for all kinds of applications which involve fluorescence imaging in deep tissues. Ex vivo and in vivo experimental tests at small depths of the ALMS approach were presented. A relatively modest improvement was obtained in signal and resolution (« 20%). Yet, this improvement should be sufficient to increase by « 50% the probability of detecting neuronal activity. By means of end-to-end simulations, for a particular case of aberrations and sample distribution, I showed that the SMS approach does not perform a good estimation of a strongly aberrated wavefront. Additionally, even considering its displacement-free variant of the standard approach, a biased aberration estimation is obtained, mainly due to the deformation of the 3D PSF 2 . Globally, the ALMS approach performs a better aberration estimation than the standard approaches. However, for very strongly aberrated wavefronts, such improvement requires more iterations. I also show an example where the SMS approach is considerably affected by the detection noise while the ALMS approach keeps a suitable estimation precision.

Suggestions for future work

The work presented here can be further elaborated. Here below I describe different lines of research that could be considered.

Further refinements and characterization of the ALMS approach based on simulations

One can clearly think of the following developments to further refine and characterize our ALMS approach:

• Definition an efficient axial locking algorithm An efficient axial locking with a limited number of transverse scan acquisitions remains to be defined. One could think of an initial locking with a rather large depth exploration (say scans every micron in about a 50 µm initial range). The following axial lockings could then be performed with an appropriate fit based on a few scans in a restricted range around the maximum.

• Study of ALMS with displacement free modes As mentioned previously, the ALMS convergence could probably be improved with the use of displacement free modes in the aberration estimation step. This should indeed improve the decoupling between the axial locking step and the aberration estimation step.

• ALMS with progressively increasing aperture

We have shown that, in the presence of aberrations, reducing the aperture does not mean reducing the return flux. To face very strong aberrations, one can therefore think of applying ALMS with a reduced aperture to initiate the process and then progressively come back to the full aperture configuration.

• Full statistical characterization of ALMS A full characterization of the refined ALMS approach performance should then be performed based on a statistical analysis (trials of aberration sets, different noise occurences and levels...) following the work on SMS by [Facomprez et al., 2012].

Further experimental developments

• Experimental comparison between ALMS and SMS approaches ALMS and SMS approaches have not been yet compared experimentally. Such a direct comparison is essential to demonstrate the gain brought by ALMS compared to SMS and SMS-DF approaches. These tests would also allow one to validate and fine tune the ALMS refinements mentioned previously. Extensive experimental tests at variable depths should in the meantime provide a better characterization of the aberration nature and amplitude one can expect in the hippocampus. This is an essential input to further improve AO strategies in this context.

• Application of ALMS to dynamical imaging of neuronal activity at large depth

Conclusion

One should of course pursue the experimental demonstration of the ALMS approach with in vivo tests at large depth. Eventually the ALMS approach should be applied on a awake mouse so has to image the dynamical neuronal activity in the dentate gyrus and hence open the path to an overall understanding of the hippocampus activity.

Other wavefront sensing and AO strategies

• Phase diversity for 3D imaging in two photon microscopy

The sensorless approaches studied here (SMS & ALMS) reduce the transverse scan images obtained with the scientific channel to a scalar value (so-called image quality metric). One could however think of exploiting the whole image so as to obtain an explicit estimation of the wavefront. This is the principle of the phase diversity technique [START_REF] Mugnier | Phase diversity: a technique for wave-front sensing and for diffraction-limited imaging[END_REF]. This technique has been adapted to 3D imaging in single photon microscopy [START_REF] Chenegros | 3D phase diversity: a myopic deconvolution method for short-exposure images[END_REF]Kner, 2013] and could be extended to two photon microscopy. This would constitute an image based direct wavefront sensing approach for two photon microscopy.

• Very high order multiplex techniques Very high order correction techniques, such as the IMPACT method [Tang et al., 2012;Kong and Cui, 2015], have not been analyzed in this thesis. Such techniques are of course appealing for large depth since they may partially compensate for scattering effects. Of course one should first evaluate carefully the possible sample dependence of these approaches. [Tang et al., 2012] center of mass (blue curve), one observes that a larger aberration amplitude is required to displace the 3D PSF 2 for the case of a uniform illumination distribution: between -1.2 and 1.2 rad the blue curve remains flat contrary to the case of the Gaussian distribution.

If one considers the 3D PSF 2 axial distribution maximum (green curve) one can observe that the curve starts to change later for the case of the uniform distribution: after adding more than 1 rad of spherical aberration. Considering now the case of the maximum's axial coordinate of the 3D PSF 2 , one can observe that, for the uniform case, the axial displacement changes of sign regularly. This is because, in this case of a uniform illumination distribution, the 3D PSF 2 presents an almost-symmetrical distribution along the optical axis. Figure B.2 illustrates the deformations of the 3D PSF 2 when adding 2.6 rad of spherical aberration for both illumination distribution. In this figure is presented an axial cut of the 3D PSF 2 at y " 0, the 3D PSF 2 's axial distribution h 2 a and the 3D PSF 2 's distribution along the optical axis h 2 a px " 0, y " 0, zq. For the uniform case, we observe that the 3D PSF 2 's distribution along the optical axis is almost symmetrical relatively to the focusing depths z " 0. It is then not possible to define the main lobe of the 3D PSF 2 from this curve. However, the XZ cut shows that the 3D PSF 2 is not really symmetric. We observe that a main lobe can be found, similarly to the case of the Gaussian illumination distribution, around 12 µm. Thus, the

R ésum é

L'imagerie en profondeur in vivo à deux photons est s év èrement limit ée par les aberrations optiques. L'optique adaptative est maintenant une technique largement utilis ée pour r ésoudre ce probl ème. Elle repose sur une des nombreuses techniques possibles de mesure de front d'onde. L'approche modale sans analyseur (ou modal sensorless), d évelopp ée initialement pour l'imagerie à deux photons par D ébarre et coll., est devenue une technique standard fond ée sur la maximisation d'une m étrique de qualit é d'image telle que l'intensit é moyenne de l'image. Cependant, cette technique est influenc ée par la structure de l' échantillon, qui peut induire un biais fort dans l'estimation du front d'onde. Cet effet est connu sous le nom de d épendance en l' échantillon.

Ce travail de doctorat vise à d évelopper une approche modale sans analyseur am élior ée qui n'est pas affect ée par la d épendance en l' échantillon. Elle s'insrit dans un projet d'imagerie neuronale de in vivo de l'hippocampe de la souris, projet qui rassemble l'INMED, l'Institut Fresnel et l'Onera. J' étudie d'abbord l'impact des aberrations et de la structure de l' échantillon sur l'intensit é moyenne de l'image. Je donne une nouvelle expression analytique de l'intensit é moyenne de l'image qui rend explicite l'interaction entre la Fonction d'Etalement de Point 3D et la distribution spatiale de l' échantillon. À partir de simulations num ériques, j' évalue la sensibilit é de la m étrique aux aberrations pour diff érents types d' échantillons. J' étudie ensuite l'approche Standard Modal Sensorless (SMS). Je caract érise nottament le probl ème de la d épendance en l' échantillon induit par des structures tr ès fluorescentes situ ées hors de la profondeur de focalisation. Je montre aussi que l'am élioration de l'approche dite displacement-free n' élimine pas compl ètement cette limitation.

Cette analyse aboutit au d éveloppement de notre approche nomm ée Axially-Locked Modal Sensorless (ALMS). Cette nouvelle approche r ésout la d épendance en l' échantillon par un r églage automatique et contr ôl é de la focalisation afin de verrouiller celle-ci sur des motifs brillants de l' échantillon. En outre, l'approche ALMS se fonde également sur une m étrique de qualit é d'image sp écialement conc ¸ue pour ce verrouillage axial. La performance de cette approche est num ériquement compar ée aux approches SMS. Enfin, ALMS est appliqu ée et valid ée, ex vivo et in vivo, dans le contexte de l'imagerie neuronale de l'hippocampe.

Mots Cl és

optique adaptative; Mesure de front d'onde sans analyseur; microscopie à deux photons; d épendence en l' échantillon.

Abstract

Deep in vivo two photon microscopy is severely limited by optical aberrations. Adaptive optics is now a widely used technique to overcome this issue. It relies on one of several possible wavefront sensing techniques. The modal sensorless wavefront sensing approach, initially developed for two photon imaging by D ébarre et al., has become a standard technique based on the maximization of an image quality metric such as the mean image intensity. However, this technique is influenced by the sample, which may induce a strong bias on the wavefront estimation, the so-called sample dependence. This PhD work aims at developing an improved modal sensorless approach that is not affected by sample dependence. It is part of a project of in vivo neuronal imaging of the mouse hippocampus which gathers three laboratories: INMED, Institut Fresnel and Onera. I first study the impact of aberrations and of the sample structure on the mean image intensity. A new analytical expression of the mean image intensity is given and makes explicit the interplay between the shape of the 3D PSF and the sample spatial distribution. Through numerical simulations I evaluate the metric sensitivity to aberrations for different samples structures. Secondly, I study the Standard Modal Sensorless (SMS) approach for different sample scenarios. I characterize the sample dependence issue induced by strong fluorescent structures located out-of-focus. I then show that the displacementfree technique fails at fully removing the sample dependence. This analysis leads to the development of our Axially-Locked Modal Sensorless approach (ALMS). This new approach solves the sample dependence by an automatic and controlled adjustment of the focusing depth to lock on bright sample features. Furthermore, the ALMS approach is based on an image quality metric specifically designed for this axial locking. The performance of this approach is numerically compared to the SMS approaches. Finally, the ALMS approach is demonstrated through ex vivo and in vivo experimental tests in the context of neuronal imaging of the hippocampus.

Keywords

adaptive optics; sensorless wavefront sensing; two photon microscopy; sample dependence.

Figure 1 :

 1 Figure 1: The Fellowship of the Thesis.

1

  The Fellowship of the Thesis. . . . . . . . . . . . . . . . . . . . . . . . . . i 1.1 Representation of the emission process by the absorption of one, two and three photons (1PEF, 2PEF and 3PEF). . . . . . . . . . . . . . . . . . . . 1.2 Two photon imaging of the CA1 and dentate gyrus (DG) layers of the hippocampus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Propagation of the Gaussian excitation beam . . . . . . . . . . . . . . . . 1.4 Association between radial and azimuthal order of the Zernike polynomials and the Noll indexes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.5 Illustration of the single and two photon Point Spread Function (PSF) at the focusing plane for a circular truncated Gaussian excitation beam and diffraction-limited . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.6 Illustration of the single and two photon Point Spread Function (PSF) along the axial direction, for a circular truncated excitation beam and diffraction-limited . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.7 Adaptive optics system for point-scanning microscopy . . . . . . . . . . . 1.8 Principle of the pupil segmentation method . . . . . . . . . . . . . . . . . 1.9 Principle of the modal sensorless method. Figure extracted from [Booth et al., 2012]. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.10 (a) Sample geometry. (b) Variation of two-photon fluorescence signal from the focal plane z " 0 as the separation between the two fluorescent slabs increases for different amplitudes of spherical aberration. Figure extracted from [Thayil et al., 2010]. . . . . . . . . . . . . . . . . . . . . . .

4

 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Computation of the 2D PSF with the zero-padding. Here, k " 1, i.e., the PSF is Nyquist-sampled. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Computation of the 2D PSF and 2D PSF 2 with the double zero-padding. Here, k " 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Computation of the z-stack image through the convolution of the 3D PSF 2 array with the numerical sample array. In the frequency domain it is equivalent to a multiplication. . . . . . . . . . . . . . . . . . . . . . . . 32 2.5 Illustration of the single and two photon PSF and respective OTF (absolute valus) at the focusing depth . . . . . . . . . . . . . . . . . . . . . . . 34 2.6 Zernike modes for the corrective wavefront measured at 600 µm depth in the mouse cortex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 2.7 Normalized M 1 pa; z " 0q as a function of number of pixels in the back aperture N xy for different levels of aberrations a and a sample uniformly distributed along all directions . . . . . . . . . . . . . . . . . . . . . . . . 36 2.8 Illustration of the 2D PSF at z " ∆ z {2 " 75 µm for each case of aberration and for 4 values of N xy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 2.9 Normalized M 1 pa; z " 0q as a function of the axial excursion ∆ z for different levels of aberrations a and a sample uniformly distributed along all directions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 2.10 Normalized M 1 pa; z " 0q as a function of the axial excursion ∆ z for different levels of aberrations a and a sample uniformly distributed along all directions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 2.11 Transverse cuts at the center of the diffraction-limited 3D PSF 2 (y " 0) at the focusing depth (z " 0) . . . . . . . . . . . . . . . . . . . . . . . . . 43 2.

3 . 4

 34 Computation of the complex amplitude Apρ x , ρ y ; zq for a reduced back aperture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 2.18 Mean image intensity M 1 at the focusing depth as a function of back aperture diameter and of aberrations for a planar sample . . . . . . . . . 53 2.19 Mean image intensity M 1 at the focusing depth as a function of back aperture diameter for different axial excursions ∆ z . . . . . . . . . . . . . 54 2.20 Mean image intensity M 1 at the focusing depth as a function of back aperture diameter and of aberrations for a 3D sample . . . . . . . . . . . 55 2.21 M 1 at the focusing depth (z " 0) as a function of aberrations standard deviation for a in-focus fluorescent bead with varying diameter . . . . . . 57 2.22 M 1 at the focusing depth (z " 0) as a function of aberrations for a in-focus fluorescent slab with different thickness . . . . . . . . . . . . . . . . . . . 58 2.26 Ellipse axes and orthogonality . . . . . . . . . . . . . . . . . . . . . . . . . 62 3.1 Schematic illustration of the interaction between the difraction-limited 3D PSF 2 and the in-focus fluorescent bead . . . . . . . . . . . . . . . . . . . . 67 3.2 Mean image intensity metric M 1 as a function of coma amplitude for an in-focus bead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 3.3 Schematic illustration of the interaction between the aberrated 3D PSF 2 and the in-focus fluorescent bead . . . . . . . . . . . . . . . . . . . . . . . . . . 68 LIST OF FIGURES xiii Schematic illustration of the interaction between the difraction-limited 3D PSF 2 and the out-of-focus fluorescent bead . . . . . . . . . . . . . . . . . 3.5 Mean image intensity metric M 1 as a function of coma amplitude for an out-of-focus bead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6 Schematic illustration of the interaction between the aberrated 3D PSF 2 and the out-of-focus fluorescent bead . . . . . . . . . . . . . . . . . . . . . . . 3.7 Mean image intensity metric M 1 as a function of spherical aberration (Z 11 ) amplitude for an out-of-focus bead . . . . . . . . . . . . . . . . . . . 3.8 Schematic illustration of the interaction between the aberrated 3D PSF 2 and the out-of-focus fluorescent bead . . . . . . . . . . . . . . . . . . . . . . . 3.9 Measured 3D PSF 2 axial displacement, by cross-correlation, as function of spherical aberration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.10 XZ cuts of the 3D PSF 2 for different values of Z 1 11 " Z 11 `∆1 Z 4 . . . . . 3.11 XZ cuts of the 3D PSF 2 for different values of Z 1 11 " Z 11 `∆3 Z 4 . . . . . 3.12 XZ cuts of the 3D PSF 2 for different values of spherical aberration Z 11 . . 3.13 Illustration of the displacement-free spherical aberration impact on the image and metric quality . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.14 Illustration of the Axially-Locked Modal Sensorless (ALMS) approach . . 3.15 3D view of the digitized sample representing a brain slab . . . . . . . . . 3.16 M 1 as a function of focusing depth . . . . . . . . . . . . . . . . . . . . . . 3.17Transverse scans at z " ´7.5 µm, z " 1.125 µm and z " 7.875 µm extracted from the 3D numerical model simulating a brain slab . . . . . . 3.18 M 2 as a function of focusing depth . . . . . . . . . . . . . . . . . . . . . . 3.19 Band-pass filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.20 M 3 as a function of focusing depth . . . . . . . . . . . . . . . . . . . . . . 3.21 Transverse scans at z " ´12 µm, z " ´4 µm and z " 5 µm extracted from the 3D numerical model simulating a brain slab . . . . . . . . . . . . 3.22 Sensitivity of aberrations at z " 7.875 µm . . . . . . . . . . . . . . . . . . 3.23 Sensitivity of aberrations at z " 7.875 µm . . . . . . . . . . . . . . . . . . 3.24 Sensitivity of aberrations at z " ´1.125 µm . . . . . . . . . . . . . . . . . 3.25 Schematic representation of the microscope . . . . . . . . . . . . . . . . . 4.1 Example of the exhaustive search algorithm . . . . . . . . . . . . . . . . . 4.2 Example of the maximum estimation through a Gaussian fit algorithm to estimate the astigmatism aberration induced by the biological media . . . 4.3 Principle of the N D optimization algorithms . . . . . . . . . . . . . . . . 4.4 Diagram illustrating the organization of the simulation results . . . . . . . 4.5 Comparison of the accuracy of aberration correction between the SMS, the SMS-DF and the ALMS -Exhaustive search -weak aberrations . . . . 4.6 Comparison of the accuracy of aberration correction between the SMS, the SMS-DF and the ALMS -Exhaustive search -strong aberrations . . . 4.7 Comparison of the accuracy of aberration correction between the SMS, the SMS-DF and the ALMS -Exhaustive search -very strong aberrations 4.8 Comparison of the accuracy of aberration correction between different modal sensorless modalities of the ALMS approach and the SMS-DF approach -weak aberrations . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv LIST OF FIGURES 4.9 Comparison of the accuracy of aberration correction between different modal sensorless modalities of the ALMS approach and the SMS-DF approach -strong aberrations . . . . . . . . . . . . . . . . . . . . . . . . . . 114 4.10 Comparison of the accuracy of aberration correction between different modal sensorless modalities of the ALMS approach and the SMS-DF approach -strong aberrations . . . . . . . . . . . . . . . . . . . . . . . . . . 115 4.11 Comparison of the accuracy of aberration correction between different modal sensorless modalities of the ALMS approach and the SMS-DF approach -weak aberrations . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 4.12 Comparison of the accuracy of aberration correction between different modal sensorless modalities of the ALMS approach and the SMS-DF approach -strong aberrations . . . . . . . . . . . . . . . . . . . . . . . . . . 117 4.13 Comparison of the accuracy of aberration correction between different modal sensorless modalities of the ALMS approach and the SMS-DF approach -strong aberrations . . . . . . . . . . . . . . . . . . . . . . . . . . 118 A.1 Amount of defocus to induce a given axial displacement. . . . . . . . . . 127 B.1 Axial displacement as a function of spherical aberration for Gaussian and uniform illumination distribution . . . . . . . . . . . . . . . . . . . . . . . 130 B.2 Illustration of the 3D PSF 2 's deformation with 2.6 rad of spherical aberration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 B.3 Mean image intensity metric M 1 as a function of spherical aberration amplitude for an out-of-focus bead . . . . . . . . . . . . . . . . . . . . . . 132

Contents 1 . 1 6 1. 2 8 1. 2 . 1 9 1. 2 . 2 2 18 1. 5 6 Chapter 1 .

 1162821922218561 Calcium imaging of neuronal networks in the hippocampus . Two photon microscopy and its limitations . . . . . . . . . . . Two photon microscopy . . . . . . . . . . . . . . . . . . . . . . Limitations in biological imaging . . . . . . . . . . . . . . Phase decomposition . . . . . . . . . . . . . . . . . . 14 1.4.2 3D Point Spread Function (3D PSF) . . . . . . . . . . . . . . . 14 1.4.3 Two photon 3D Point Spread Function (3D PSF 2 ) . . . . . . . 16 1.4.4 Image formation . . . . . . . . . . . . . . . . . . . . . . . . . . Correction of aberrations by adaptive optics . . . . . . . . . . 18 1.5.1 Direct methods for aberration correction . . . . . . . . . . . . . 20 AO for two photon microscopy

Figure 1 . 1 :

 11 Figure 1.1: Representation of the emission process by the absorption of one, two and three photons (1PEF, 2PEF and 3PEF).

Figure 1 . 2 :

 12 Figure 1.2: Two photon imaging of the CA1 (left) and dentate gyrus (DG) (right) layers of the hippocampus. For each region, one need to image approximately 200 µm and 700 µm deep in the hippocampus respectively.

Figure 1 . 3 :

 13 Figure 1.3: Propagation of the Gaussian excitation beam. Extracted from[Verdeyen, 1995]. The 1{e point of the field is plotted as a function of the z coordinate. As the beam propagates along z, the spot size, w, becomes larger; hence, the 1{e points become farther from the axis. The beam expands from its minimum value of w 0 by a factor of ? 2 when z " z 0 the Rayleigh distance (to avoid a misunderstanding later in this thesis I adopted the notation z R instead of z 0 to represent the Rayleigh distance).

Figure 1 . 4 :

 14 Figure 1.4: Association between radial and azimuthal order of the Zernike polynomials and the Noll indexes.

h 2 aFigure 1 . 5 :Figure 1 . 6 :

 21516 Figure 1.5: Illustration of the single and two photon Point Spread Function (PSF) at the focusing plane for a circular truncated Gaussian excitation beam and diffraction-limited. (a) Single-photon 3D PSF xy profile at z " 0; (b) Two-photon 3D PSF xy profile at z " 0; (c) Single and two photon 3D PSF cut along x at z " 0 and y " 0.

Figure 1 . 7 :

 17 Figure 1.7: Adaptive optics system for point-scanning microscopy. The excitation beam or laser (dark orange) propagates in the near-infrared and its focused on the sample. For each point of the scan, the fluorescence emission (light green) is collected by a photomultiplier tube (PMT). The measured fluorescence values for each of the scanning points form an image. The image formed can be used to indirectly measure the wavefront and control the adaptive element (option 1 green). The alternative is to directly measure the wavefront with a wavefront sensor (option 2 red).

Figure 1 . 8 :

 18 Figure 1.8: Principle of the pupil segmentation method

Figure 1 . 9 :

 19 Figure 1.9: Principle of the modal sensorless method. Figure extracted from [Booth et al., 2012].

Figure 1 . 10 :

 110 Figure 1.10: (a) Sample geometry. (b) Variation of two-photon fluorescence signal from the focal plane z " 0 as the separation between the two fluorescent slabs increases for different amplitudes of spherical aberration. Figure extracted from [Thayil et al., 2010].

Figure 2 . 1 :

 21 Figure 2.1: Computation of the complex amplitude Apρ x , ρ y ; zq.The truncated Gaussian distribution is the multiplication of the Gaussian distribution Gpρ x , ρ y q with a binary mask P pρ x , ρ y q representing the back aperture. The complex amplitude is calculated by multiplying the truncated Gaussian distribution with the exponential of the phase plus the right amount a d of defocus that must be added to simulate a 2D PSF at a distance z from the focal plane.

Figure 2 . 2 :

 22 Figure 2.2: Computation of the 2D PSF with the zero-padding. Here, k " 1, i.e., the PSF is Nyquist-sampled.

Figure 2 . 3 :

 23 Figure 2.3: Computation of the 2D PSF and 2D PSF 2 with the double zero-padding. Here, k " 2.

Figure 2 . 4 :

 24 Figure 2.4: Computation of the z-stack image through the convolution of the 3D PSF 2 array with the numerical sample array. In the frequency domain it is equivalent to a multiplication.

Figure 2 . 5 :

 25 Figure 2.5: Illustration of the two photon 2D PSF and respective 2D OTF (absolute values) at the focusing depth with two photon Shannon sampling. The pixel size is λn{8NA. (upper left) single photon 2D PSF at the focusing depth; (upper right) single photon 2D OTF (absolute values) at the focusing depth; (center left) two photon 2D PSF at the focusing depth; (center right) two photon 2D OTF (absolute values) at the focusing depth; (lower left) transverse cuts of the single and two photon 2D PSF's at the focusing depth and y " 0; (lower) transverse cuts of the single and two photon 2D OTF's at the focusing depth and f y " 0.

Figure 2 . 6 :

 26 Figure 2.6: Zernike modes for the corrective wavefront measured at 600 µm depth in the mouse cortex. The notation differs from the notation used in this thesis (see Figure 1.4. Figure extracted from the Supplementary Information of[START_REF] Wang | Direct wavefront sensing for high-resolution in vivo imaging in scattering tissue[END_REF].

Figure 2 . 7 :

 27 Figure 2.7: Normalized M 1 pa; z " 0q as a function of number of pixels in the back aperture N xy for different levels of aberrations a and a sample uniformly distributed along all directions. Axial sampling parameters: δ z " 0.375 µm, N z " 401 ô ∆ z " 150 µm. All points are normalized to the case of 512 pixels for each aberration type. The blue curve with circles correspond to the diffraction-limited 3D PSF 2 . The red curve with crosses correspond to the Wang set of aberrations with 5 rad rms of amplitude. The yellow curve with diamond symbols corresponds to the spherical aberration (5 rad rms of amplitude).

Figure 2 . 8 :

 28 Figure 2.8: Illustration of the 2D PSF at z " ∆ z {2 " 75 µm for each case of aberration and for 4 values of N xy . z 0 is the focusing depth. (left) diffraction-limited PSF at z " ∆ z {2 " 75 µm for N xy P r64, 128, 256, 512s; (center) PSF at z " ∆ z {2 " 75 µm for N xy P r64, 128, 256, 512s aberrated by the Wang's set of aberrations and amplitude 5 rad rms; (right) PSF at z " ∆ z {2 " 75 µm for N xy P r64, 128, 256, 512s aberrated by the spherical aberration and amplitude 5 rad rms.

Figure 2 . 9 :

 29 Figure2.9: Normalized M 1 pa; z " 0q as a function of the axial excursion ∆ z for different levels of aberrations a and a sample uniformly distributed along all directions. All points are normalized to ∆ z " 250 µm of the diffraction-limited case. The blue curve with circles corresponds to the diffraction-limited 3D PSF 2 . The red curve with crosses corresponds to the Wang set of aberrations with 5 rad rms of amplitude. The yellow curve with diamond symbols corresponds to the spherical aberration with 5 rad rms of amplitude.

Figure 2 . 10 :

 210 Figure2.10: Normalized M 1 pa; z " 0q as a function of the axial excursion ∆ z for different levels of aberrations a and a sample uniformly distributed along all directions. For each aberration case, the curve is normalized to the value observed at δ z " 0.1 µm. The blue curve corresponds to the diffraction-limited 3D PSF 2 . The red curve corresponds to the Wang aberrations with 5 rad rms of amplitude. The yellow curve corresponds to the spherical aberration with 5 rad rms of amplitude.

Figure 2 . 11 :

 211 Figure 2.11: Transverse cuts at the center of the diffraction-limited 3D PSF 2 (y " 0) at the focusing depth (z " 0) for each scenario. (upper) logarithmic scale; (lower) linear scale; The black continuous curve corresponds to the 3D PSF 2 with truncated uniform distribution of illumination. The dashed curves corresponds to the 3D PSF 2 with truncated Gaussian distribution of illumination for different values of waist. The red continuous curve corresponds to the 3D PSF 2 with a non-truncated Gaussian distribution of illumination with waist w " 0.5D. The red dashed horizontal line represents the quarter of the maximum. The blue dashed horizontal line represents the 1{e 4 of the maximum. The transverse resolution can be estimated by the full width of the 3D PSF 2 at the quarter of its maximum. All plots are normalized to their maximum.

Figure 2 . 12 :

 212 Figure2.12: Axial cuts at the center of the diffraction-limited 3D PSF 2 (x " 0, y " 0). (upper) logarithmic scale; (lower) linear scale; The black continuous curve corresponds to the 3D PSF 2 with truncated uniform distribution of illumination. The dashed curves corresponds to the 3D PSF 2 with truncated Gaussian distribution of illumination for different values of waist. The red continuous curve corresponds to the 3D PSF 2 with a non-truncated Gaussian distribution of illumination with waist w " 0.5D. The red dashed horizontal line represents the quarter of the maximum. The transverse resolution is given by the full width of the 3D PSF 2 at the quarter of its maximum. All plots are normalized to their maximum.

Figure 2 . 13 :

 213 Figure 2.13: Illustration of the 3D PSF 2 for 2 rad of coma aberration (Z 7 ). The maximum of the 3D PSF 2 is located at x " ´1.44 µm, y " 0 µm and z " 0 µm. (left) Transverse scan at z " 0 µm; (center) Axial profile yz at x " ´1.44 µm; (right) Axial profile xz at y " 0 µm.

Figure 2 .

 2 Figure 2.14: 3D PSF 2 cuts for 2 rad of coma aberration (Z 7). The maximum of the 3D PSF 2 is located at x " ´1.44 µm, y " 0 µm and z " 0 µm. (upper) Cut along the transverse x direction (y " 0, z " 0); (center) Cut along the transverse y direction (x " ´1.44 µm, z " 0 µm); (lower) Cut along the axial z direction (x " ´1.44 µm, y " 0 µm); The red dashed horizontal curve represents the quarter of the maximum. The transverse resolution is given by the full width of the 3D PSF 2 at the quarter of its maximum

Chapter 2 .Figure 2 . 15 :

 2215 Figure 2.15: Illustration of the 3D PSF 2 for 2 rad of spherical aberration (Z 11 ). The maximum of the 3D PSF 2 is located at x " 0 µm, y " 0 µm and z " 7.9 µm. (left) Transverse scan at z " 7.9 µm; (center) Axial profile yz at x " 0 µm; (right) Axial profile xz at y " 0 µm.

Figure 2 .

 2 Figure 2.16: 3D PSF 2 cuts for 2 rad of spherical aberration (Z 11). The maximum of the 3D PSF 2 is located at x " 7.9 µm, y " 0 µm and z " 7.9 µm. (upper) Cut along the transverse x direction (y " 0 µm, z " 7.9 µm); (center) Cut along the transverse y direction (x " 0 µm, z " 7.9 µm); (lower) Cut along the axial z direction (x " 0 µm, y " 0 µm); The red dashed horizontal line represents the quarter of the maximum. The transverse resolution is given by the full width of the 3D PSF 2 at the quarter of its maximum.

Figure 2

 2 Figure2.17: Computation of the complex amplitude Apρ x , ρ y ; zq for a reduced back aperture. α represents the factor reduction: for example, α " 1 correspond to the full back aperture diameter and α " 0.5 correspond to a truncation by half of the full back aperture diameter. The truncated Gaussian distribution is the multiplication of the Gaussian distribution Gpρ x , ρ y q with a binary mask P pρ x , ρ y q representing the reduced back aperture. The complex amplitude is calculated by multiplying the truncated Gaussian distribution with the exponential of the phase plus the right amount a d of defocus needed to axially displace the PSF.

Figure 2 . 18 :

 218 Figure 2.18: Mean image intensity M 1 at the focusing depth as function of back aperture diameter and of aberrations (Wang's set of aberration) for an uniform planar sample. α " 1 correspond to the full aperture diameter (512px), α " 0.5 corresponds to 256 pixels and α " 0.3 corresponds to 154 pixels. All the plots are normalized to the case of an Gaussian illumination distribution at the smallest aperture.

Figure 2 . 19 :

 219 Figure 2.19: Mean image intensity M 1 at the focusing depth as a function of back aperture diameter for different axial excursions ∆ z and for an infinite 3D sample uniformly distributed in the volume. α " 1 correspond to the full aperture diameter (512px), α " 0.5 corresponds to 256 pixels and α " 0.3 corresponds to 154 pixels. All the plots are normalized to the case of an Gaussian illumination distribution at full aperture and with a axial excursion of 150 µm.

Figure 2 . 20 :

 220 Figure 2.20: Mean image intensity M 1 at the focusing depth as function of back aperture diameter and of aberrations (Wang's set of aberration) for an uniform 3D sample. All the curves are normalized to the case of an Gaussian illumination distribution at full aperture.

Figure 2 .

 2 Figure 2.21 illustrates the evolution of M 1 as a function of aberration standard deviation for a in-focus fluorescent bead with varying diameter.First, we observe that, for any bead radius, the maximum is obtained in the absence of aberration. We obtain a higher sensitivity of M 1 for any aberration amplitudes for the small fluorescent beads (continuous blue curve to yellow curve). One can observe that between a 1 µm diameter bead (blue continuous curve) and a 2 µm diameter bead (light red dashed curve) there is no noticeable difference. Indeed, we observed in Sect. 2.3 that, in the case of a truncated Gaussian distribution illumination, the axial resolution is not smaller than « 3.4 µm when diffraction-limited. Then, structures with size smaller than the axial resolution can not be distinguished, resulting in the same impact in M 1 .

2. 6 .

 6 Figure 2.21: M 1 at the focusing depth (z " 0) as a function of aberrations standard deviation for a in-focus fluorescent bead with varying diameter. Each curve is normalized to its maximum.

Figure 2 .

 2 Figure 2.22 illustrates the evolution of M 1 as a function of aberration standard deviation for an in-focus fluorescent slab uniformly distributed along the transverse directions (perpendicular to the line of sight) with different thicknesses. Analogously to Fig.2.21, the maximum is obtained in the absence of aberrations. We obtain a higher sensitivity of M 1 for any aberration amplitudes for the finer fluorescent slabs. Between a 1 µm thick slab (blue continuous curve) and a 2 µm thick slab (light red dashed curve) there is no noticeable difference in what concerns the sensitivity to aberrations. I recall that structures which size is smaller than the axial resolution can not be distinguished, resulting in the same impact in M 1 . For a 1 µm thick slab (blue continuous curve), the ratio is R " 0.71 and one obtains a HWHM for σpa 0 q " 0.71 rad rms. For a slab with a thickness of 60 µm (blue dashed curve) and with σpa 0 q " 1 rad rms of aberration amplitude, one obtain a ratio of R " 0.28 and a HWHM at a 0 " 2.2 rad rms. For each sensitivity metric respectively, M 1 is 2.5 and 3.1 times more sensitive than in the case of the 60 µm diameter bead. In what concerns the 150 µm thick slab (black continuous curve), it corresponds to the

Figure 2 . 22 :

 222 Figure 2.22 illustrates the evolution of M 1 as a function of aberration standard deviation for an in-focus fluorescent slab uniformly distributed along the transverse directions (perpendicular to the line of sight) with different thicknesses. Analogously to Fig.2.21, the maximum is obtained in the absence of aberrations. We obtain a higher sensitivity of M 1 for any aberration amplitudes for the finer fluorescent slabs. Between a 1 µm thick slab (blue continuous curve) and a 2 µm thick slab (light red dashed curve) there is no noticeable difference in what concerns the sensitivity to aberrations. I recall that structures which size is smaller than the axial resolution can not be distinguished, resulting in the same impact in M 1 . For a 1 µm thick slab (blue continuous curve), the ratio is R " 0.71 and one obtains a HWHM for σpa 0 q " 0.71 rad rms. For a slab with a thickness of 60 µm (blue dashed curve) and with σpa 0 q " 1 rad rms of aberration amplitude, one obtain a ratio of R " 0.28 and a HWHM at a 0 " 2.2 rad rms. For each sensitivity metric respectively, M 1 is 2.5 and 3.1 times more sensitive than in the case of the 60 µm diameter bead. In what concerns the 150 µm thick slab (black continuous curve), it corresponds to the

Figure 2 . 23 :Figure 2 . 24 :

 223224 Figure 2.23: Evolution of M 1 as a function of two aberrations between -5 and 5 rad rms of amplitude. (1/3)

Figure 2 . 25 :Figure 2 . 26 :

 225226 Figure 2.25: Evolution of M 1 as a futon of two aberrations between -5 and 5 rad rms of amplitude. (3/3)

1 3 . 6

 136 Description of the estimation procedure . . . . . . . . . . . . . 77 3.5.2 Choice of the adequate image quality metric for the axial locking 78 3.5.2.1 Image intensity variance (M 2 ) . . . . . . . . . . . . . 80 3.5.2.2 Pre-filtered Image intensity variance (M 3 ) . . . . . . . 81 Ex vivo and in vivo application of ALMS . . . . . . . . . . . . 86 3.6.1 Reader's guide . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 3.6.2 Scientific Reports paper: Image-based adaptive optics for in vivo imaging of the hippocampus . . . . . . . . . . . . . . .

Figure 3 .Figure 3 . 1 :

 331 Figure 3.1 illustrates the interaction between the diffraction-limited 3D PSF 2 and the fluorescent bead in this considered scenario. I illustrate a 2D axial profile xz at the center of the 3D PSF 2 and the bead, a 2D axial profile xz at the center of the z-stack image and the evolution of the different axial distributions. I recall that the mean image intensity of the transverse scan M 1 at z 0 " 0 µm can be calculated by the integration of the combined axial distribution along the axial direction (Eq.(2.7) p. 28).

Figure 3 . 2 :

 32 Figure 3.2: Mean image intensity metric M 1 as a function of coma (Z 7 ) amplitude for an in-focus bead.

Figure 3 . 3 :

 33 Figure 3.3: Schematic illustration of the interaction between the aberrated 3D PSF 2 (with 2.1 rad of coma aberration) and the out-of-focus fluorescent bead. The figure follows the same description of Fig. 3.1.

3. 2 . 3 . 2 Figure 3 . 4 :

 23234 Figure 3.4: Schematic illustration of the interaction between the diffraction-limited 3D PSF 2 and the out-of-focus fluorescent bead. The figure follows the same description of Fig. 3.1.

Figure 3 . 5 :Figure 3 . 6 :

 3536 Figure 3.5: Mean image intensity metric M 1 as a function of coma (Z 7 ) amplitude for an out-of-focus bead.

Figure 3 .

 3 Figure 3.7 presents the evolution of M 1 as a function of spherical aberration (Z 11 ).It can observed that a maximum of M 1 is obtained for a 11 " ´2.3 rad. Like for the coma aberration, by adding spherical aberration one deforms the 3D PSF 2 which results in an increasing of the mean image intensity.

3. 2 .Figure 3 . 7 :

 237 Figure 3.7: Mean image intensity metric M 1 as a function of spherical aberration (Z 11 ) amplitude for an out-of-focus bead.

Figure 3 . 8 :

 38 Figure 3.8: Schematic illustration of the interaction between the aberrated 3D PSF 2 (with -2.3 rad of spherical aberration) and the out-of-focus fluorescent bead. (a) Schematic illustration of the 2D axial profile xz of the point spread function and of the fluorescent bead. (b) Schematic illustration of the 2D axial profile xz of the symmetrical point spread function and of the fluorescent bead. (c) Schematic illustration of the 2D axial profile xz of the z-stack image. The horizontal white dashed line represents the theoretical focusing depth, here z 0 " 0; (d) Axial distributions interaction. The green line represents the bead axial distribution. The orange line correspond to the 3D PSF 2 axial distribution h 2 a pzq. The orange dashed line represent the symmetrical axial distribution | h 2 a pzq. The blue line represents the combined axial distribution. The excitation beam propagates along the z axis.

Figure 3 . 9 :

 39 Figure 3.9: Measured axial displacement, by cross-correlation, of the 3D PSF 2 as function of aberration (blue line) and three different linear fits; (left) overall view between -5 to 5 rad;(right) zoom between -1 and 1 rad; Linear fit between -5 and 5 rad (red dashed line); Linear fit between -2 and 2 rad (yellow dashed line); Linear fit between -1 and 1 rad (green dot-dashed line). The gradient of each fit is given on the legend.

Figures 3 .

 3 Figures 3.10 and 3.11 represent the axial profiles XZ at the center of the 3D PSF 2 for different values of Z 1 11 and for ∆ 1 and ∆ 3 respectively. For comparison, in Fig. 3.12 is illustrated the axial profiles XZ at the center of the 3D PSF 2 for different values of the standard spherical aberration Z 11 . a11 = -5rad a4 = -11.7rad

Figure 3 . 10 : 4 a11

 3104 Figure 3.10: XZ cuts of the 3D PSF 2 for different values of Z 1 11 " Z 11 `∆1 Z 4

Figure 3 . 11 :

 311 Figure 3.11: XZ cuts of the 3D PSF 2 for different values of Z 1 11 " Z 11 `∆3 Z 4

Figure 3 .Figure 3 . 12 :Figure 3 . 13 :

 3312313 Figure 3.13 illustrates the z-stack axial profile xz, as function of a displacement-free spherical aberration Z1 11 " Z 11 `∆1 Z 4 when imaging the out-of-focus bead, and the

Figure 3 . 14 :

 314 Figure 3.14: Illustration of the Axially-Locked Modal Sensorless (ALMS) approach.

Figure 3 . 15 :

 315 Figure 3.15: 3D view of the digitized sample representing a brain slab.

Figure 3 .

 3 Figure 3.16 shows the mean image intensity M 1 of the transverse scan as a function of focusing depth when diffraction-limited. For comparison, the object axial distribution is also illustrated.

Figure 3 . 16 :Figure 3 . 17 :

 316317 Figure 3.16: Mean image intensity M 1 as a function of focusing depth when diffraction-limited and object axial distribution.

Figure 3 .

 3 Figure 3.18 shows the image intensity variance M 2 of the transverse scan as a function of focusing depth z when imaging is diffraction-limited. For comparison, M 1 is also illustrated (normalized to the maximum value of M 2 ).

Figure 3 . 18 :

 318 Figure 3.18: Image intensity variance M 2 and mean image intensity M 1 as a function of focusing depth

Figure 3 . 19 :

 319 Figure 3.19: Band-pass filter used to pre-filter the image before calculating the image intensity variance. (left) 2D view; (right) Cut of the filter at the position indicated by the white line if the plot on the left (ρ y " 0).

Figure 3 .Figure 3 . 20 :

 3320 Figure 3.20 shows the pre-filtered image variance M 3 of the transverse scan as a function of the focusing depth and Figure3.21 presents the pre-filtered scans for the same focusing depths considered before.

Figure 3 . 21 :

 321 Figure 3.21: Transverse scans at z " ´7.5 µm (upper left), z " 1.125 µm (upper right) and z " 7.875 µm (lower) extracted from a 3D numerical model simulating a brain slab; The pre-filtered image intensity variance for each scan are 0.25, 0.04 and 0.18, respectively.

Figure 3 . 22 :

 322 Figure 3.22: Sensitivity of aberrations at z " 7.875 µm. (left) Metrics as function of coma; (center) Metrics as function of spherical aberration;

Figure 3 . 23 :

 323 Figure 3.23: Sensitivity of aberrations at z " 7.875 µm. (left) Metrics as function of coma; (right) Metrics as function of spherical aberration;

Figure 3 . 24 :

 324 Figure 3.24: Sensitivity of aberrations at z " ´1.125 µm. (left) Metrics as function of coma; (center) Metrics as function of spherical aberration;

Figure 3 . 25 :

 325 Figure 3.25: Schematic representation of the microscope.

3. 6 .

 6 Ex vivo and in vivo application of ALMS 87 Sect. 3.1 to 3.5 of the current chapter.

Figure 1 .

 1 Figure 1. Sample-dependence of image-based correction methods. Simulated variation of the mean image intensity metric with respect to aberration amplitude with a 10 μ m fluorescent bead in focus (A,B) and 12 μm out-of-focus (C,D) for coma (A,C) and spherical aberration (B,D). Insets: schematics of the 2D axial profile (xz) of the point spread function and the fluorescent bead for different aberration amplitudes: -2.1, 0, 2.1 rad of coma (A,C); -2.3, 0, 2.3 rad of spherical aberration (B) and -2.3, 0 rad of spherical aberration (D). The focused beam propagates along the Z axis.

Figure 2 .

 2 Figure 2. Simulated axial variation of different metrics. (A) 3D views of the neuron model: two neurons somata (dotted circles) and several dendrites built using fixed hippocampal slices of GFP-expressing neurons. (B) Axial variation of the three considered metrics, the somata positions are indicated by the blue and red dotted line respectively.

Figure 3 .

 3 Figure 3. Sensitivity of the different metrics to aberrations. Variation of the three considered metrics with respect to coma (A,C) and spherical aberration (B,D), using simulated transverse scans, at z = -8 μm, on the 3D reconstructed neurons with detection noise (A,B) and using experimental transverse scans of GAD67KI-GFP hippocampal slices in a densely packed region 100 μ m deep (C,D). Insets represent the phase profiles of coma and spherical aberrations.

Figure 4 .

 4 Figure 4. Axially-locked method in hippocampal slices. (A) Example ROI, 200 μ m deep in a GAD67KI-GFP hippocampal slice, without and with wavefront correction (No AO and Full AO), scale bar: 100 μ m. (B) Axial variation of the metric M 3 in the same slice, the maximum of the metric was at 198 μ m. (C) Axial profiles of a representative neuron without and with wavefront correction (No AO and Full AO) and their respective fit. (D) Signal and resolution increase with wavefront correction, calculated using the axial fit of n = 36 somata; boxplots showing median (red lines) and inter-quartile range (IQR, rectangle), whiskers and outliers are calculated with a 1.5*IQR threshold. (E) Median amplitude of the correction (n = 5 FOVs) on each considered Zernike modes for setup correction and full (setup + sample) correction, Zernike modes are indexed following the A176988 sequence.

Figure 5 .

 5 Figure 5. Axially-locked method in living mouse. (A) Example ROI, 175 μ m deep in the CA1 hippocampal region of a living mouse, without and with wavefront correction (No AO and Full AO), scale bar: 100 μ m. (B) Axial variation of the metric M 3 in the same slice, the maximum of the metric was at 168 μ m, the pyramidal cell layer spanned from 162 to 187 μ m. (C) Axial profiles of a representative neuron without and with wavefront correction (No AO and Full AO) and their respective fit. (D) Signal and resolution increase with wavefront correction and setup correction, calculated using the axial fit of n = 11 somata; boxplots showing median (red lines) and inter-quartile range (IQR, rectangle), whiskers and outliers are calculated with a 1.5*IQR threshold. (E) Amplitude of the correction on each considered Zernike modes for setup correction and full (setup + sample) correction, Zernike modes are indexed following the A176988 sequence.

Contents 4 . 1

 41 Optimization strategy . . . . . . . . . . . . . . . . . . . . . . . . 102 4.1.1 Axial locking . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 4.1.2 Aberration estimation -1D optimization algorithm . . . . . . . 103

4 . 1 kFigure 4 .

 414 Figure 4.1 illustrates the exhaustive search algorithm.

Figure 4 Figure 4 . 2 :

 442 Figure 4.2 illustrates this algorithm.

Figure 4 . 3 :

 43 Figure 4.3: Principle of the optimization algorithms. The metric M is plotted as a function of the aberration amplitude of coma and spherical aberration. (left) global DM update algorithm; (right) sequential DM update algorithm. Figure extracted and adapted from[Facomprez et al., 2012]

Figure 4 .

 4 Figure 4.4 summarizes the organization of the simulations results.

Figure 4 .

 4 Figure 4.5 presents the evolution of the focusing depth and the evolution of the residual wavefront standard deviation as a function of iteration number considering an initial wavefront weakly aberrated: 1 rad rms standard deviation.

4. 2 .

 2 Comparison of the SMS and the ALMS approach

Figure 4 . 4 :

 44 Figure 4.4: Diagram illustrating the organization of the simulation results. The background colors correspond to the respective curves in the indicated figure.

Chapter 4 .Figure 4 . 5 :

 445 Figure 4.5: Comparison of the accuracy of aberration correction between the SMS, the SMS-DF and the ALMS approach with the exhaustive search algorithm. Initial wavefront standard deviation: 1 rad rms (weak aberrations). The detection noise is not simulated. (left) Focusing depth as a function iterations; (right) Residual wavefront standard deviation as a function of iterations. The evolution of each aberration amplitudes can be found in Sect. C.1 p. 133.

Figure 4 .

 4 Figure 4.6 presents the evolution of the focusing depth and the evolution of the residual wavefront standard deviation as a function of iterations for the case of a strong aberrations: 2.82843 rad rms standard deviation. Both standard approaches set the initial focusing depth at « ´4.5 µm. Of course, by construction, the SMS approach does not change defocus. The SMS-DF approach, however, adds a given amount of defocus together with spherical aberration to compensate for the axial displacement. The ALMS approach set the initial focusing depth at « ´10 µm, near the center of the neuron's soma (seeFig. D.2 p. 150) and after one iteration, the focusing depth converges to near the neuron's soma center. I recall that, to accelerate the simulation computation, the axial sampling step was changed to 1.125 µmwhich defines the sampling step for the axial locking. For what concerns the aberration estimation, the three approaches converge in about three iterations. The SMS-DF approach obtains a residual wavefront with « 0.24 rad rms of amplitude. The SMS approach obtains a residual wavefront with « 0.16 rad rms of amplitude. These two biases are due to the addition of spherical aberration. Because the focusing depth is near the border of the neuron's soma, by adding some amount of

Figure 4 . 6 :

 46 Figure 4.6: Comparison of the accuracy of aberration correction between the SMS, the SMS-DF and the ALMS approach with the exhaustive search algorithm. Initial wavefront standard deviation: 2.82843 rad rms (strong aberrations). The detection noise is not simulated. (left) Focusing depth as a function of iterations; (right) Residual wavefront standard deviation as a function of iterations. The evolution of each aberration amplitudes can be found in Sect. C.2 p. 135.

  Fig. C.8 p. 136).

Figure 4 .

 4 Figure 4.7 presents the evolution of the focusing depth and the evolution of the residual wavefront standard deviation as a function of iterations for the case of very strong aberrations: 5 rad rms standard deviation. In this case, the ALMS approach set the initial focusing depth at « ´11.1 µm and converges to the neuron's soma center in two iterations. For what concerns the aberration estimation, the results are similar to the previous case. The three approaches converge in three iterations. At the last iteration, the residual wavefront amplitudes for the SMS, SMS-DF and ALMS approaches are respectively 0.1, 0.17 and 0.06 rad rms: the SMS-DF performs slightly worse than the SMS and the ALMS approaches. Like in the case of a weak aberrations, the small residual wavefront obtained for the ALMS approach is due to the sampling step of the exhaustive search algorithm (see Sect. C.3 p. 136).

Chapter 4 .Figure 4 . 7 :

 447 Figure 4.7: Comparison of the accuracy of aberration correction between the SMS, the SMS-DF and the ALMS approach with the exhaustive search algorithm. Initial wavefront standard deviation: 5 rad rms (very strong aberrations). The detection noise is not simulated. (left) Focusing depth as a function of iterations; (right) Residual wavefront standard deviation as a function of iterations. The evolution of each aberration amplitudes can be found in Sect. C.3 p. 136.

Figure 4 . 8 :

 48 Figure 4.8: Comparison of the accuracy of aberration correction between different modal sensorless modalities of the ALMS approach and the SMS-DF approach with the Gaussian fit algorithm. Initial wavefront standard deviation: 1 rad rms (weak aberrations). The detection noise is not simulated. (left) Focusing depth as a function of iterations; (right) Residual wavefront standard deviation as a function of iterations. The evolution of each aberration amplitudes can be found in Sect. C.4 p. 138.

Figure 4 .Figure 4 . 9 :

 449 Figure 4.9 presents the evolution of the focusing depth and the evolution of the residual wavefront standard deviation as a function of iterations for the case of strong aberrations: 2.82843 rad rms standard deviation. The SMS-DF approach sets the initial focusing depth at « ´4.5 µm. Small quantities

Figure 4 .

 4 Figure 4.10 presents the evolution of the focusing depth and the evolution of the residual wavefront standard deviation as a function of iteration number for the case of very strong aberrations: 5 rad rms standard deviation.

4. 2 .Figure 4 . 10 :

 2410 Figure 4.10: Comparison of the accuracy of aberration correction between different modal sensorless modalities of the ALMS approach and the SMS-DF approach with the Gaussian fit algorithm. Initial wavefront standard deviation: 5 rad rms (very strong aberrations). The detection noise is not simulated. (left) Focusing depth as a function of iterations; (right) Residual wavefront standard deviation as a function of iterations. The evolution of each aberration amplitudes can be found in Sect. C.6 p. 141.

Figure 4 .

 4 Figure 4.11 presents the evolution of the focusing depth and the evolution of the residual wavefront standard deviation as a function of iteration number for the case of weak

Figure 4 . 12 :

 412 Figure 4.12: Comparison of the accuracy of aberration correction between different modal sensorless modalities of the ALMS approach and the SMS-DF approach with the Gaussian fit algorithm. Initial wavefront standard deviation: 2.82843 rad rms (strong aberrations). The detection noise is simulated. (left) Focusing depth as a function of iterations; (right) Residual wavefront standard deviation as a function of iterations. The evolution of each aberration amplitudes can be found in Sect. C.8 p. 145.

Figure 4 .Figure 4 . 13 :

 4413 Figure 4.13 presents the evolution of the focusing depth and the evolution of the residual wavefront standard deviation as a function of iterations for the case of very strong aberrations: 5 rad rms standard deviation.

Figure B. 1 :

 1 Figure B.1: Axial displacement as a function of spherical aberration Z 11 for Gaussian (left) and uniform (right) illumination distribution. The blue curve represents the evolution of the 3D PSF 2 's axial center of mass; The red curve represents the evolution axial coordinate of the 3D PSF 2 's maximum; The green curve represents the evolution of the axial coordinate of the 3D PSF 2 's axial distribution. Lower figures are the same figures zoomed between -1.2 and 1.2 rad.

Figure B. 2 :Figure C. 2 :Figure C. 3 :

 223 Figure B.2: Illustration of the 3D PSF 2 's deformation with 2.6 rad of spherical aberration Z 11 for Gaus sian (upper) and uniform (lower) illumination distribution. (left) figures presents the axial cut of the 3D PSF 2 at y " 0. On the (right) figures: the blue continuous curve represents the axial distribution of the 3D PSF 2 ; the green curve represents the evolution of the 3D PSF 2 along the optical axis; the dashed lines represents respectively the locations for the center of mass, the maximum of the 3D PSF 2 and the maximum of the 3D PSF 2 's axial distribution.

Figure C. 4 :Figure C. 5 :Figure C. 6 :Figure C. 7 :Figure C. 8 :Figure C. 9 :Figure C. 10 :

 45678910 Figure C.4: Supplementary figure of Fig. 4.5. Evolution of the spherical aberration amplitude as a function of iterations for a weakly aberrated wavefront.

Figure C. 11 :

 11 Figure C.11: Supplementary figure of Fig. 4.7. Evolution of the two trefoil aberration amplitudes as a function of iterations for a very strongly aberrated wavefront.

Figure C. 12 :Figure C. 13 :Figure C. 14 :Figure C. 15 :

 12131415 Figure C.12: Supplementary figure of Fig. 4.7. Evolution of the spherical aberration amplitude as a function of iterations for a very strongly aberrated wavefront.

Figure C. 16 :Figure C. 17 :Figure C. 18 :Figure C. 19 :Figure C. 20 :Figure C. 21 :Figure C. 22 :

 16171819202122 Figure C.16: Supplementary figure of Fig. 4.8. Evolution of the spherical aberration amplitudes as a function of iterations for a weakly aberrated wavefront.

Figure C. 23 :Figure C. 24 :Figure C. 25 :Figure C. 26 :Figure C. 27 :

 2324252627 Figure C.23: Supplementary figure of Fig. 4.10. Evolution of the two trefoil aberration amplitudes as a function of iterations for a very strongly aberrated wavefront.

Figure C. 28 :FigureFigureFigureFigureFigureFigure

 28 Figure C.28: Supplementary figure of Fig. 4.11. Evolution of the spherical aberration amplitudes as a function of iterations for a weakly aberrated wavefront.

FigureFigure D. 2 :

 2 Figure C.35: Supplementary figure of Fig. 4.13. Evolution of the two trefoil aberration amplitudes as a function of iterations for a very strongly aberrated wavefront.

Figure D. 3 :Figure D. 4 :

 34 Figure D.3: Evolution of M 1 and M 3 as a function of the focusing depth considering a very strongly aberrated wavefront (5 rad rms). For comparison, the object and 3D PSF 2 axial distributions are also plotted. All curves are normalized. Detection noise is not considered.

Figure D. 5 :Figure D. 6 :

 56 Figure D.5: Evolution of M 1 and M 3 as a function of the focusing depth considering a strongly aberrated wavefront (2.82843 rad rms). For comparison, the object and 3D PSF 2 axial distributions are also plotted. All curves are normalized. Detection noise is considered.

  1.5.2 Indirect methods for aberration correction . . . . . . . . . . . . 20 1.5.2.1 The pupil segmentation approach . . . . . . . . . . . 20 1.5.2.2 The modal sensorless approach . . . . . . . . . . . . . 21

	1.5.2.3 Sample dependence of the modal sensorless approach	22
	1.5.2.4 Displacement-free approach to reduce the sample de-

pendence . . . . . . . . . . . . . . . . . . . . . . . . . 22 1.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

Contents 2.1 A new mathematical formulation for the mean image intensity 27 2.2 Modeling the numerical two photon microscope . . . . . . . . 28

	26	Chapter 2. Study of the impact of aberrations
	have developed a tool called numerical microscope which consists in computing the 3D
	PSF 2 and convolving it with a sample (a.k.a. object). I describe here how the 3D PSF 2 is
	computed. I will also discuss the numerical sampling parameters one should consider to
	correctly compute the 3D PSF 2 with a reasonable computation time.
	In Section 2.1 I derive an new analytical expression for the mean image intensity metric.
	In Section 2.2 I present the numerical microscope used to simulate the 3D PSF 2 and the
	adequate sampling parameters.
	Then I characterize the diffraction limited 3D PSF in Sect. 2.3 and the aberrated 3D
	PSF 2 in Sect. 2.4. I characterize in Sect. 2.5 and Sect. 2.6 the evolution of the mean
	image intensity for different values of aberrations, different numerical aperture values
	and different sample distribution.
	Finally, I analyze in Sect. 2.7 the evolution of M 1 in the N -dimensional aberration
	space.
		2.2.1 Simulation of the 3D PSF for single and two photon imaging . 28
		2.2.2 Choice of the transverse sampling in two photon imaging . . . 33
		2.2.3 Choice of the back aperture diameter in pixels . . . . . . . . . 35
		2.2.4 Choice of the axial sampling parameters: pitch and axial excursion 39
	2

.3 Characterization of the diffraction-limited 3D PSF 2 . . . . . 41

	2.3.1 Characterization of the 3D PSF 2 in the transverse directions . 42
	2.3.2 Characterization of the 3D PSF 2 in the axial direction . . . . . 42
	2

.4 Characterization of the 3D PSF 2 in the presence of aberrations 45 2.5 Evolution of M 1 as a function of aberrations and numerical aperture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

	2.5.1 Analytical analysis of M 1 for the diffraction limited case . . . . 50
	2.5.1.1 M 1 as a function of numerical aperture for a planar
	sample . . . . . . . . . . . . . . . . . . . . . . . . . . 50
	2.5.1.2 M 1 as a function of numerical aperture and for a 3D
	uniform sample . . . . . . . . . . . . . . . . . . . . . . 52
	2.5.2 Numerical analysis of M 1 as a function of NA and of aberrations 52
	2.5.2.1 Evolution of M 1 as a function of numerical aperture
	and of aberrations for a planar sample . . . . . . . . . 53
	2.5.2.2 Evolution of M 1 as a function of numerical aperture
	and of aberrations for a uniform 3D sample . . . . . . 54
	2

.6 Evolution of M 1 as a function of aberrations and sample structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

	2.6.1 Uniform fluorescent bead with varying diameter . . . . . . . . 56
	2.6.2 Uniform fluorescent slab with varying thickness . . . . . . . . . 57
	2

.7 Evolution of M 1 in the N -dimensional aberration space . . . 58 2.8 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

	2.1. A new mathematical formulation for the mean image intensity

y ; zq to obtain a 2kN xy ˆ2kN xy array

					with
	k ě 1.
	Figure 2.2 illustrates the computation of the single photon PSF (2D PSF).
	By multiplying the number of pixels of the 2D PSF with the pixel size we obtain the
	transverse field of view ∆ xy , which is independent of the sampling factor k:
	∆ xy " 2kN xy ˆδxy " 2kN xy	ˆλn 4k NA
	" N xy	ˆλn 2NA	" N xy ˆrxy .	(2.19)

x , ρ

  2.2.2, 2.2.3 and 2.2.4) leads to the selection of a set of default values given inTable 2.2.

		‹ Pitch	δ z " 0.375 µm
	Axial parameters	‹ Number of planes	N z " 401
		Axial excursion	∆ z " δ z ˆNz " 150 µm
		‹ Back aperture diameter	N xy " 256
	Transverse	in pixels
	parameters	‹ Oversampling factor	k " 1
		Transverse pixel size	δ xy "	rxy 2k " λn 4k NA " 0.3824 µm
		Transverse field of view	∆

xy " 2kN xy ˆδxy « 196 µm

Table 2 .

 2

2: Default numerical microscope simulation parameters. Numerical values are given for:

  .3.

		‹ Pitch	δ z " 0.1 µm
	Axial parameters	‹ Number of planes	N z " 1001
		Axial excursion	∆ z " δ z ˆNz " 100 µm
		‹ Back aperture diameter	N xy " 256
	Transverse	in pixels
	parameters	‹ Oversampling factor	k " 24
		Transverse pixel size	δ xy "	rxy 2k " λn 4k NA " 0.0159 µm
		Transverse field of view	∆

xy " 2kN xy ˆδxy « 196 µm

Table 2 .

 2

3: Numerical microscope simulation parameters fo a very detailed 3D PSF 2 . Numerical values are given for: NA " 0.8, λ " 0.92 µm, n " 1.33 and r xy " λn{p2 NAq " 0.765 µm

Table 2

 2

	.2. However, if I consider

xy " 256) for the full back aperture diameter, reducing the back aperture diameter down to 30% of the full diameter will result in a 77 pixels diameter. As we observed in Sect. 2.2.3, a very small N xy can results in undesirable non-physical effects. Thus, I use N xy " 512 pixels to represent the full back aperture diameter. The smallest diameter is represented by 153 pixels which I consider acceptable.

  5 and Z 6 ), coma (Z 7 and Z 8 ), trefoil (Z 9 and Z 10 ) and sphericalaberration (Z 11 ). Figures 2.23, 2.24 and 2.25 illustrate the results.

  3.7 the choice of the modal basis and the notion of orthonormality are discussed.The work presented in this chapter was partially published in our Scientific Reports article that is incorporated in Sect. 3.6.2. Meanwhile, some aspects of the theoretical development of this approach are developed with more details in Sect. 3.1 to Sect. 3.5 of this chapter. The reader mainly interested in the experimental application of the ALMS approach can directly read the paper, which gives a concise overview of both theoretical and experimental results.

  .1.

		‹ Pitch	δ z " 1.125 µm
	Axial parameters	‹ Number of planes	N z " 135
		Axial excursion	∆ z " δ z ˆNz " 150 µm
		‹ Back aperture diameter	N xy " 256
	Transverse	in pixels
	parameters	‹ Oversampling factor	k " 1
		Transverse pixel size	δ xy "	rxy 2k " λn 4k NA " 0.3824 µm
		Transverse field of view	∆ xy " 2kN xy ˆδxy « 196 µm

Table 4 .

 4 1: End-to-end simulations numerical parameters. Numerical values are given for: NA " 0.8 the numerical aperture of the microscope, λ " 0.92 µm the wavelength of the excitation beam, n " 1.33 the refractive index of the medium in which is inserted the objective of the microscope (water) and r xy " λn{p2 NAq " 0.765 µm the transverse resolution.

  Chapter 4. Study of the ALMS approach performance aberrations: 1 rad rms standard deviation. Comparison of the accuracy of aberration correction between different modal sensorless modalities of the ALMS approach and the SMS-DF approach with the Gaussian fit algorithm. Initial wavefront standard deviation: 1 rad rms (weak aberrations). The detection noise is simulated. (left) Focusing depth as a function of iterations; (right) Residual wavefront standard deviation as a function of iterations. The evolution of each aberration amplitudes can be found in Sect. C.7 p. 143.

		-7.8						1
								0.9				ALMS 2N+1 ALMS 3N
		-8						0.8				ALMS 4N+1 ALMS 5N
												SMS-DF 5N
	z 0 [ m]	-8.6 -8.4 -8.2	ALMS 2N+1 ALMS 3N ALMS 4N+1 ALMS 5N SMS-DF 5N				standard deviation [rad rms]	0.3 0.4 0.5 0.6 0.7
		-8.8						0.2
								0.1
		-9						0
		0	1	2	3	4	5	0	1	2	3	4	5
				iteration						iteration
	Figure 4.11:

  have claimed that their technique naturally forms a focal volume onto the strongest bright feature present in the sample, but this was based on a mere qualitative analysis. If sample dependence is observed one could probably revisit these approaches based on the developments presented in this thesis.128Chapter A. Axial displacement induced by defocus focal distance in the air. Assuming here that we are in the paraxial approximation NA" α{2 " nD{p2f pnqq. We have then that:If one approximates the defocused wavefront with an parabolic function, by the reflective property, it can be easily shown that the tangent of the parabola represent in the figure intersects the back aperture plane at D{4, Thus, the distance δl between the two wavefronts at the edge of the back aperture edge is then given by:

	130	Chapter B. 3D PSF 2 's deformations -uniform back-aperture case
						α "	nD f pnq	ô αf pnq " nD	(A.1)
	By adding an amount a d of defocus, one can move the focus point by δz (Fig. A.1).
	Thus:
		α "	npD `2hq f pnq `δz	ô αf pnq `αδz " npD `2hq
						ô h "	nD `pnD{f pnq qδz ´nD 2n	"	Dδz 2f pnq	.	(A.2)
	and
				γ "	h f p1q	"	δz 2f p1q f pnq	"	Dδz p1q 2nf 2	.	(A.3)
						δl "	D 4	γ ô δl "	D 2 δz p1q 8nf 2	.	(A.4)
	As we are in the air, the optical path difference is
												∆ " δl	(A.5)
	and translates in a phase difference:
				δϕ "	2π λ p1q	δl "	2πD 2 p1q λ p1q n8f 2	δz.	(A.6)
	Which is also given by a defocus a d Z 4 prq where Z 4 prq "	?	3p2r 2 ´1q, i.e.:
				δϕ " rZ 4 pr " 1q ´Z4 pr " 0qsa d	(A.7)
	With the Equations (A.6) and (A.7) one obtains:
	δz "	8λ p1q nf 2 p1q 2πD 2 δϕ " δz "	8 ?	3λ p1q nf 2 p1q πD 2	a d "	2	? πNA 2 a d , 3λ p1q n	ˆN A "	nD 2f pnq	"	2f p1q D	˙.
													(A.8)
	Finally, a defocus with amplitude a d displace the focus by δz is given by:
							a d pzq "	πNA 2 ? 2 3λ p1q n	z.	(A.9)

MATLAB R2015a. PC Specifications: quad-core 4x3.6 GHz processor, 1600 MHz 16Gb RAM

Chapter 2. Study of the impact of aberrations

Scientific RepoRts | 7:42924 | DOI: 10.1038/srep42924 www.nature.com/scientificreports

Scientific RepoRts | 7:42924 | DOI: 10.1038/srep42924

Acknowledgements

Acknowledgements

This work was supported by the INSERM, CNRS and ONERA. This project has received funding from the Agence Nationale de la Recherche (ANR11-INSB-0006, ANR-10-INSB-04-01, ANR-15-CE19-0018-01), the Aix-Marseille Université (ANR-11-IDEX-0001-02), the Fondation pour la Recherche Médicale (DBS20131128448), the European Research Council (ERC) under the European Union's FP7 and Horizon 2020 research and innovation program (grant agreement #242842 and 646925), from the DFG (Deutsche Forschungsgemeinschaft Project # RE 3657/1-1) and the WHRI Cofund (PCOFUND-GA-2013-608765).

Data availability. Supporting data is accessible on Figshare: https://dx.doi.org/10.6084/m9.figshare.4012737.v1.

Author Contributions

Additional Information

Supplementary information accompanies this paper at http://www.nature.com/srep

Competing financial interests:

The authors declare no competing financial interests.

Appendices

Appendix A Amount a d of defocus Z 4 to induce a given axial displacement z We intend here to calculate the amount of defocus one need to add to the wavefront in order to displace the focus by δz. Note that using a defocus (therefore a parabolic wave-front rather than a portion of sphere) is an approximation for the computation of the 3D PSF in the various transverse planes along z. It could be of course interesting to investigate the consequences of this approximation. This aspect is however beyond the scope of the present study.

Consider a circular back aperture of diameter D. A planar wavefront that passes through the back aperture is focused, by a lens inserted in a medium with refractive index n and with a numerical aperture NA, at the focal distance f pnq " nf p1q where f p1q is the

Appendix B

Deformations of the 3D PSF 2 and sample dependence for a uniform illumination back-aperture: case of spherical aberration

We study here the case of a back-aperture uniform illumination for what concerns the effect of spherical aberration on the 3D PSF 2 and the related sample dependence. I first perform an analysis of the 3D PSF 2 's deformations considering a uniformly illuminated pupil back-aperture. For a set of spherical aberration amplitudes, I computed two 3D PSF 2 for the two cases of pupil back aperture illumination distribution (uniform and Gaussian cases of Sect. 3.2 p. 69). I thus estimated the displacement for each aberrated 3D PSF 2 using three different criteria:

• the 3D PSF 2 's axial center of mass -the unique point where the weighted relative position of the distributed mass sums to zero. I use here the notation CDM z phq to represent the axial center of mass (centre de masse):

• the axial coordinate of the 3D PSF