# Multiplexed temporally focused light shaping for high-resolution multi-cell targeting

Nicolò Accanto, Clément Molinier, Dimitrii Tanese, Emiliano Ronzitti, Zachary L. Newman, Claire Wyart, Ehud Isacoff, Eirini Papagiakoumou, Valentina Emiliani

► To cite this version:

Nicolò Accanto, Clément Molinier, Dimitrii Tanese, Emiliano Ronzitti, Zachary L. Newman, et al. Multiplexed temporally focused light shaping for high-resolution multi-cell targeting. Optica, 2018, 5 (11), pp.1478-1491. hal-01945948

HAL Id: hal-01945948

https://hal.sorbonne-universite.fr/hal-01945948

Submitted on 5 Dec 2018

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_2.png" /></figure>

# Multiplexed temporally focused light shaping for high-resolution multi-cell targeting

NICOLÒ ACCANTO,<fnref n="1" />,<fnref n="2" />,† CLÉMENT MOLINIER,<fnref n="1" />,<fnref n="2" />,† DIMITRII TANESE,<fnref n="1" />,<fnref n="2" /> EMILIANO RONZITTI,<fnref n="1" />,<fnref n="2" />

ZACHARY L. NEWMAN,<fnref n="3" /> CLAIRE WYART,<fnref n="4" /> EHUD ISACOFF,<fnref n="3" />,<fnref n="5" />,<fnref n="6" /> EIRINI PAPAGIAKOUMOU,<fnref n="1" />,<fnref n="2" />

AND VALENTINA EMILIANI<fnref n="1" />,<fnref n="2" />,*

Received 26 April 2018; revised 10 September 2018; accepted 5 October 2018 (Doc. ID 330207); published 19 November 2018

Optical wavefront shaping is a powerful technique to control the distribution of light in the focus of a microscope. This ability, combined with optogenetics, holds great promise for precise manipulation of neuronal activity with light. However, a deeper understanding of complex brain circuits requires pushing light-shaping methods into a new regime: the simultaneous excitation of several tens of targets, arbitrarily distributed in the three dimensions, with single-cell resolution. To this end, we developed a new optical scheme, based on the spatio-temporal shaping of a pulsed laser beam, to project several tens of spatially confined two-photon excitation patterns in a large volume. Compatibility with several different phase-shaping strategies allows the system to be optimized towards flexibility, simplicity, or multiple independent light manipulations, thus providing new routes for precise three-dimensional optogenetics. To validate the method, we performed multi-cell volumetric excitation of photoactivatable GCaMP in the central nervous system of drosophila larvae, a challenging structure with densely arrayed neurons, and photoconversion of the fluorescent protein Kaede in zebrafish larvae. © 2018 Optical Society of America under the terms of the OSA

Open Access Publishing Agreement

https://doi.org/10.1364/OPTICA.5.001478

## 1. INTRODUCTION

Optical wavefront shaping through computer-generated holography (CGH) [1] enables precise 2D and 3D light manipulation and has become a widely used approach in different fields of optics. In its original version, CGH used the “prism and lenses” [2] or a Gerchberg–Saxton algorithm (GSA) [3], and a spatial light modulator (SLM) to generate a distribution of diffraction-limited spots. This configuration was first adopted for multi-trap optical tweezers [1] and for the optical stimulation of neurons in both one-photon (1P) [4,5] and two-photon (2P) regimes [6,7].

CGH can analogously be used to generate extended illumination patterns that, for instance, can be tailored to excite the entire body of a cell [8]. This ability, especially when combined with 2P excitation (2PE), turned out to be of key importance in the field of optogenetics [9,10], in which suitable light-sensitive proteins are genetically expressed in a population of neurons. On one hand, 2PE increases the optical penetration depth, while on the other hand, illuminating the whole cell body ensures simultaneous excitation of a sufficient number of light-gated channels

on the targeted neuron [11–13]. As a downside, an increased spot size results in a loss of axial confinement, which may prevent the excitation of neurons with single-cell resolution. To overcome this limitation, 2P-CGH was combined with the temporal focusing (TF) technique [14–16], in which the beam dispersion from a diffraction grating temporally smears the pulse away from the focal plane, which remains the only region irradiated at sufficient peak powers to induce 2PE. By using TF, it is possible to maintain high optical sectioning for non-tightly focused beams, such as large holographic spots, low numerical aperture Gaussian beams (LNAG) or optical beams generated by the generalized phase contrast (GPC) method [17]. The use of TF in all these configurations successfully resulted in the efficient optogenetic stimulation of single [13,18,19] or multiple cells [20,21] with high spatial and temporal resolution, while helping at the same time to preserve the desired excitation pattern through scattering tissues [13,22,23].

The next logical step, which at the same time represents a great optical challenge, is to extend these methods to the simultaneous

<footnote n="1">¹Wavefront-Engineering Microscopy Group, Neurophotonics Laboratory, CNRS UMR8250, Paris Descartes University, 45 rue des Saints-Pères, Paris, France</footnote>

<footnote n="2">²Institut de la Vision, Sorbonne Université, Inserm S968, CNRS UMR7210, 17 Rue Moreau, 75011 Paris, France</footnote>

<footnote n="3">³Department of Molecular and Cell Biology, University of California, Berkeley, California 94720, USA</footnote>

<footnote n="4">⁴Institut du Cerveau et de la Moelle épinière (ICM), Sorbonne Université, Inserm, CNRS, AP-HP, Hôpital Pitié-Salpêtrière, Boulevard de l'hôpital, F-75013 Paris, France</footnote>

<footnote n="5">⁵Helen Wills Neuroscience Institute, University of California, Berkeley, California 94720, USA</footnote>

<footnote n="6">⁶Physical Bioscience Division, Lawrence Berkeley National Laboratory, Berkeley, California 94720, USA</footnote>

<footnote>*Corresponding author: valentina.emiliani@parisdescartes.fr</footnote>
illumination of several tens of targets in mm³ volumes with single-cell resolution. This could lead to the precise optogenetic control of large neural circuits in a time frame compatible with physiological transmission of brain signals (milliseconds).

A first solution for 3D multi-target illumination used CGH to generate multiple diffraction-limited spots at the positions of the targeted cells and scanned all of them simultaneously over the cell membranes using a galvanometric system [24–26]. Yet, the need of scanning over the cell body limited the achievable temporal resolution [>20 ms for single action potential (AP) generation] and precision (temporal jitter >6 ms) [24,27]. A better resolution (1–3 ms) could be obtained by increasing the illumination power [26], with the downside of risking higher nonlinear photo damage [28]. Additionally, using focused light at saturation power to compensate for the small spot surface generated important out-of-focus excitation [29–31].

Simultaneous illumination of multiple targets was achieved by generating extended holographic shapes in 3D [32]. However, as previously discussed, CGH alone is not sufficient to ensure single-cell axial resolution, especially when targeting multiple spatially close cells at the same time [33,34]. On the other hand, the combination of 3D-CGH with TF is much more challenging than its 2D counterpart, as TF requires the holographic patterns to be focused at the diffraction grating. We recently overcame this issue by using two SLMs, the second one placed after the TF grating [33], and by tiling the SLMs to encode multiple holograms, which independently controlled the lateral shape and position (SLM1) and the axial position (SLM2) of each pattern. This strategy enabled the remote axial displacement of a temporally focused shape, as well as projecting different temporally focused patterns at axially distinct planes. Yet, the need of tiling the SLMs physically limited the number of planes that could be addressed. Moreover, this approach was hardly compatible with other beam-shaping techniques such as GPC or LNAG beams; it required a complicated alignment between the two SLMs and several calibration procedures before using the system.

3D multiplexing of GPC or LNAG beams was recently demonstrated by combining a GPC scheme or a LNAG beam with a SLM generating multiple diffraction-limited spots through CGH. With this configuration, it was possible to replicate 1P GPC patterns [35,36], or temporally focused 2P LNAG beams [37,38]. While in the former case, 1P excitation limited the achievable axial resolution, in the latter [37,38], the use of a single beam-shaping unit, i.e., the multiplexing SLM, restricted the method to the generation of a static and single-sized Gaussian spot. Additionally, all the mentioned works [35,37,38] suffered from a spatially reduced illumination of the multiplexing SLM, which could limit the performances of the system in terms of maximum usable power and quality of the holograms. The solution proposed by Pégard et al. [37] of introducing a spherical lens before the TF diffraction grating, increased the size of the illuminated area at the SLM by simply defocusing the beam, but created two different foci for every spot at the sample plane, a temporal focus and a line corresponding to the spatial focus, thus deteriorating the overall axial resolution. Of note, in a more recent version of the same system [39], the authors revised the optical design by using a rotating diffuser after the grating to remove the secondary focus effects. Yet, the axial resolution of the Gaussian beams in that case was ~20 µm [40]. The system by Sun et al. [38] instead, was optimized for the generation of small Gaussian

spots (size <10 µm) and therefore was not directly applicable to optogenetic activation, where one needs bigger excitation spots, of the size of a neuron soma.

In this work, we demonstrate a versatile configuration for multiplexed temporally focused light shaping (MTF-LS) that combines the advantages of past approaches and removes their limitations. The main concept behind it is, as proposed by [33,37,38], to decouple the light shaping into two independent steps: a first beam-shaping unit that generates and focuses the desired 2D shape(s) on the TF grating and a second step where a second SLM, placed after the grating, laterally and/or axially, multiplexes the 2D shape(s) in the sample volume. We demonstrate that this configuration can be used in combination with different light-shaping approaches such as CGH, GPC, or amplitude/phase modulation.

Precisely, we first show and characterize a MTF-CGH scheme, which demonstrates the potential of the system. We then extend the work of Ref. [35] to the use of TF, thereby demonstrating MTF-GPC. Subsequently, we present an amplitude/phase modulation approach that allows us to create excitation spots with uniform intensity distribution and different shapes independently multiplexed at the sample plane. We call this method MTF multi-shapes (MTF-MS). We finally validate the performances of MTF-LS by performing *in vivo* multi-cell volumetric excitation of photoactivatable GCaMP (sPA-GCaMP) [41] in fruit flies, and Kaede photoconversion [42] in zebrafish larvae. In both scenarios, we show the specific targeting of individual neurons selected out of dense arrays and distributed over multiple planes.

## 2. METHODS

### A. General Optical System

The optical system for multiplexed temporally focused light shaping, schematically represented in Fig. 1, consisted of three main parts: (1) the beam-shaping unit, which generated a 2D illumination pattern, described at the objective focal plane by the function $F(X, Y, Z)$; (2) the temporal focusing unit comprising the grating and the appropriate lenses, which temporally focused the 2D pattern at the objective focal plane; and (3) the multiplexing unit, constituted of a liquid-crystal SLM (SLM2), which created, using CGH, the desired 3D distribution of diffraction-limited spots $G(X, Y, Z)$ at the sample positions $X_i, Y_i$, and $Z_i$, thereby replicating the original 2D pattern $F(X, Y, Z)$ at such positions (Fig. 1).

For the beam-shaping unit, we demonstrated four different configurations: (1) CGH based on the use of a liquid-crystal SLM (SLM1) [Fig. 1(a)]; (2) CGH using a static holographic phase mask [Fig. 1(a), inset]; (3) GPC interferometry [Fig. 1(b)]; and (4) an amplitude/phase modulation scheme for simultaneous generation of multiple shapes, in which SLM1 both defined the 2D illumination patterns and shaped the illumination of SLM2 [Fig. 1(c)].

### B. Beam-Shaping Units

We briefly describe here all the configurations we used for the beam-shaping units. In all the experiments, the laser source was a femtosecond fiber laser (Fidelity 18 or Fidelity 10, Coherent), emitting at 1040 nm, delivering 140 fs pulses at a repetition rate of 80 MHz, with an average power of 18 W or 10 W.
<figure><img src="image_3.png" /></figure>

**Fig. 1.** Experimental setup and principle of MTF-LS. (a) In a first realization, the beam-shaping unit consisted of a dynamic CGH system, composed of a beam expander (BE) to match the active area of a SLM (SLM1), which performed the appropriate phase modulation for generating the desired 2D pattern. The 2D speckled illumination pattern was then focused on the grating (G) for TF through lens L1. The first diffraction order was collimated by lens L2 and directed to the second SLM (SLM2), which created the predefined 3D distribution of diffraction-limited spots at the sample positions, thereby replicating the 2D pattern generated by SLM1. Lenses L3 and L4 conjugated the SLM2 plane at the objective (OBJ) back focal plane and scaled the beam by fitting the long axis of the SLM at the objective back aperture. Close to SLM2 is shown the x-y illumination of SLM2. In the case of MTF-CGH, the full active area of SLM2 was illuminated. Inset: the second realization of the beam-shaping unit was obtained by replacing SLM1 with a static phase mask producing a circular 20-µm-diameter holographic spot. The telescope constituted by lenses L1PM and L2PM magnified the size of the static phase mask, to match the size of SLM2. (b) In a third realization, the beam shaper was a GPC interferometer. Binary phase modulation for a circular spot of 12-µm diameter was imposed on SLM1, and lens L1GPC focused the beam on the phase contrast filter (PCF), which introduced a λ/2 phase delay to the low-spatial-frequency components over the high-spatial frequencies. Finally, lens L2GPC recombined high- and low-spatial frequencies to form the interference pattern at the output plane of the GPC shaper, which coincided with the grating plane. In the case of MTF-GPC, the x-y light distribution on SLM2 resulted in a single focused line of dispersed colors, covering all the SLM active area in the x direction but greatly underfilling SLM2 in the y direction. (c) The fourth configuration, MTF-MS, was obtained from the MTF-GPC one by removing the PCF and using SLM1 to perform both amplitude shaping to create the desired shapes and phase shaping to optimize the illumination of SLM2. In the example, SLM1 is used to create two different shapes. A holographic prism effect is imposed on the desired shapes to separate them from the unwanted light in the x direction, such as to create two spots aligned in the y direction after L1GPC. A beam stop blocks the undesired non-diffracted light (zero order), leaving only the desired shapes at the grating. The two shapes result in two parallel lines at SLM2, which is addressed with two different multiplexing holograms. (a)-(c) bottom, schematic principle of MTF-LS showing the phases applied on both SLMs, the 2D shape(s) at the diffraction grating position, and the distribution of the targets at the sample position.

## 1. Dynamic CGH

In a first configuration [Fig. 1(a)], the laser beam was expanded (10 ×) to fit the active area of SLM1 (LCOS-SLM X10468-07, Hamamatsu Photonics, resolution 800 × 600 pixels, 20 µm pixel size), which modulated the phase of the incoming beam with CGH, by using a standard GSA to create the desired 2D intensity pattern. The first image of the pattern was formed through lens L1 ($f_1$ = 500 mm) on a blazed reflective diffraction grating (1200 l/mm, 53004ZD02-035R, Richardson Gratings; G) for TF. The grating was aligned such that the first diffraction-order was diffracted along the optical axis of the microscope, perpendicular to the grating plane. The beam was subsequently

collimated by lens L2 ($f_2$ = 500 mm) and impinged on SLM2 (LCOS-SLM, X13138-07, Hamamatsu Photonics, 1280 × 1024 pixels, 12.5 µm pixel size). A beam stop physically blocked the SLM's zero order, i.e., light not modulated by SLM1.

## 2. CGH with a Static Phase Mask

In a second experiment, we replaced SLM1 with a static phase mask [Fig. 1(a), inset] fabricated by etching of fused silica (Double Helix Optics, LLC) on the base of an eight-gray-level phase profile calculated with the GSA to produce a 20-µm-diameter circular holographic spot. The laser beam was expanded (5 ×) to fit the 5 mm × 5 mm of the encoded area of the mask.
A subsequent 2:1 telescope ($f_1^{PM} = 200$ mm, $f_2^{PM} = 400$ mm) was then used to magnify the mask approximately to the size of SLM2.

### 3. GPC

In a third approach, we changed the beam-shaping unit to a GPC interferometer [Fig. 1(b)]. Similar to the setup previously described [20,23], the 10x expanded laser beam illuminated SLM1 on which we applied the desired binary phase profile. A first achromatic lens ($L1^{GPC}$, $f_1^{GPC} = 300$ mm) focused the reflected beam from the SLM on the phase contrast filter (PCF) of a diameter ranging from 80 µm to 100 µm. The PCF phase shifted by ~λ/2 the low-spatial-frequency components [43]. A second achromatic lens ($L2^{GPC}$, $f_2^{GPC} = 60$ mm) recombined the high- (signal wave) and low- (synthetic reference wave) spatial frequency components [44], thereby converting the SLM1 phase profile into a 2D illumination pattern at the diffraction grating. Importantly, in contrast to the two holographic cases described above, and as Fig. 1(b) illustrates, in this configuration, the lens after the diffraction grating (L2) focused the beam at SLM2 in the direction perpendicular to TF (y direction, vertical to the optical table). The dispersion in the TF direction resulted in a focused line (approximately 16 mm in x and 1.5 mm in y) of different colors at SLM2.

### 4. Amplitude/Phase Modulation for Multi Shapes

The last configuration was obtained from the previous one by removing the PCF [Fig. 1(c)]. The plane of SLM1 was therefore conjugated to the diffraction grating and coincided with the Fourier plane of SLM2. In this configuration, SLM1 was used at the same time to perform (1) an amplitude shaping of the beam, which produced the desired 2D pattern(s) at the grating (and hence at the sample), and (2) a phase shaping to optimize the illumination of SLM2.

More precisely, we defined multiple, identical, or different 2D shapes on SLM1, such that they would transform, after all the lenses and the objective, in the desired shape(s) at the sample position. As Fig. 1(c) shows, the inner parts of such shapes were patterned with precise holographic “prism” phase profiles, encoding displacements in the x-y directions. As a result, we obtained multiple diffraction-limited spots after $L1^{MS}$ ($f = 300$ mm) aligned in the y direction and all displaced by the same quantity in the x direction from the center of the optical axis. Light falling out of the patterned regions on SLM1 propagated unaltered, therefore focusing into a central diffraction-limited spot after $L1^{MS}$. Using a beam stop to block this part of the beam left only the desired shapes at the position of the diffraction grating, after collimation by $L2^{MS}$ ($f = 60$ mm). The introduced displacement in the x direction allowed us to better separate the desired spots from the unshaped light.

The multiple diffraction-limited spots transformed, after the dispersion of the diffraction grating, into multiple parallel horizontal lines at SLM2. In this way, each line, which we could finely displace using CGH to hit the desired area on SLM2, encoded a different shape and could be independently multiplexed by dividing SLM2 in different regions.

### C. Multiplexing Unit

#### 1. Phase Shaping in the Space Domain

In all the described configurations, SLM2 was in the Fourier plane of the diffraction grating and was conjugated to the back

focal plane of the excitation microscope objective via lenses L3, $f_3 = 1000$ mm, and L4, $f_4 = 500$ mm. The phase modulation applied on SLM2 produced a set of 3D diffraction-limited spots, which multiplexed the 2D pattern(s) created on the grating by the beam-shaping unit. For precise axial displacement, the phase profile applied on SLM2 was calculated with a weighted GSA [45], modified to include the non-parabolic terms in the description of the microscope objective [4]. For SLM2, we blocked the SLM's zero order using a beam stop. This created a small (~20 µm) inacessible region in the central part of the field of excitation (FOE). To make use of the entire FOE, other solutions for suppressing the excitation effect of the zero order could be considered, e.g., adding one or a pair of cylindrical lenses in front of the SLMs [46], or adding a destructively interfering spot to the phase hologram design [47,48].

In the MTF-MS approach, SLM2 was tiled vertically into different holograms, as illustrated in Fig. 1(c), one for each shape defined by SLM1, and independently multiplexed them at the sample position.

A custom-designed software, Wavefront-Designer IV [8], written in C++ and using the open graphic library Qt 4.8.7, controlled both SLMs for the dynamic CGH configuration, using Gerchberg-Saxton-based algorithms. The software also included the phase corrections for the first-order Zernike aberrations. Aberration correction was always carried out by changing the Zernike coefficients with both SLMs in order to maximize the 2P signal for a diffraction-limited spot at the center of the FOE. Notably, this procedure cancelled aberrations at the focal plane and close to the center of the FOE; however, spots projected away from that suffered from different amounts of aberrations, which usually contributed to a worsening of the axial resolution observed.

For useful alignment hints regarding all the approaches, the reader is invited to look at the Supplementary Note in Supplement 1.

#### D. Two-Photon Excitation of Rhodamine Layers

After the two-step phase manipulation, the beam was focused by a microscope objective at the sample position. The excitation microscope objective was an Olympus LUMPLFL 40XW/IR2, NA 0.8 for all the experiments except for those involving the static phase mask, which was designed to make a 20-µm spot at the sample position when using the objective Olympus LUMPLFL 60XW/IR2, NA 0.9. For characterizing the performances of the system, 2PE fluorescence from a thin (~1 µm) spin-coated fluorescent layer of rhodamine-6G in polymethyl methacrylate 2% w/v in chloroform was collected by a second microscope objective (Olympus XLUMPlanFL N 20XW, NA 1) in transmission geometry and detected with a CCD camera (CoolSNAP HQ2, Photometrics), using a dichroic mirror and a short-pass filter for rejecting laser light (Chroma Technology 640DCSPXR; Semrock, Brightline Multiphoton Filter 750/SP). For 3D reconstruction of illumination volumes, the “imaging” objective imaged the rhodamine-layer plane throughout all the experiment, while the excitation objective was scanned over the desired z range with a piezoelectric scanner (PI N-725.2A PIFOC) in steps of 1 µm.

We performed the analysis of the recorded stacks with MATLAB, ImageJ, and the Imaris software (Bitplane, Oxford Instruments). The 2PE fluorescence values for each spot were
obtained by integrating the intensity of all the pixels in a circular area containing the spot, in the plane where the intensity was at its maximum value (i.e., the TF plane). Axial intensity distributions were obtained by integrating the intensity of the pixels in the same area for each plane of the recorded stack, in a range of ±20 µm around the focal plane of each spot. Reported values for the axial confinement were the fit of the axial profile of the spots with a Lorentzian model and referred to the FWHM of the curves. Statistical data in axial resolution measurements were reported as mean±standard deviation.

## E. Optical System Used in Biological Experiments

The biological experiments were performed in a microscope using MTF-CGH with two SLMs for photostimulation and a commercial 2P-scanning system with galvanometric mirrors (VIVO, 2-PHOTON, 3i-Intelligent Imaging Innovations). The setup was built around a commercial upright microscope (Zeiss, Axio Examiner.Z1). The laser used in this case was a Ti:Sapphire oscillator (pulse width ~100 fs, repetition rate 80 MHz, tuning range 690–1040 nm, Mai Tai DeepSee, Spectra-Physics). The photostimulation path consisted of a lens system ($f_{BE1} = 19$ mm and $f_{BE2} = 150$ mm) that expanded the laser beam (~8 ×) before SLM1 (LCOS-SLM X10468-07, Hamamatsu Photonics, resolution 800 × 600 pixels, 20 µm pixel size). The intermediate holographic images were then focused by a $f_1 = 500$ mm lens on the diffraction grating (830 lines/mm, Item No. 55262, Edmund Optics), followed by a second lens, $f_2 = 500$ mm, the SLM2 (LCOS-SLM X13138-07, Hamamatsu Photonics, 1280 × 1024 pixels, 12.5 µm pixel size) a 4-f telescope ($f_4 = f_5 = 500$ mm), and the last telescope before the objective with $f_6 = 300$ mm, $f_7 = 250$ mm. The objective used for the experiments was a water immersion Olympus LUMPLFL 40XW/IR2, NA 0.8.

The holographic path was then coupled with the commercial 2P-scanning module, made of 2P galvo-scanner and a detection based on two spectrally resolved GaAsP photomultipliers. Acquisition was controlled by SlideBook6 software (3i). The two illumination paths were recombined on a polarizer cube and shared the $f_7$ lens before entering the microscope. The switch between the optical path for scanning imaging and holographic illumination was performed with a movable mirror driven by a servomotor. The power and pulses were controlled by a Pockels cell (350-80, Conoptics).

## F. Kaede Photoconversion

### 1. Zebrafish Housing and Handling

All procedures were approved by the Institut du Cerveau et de la Moelle épinière (ICM) and the National Ethics Committee (Comité National de Réflexion Ethique sur l'Expérimentation Animale Ce5/2011/056) based on E.U. legislation. Embryos were raised in an incubator at 28.5°C under a 14/10 light/dark cycle until the start of experimentation. Experiments were performed at room temperature (23°C–26°C) on 2–6 days post fertilization (dpf) larvae. All experiments were performed on Danio rerio embryos of AB and Tupfel long fin (TL) lines background, and mitfa -/- animals were used to remove pigments above the hindbrain. For photoconversion experiments, we used double transgenic *Tg(HuC:gal4; UAS:kaede)* larvae where the HuC promoter drives pan-neuronal expression of Kaede at the larval stage. Embryos were dechorionated and screened for green fluorescence at

1 dpf. Larvae screened for Kaede fluorescence were later embedded laterally in 1.5% agarose. Larvae were anesthetized in 0.02% tricaine (MS-222, Sigma-Aldrich, USA).

### 2. Photoconversion and Imaging

A first 2P z-stack of green fluorescence was recorded with the scanning laser at 920 nm to map the location of neurons. We then selected a subset of neurons for photoconversion using MTF-CGH (wavelength 800 nm). The relative intensity between the spots was adjusted in order to compensate for both diffraction efficiency and tissue scattering [33,45,49]. To minimize thermal damage during photoconversion, we delivered trains of 10-ms pulses at 50 Hz with total laser power around 130 mW (average illumination density of ~0.4 mW/µm²), for periods of time that ranged from few tens of seconds to 4 min. After photoconversion, we acquired a second z-stack in the green and red channels with the scanning laser tuned to 780 nm to efficiently excite red-photoconverted fluorescence. The increase in red fluorescence in target cells was estimated by comparing their red emission after photoconversion with the average red emission from five non-targeted coplanar neighboring cells that were randomly selected.

## G. sPA-GCaMP Photoactivation

### 1. Drosophila Preparation

We used female wandering third instar drosophila larvae, expressing sPA-GCaMP6f and mCherry-nls in all motor neurons under the control of OK6-Gal4 [50] with the genotype *w*¹¹¹⁸; OK6-Gal4/UAS-mCherry-nls;UAS-sPA-GCaMP6f/UAS-sPA-GCaMP6f. Larvae were dissected in HL3 saline containing, in mM: 70 NaCl, 5 KCl, 0.45CaCl₂·2H₂O, 20MgCl₂·6H₂O, 10NaHCO₃, 5 trehalose, 115 sucrose, 5 HEPES (pH adjusted to 7.2). The central nervous system (CNS) and peripheral motor neurons were exposed by making a longitudinal dorsal incision, removing all organs, and pinning the cuticle flat.

### 2. Photoactivation and Imaging

The initial reference ventral nerve cord 2P stack was performed at 920 nm, to record nuclear mCherry fluorescence. Photoactivation was performed with a 760-nm pattern. We used trains of 100-ms pulses at 5 Hz with total laser power around 130 mW (corresponding to an average illumination density of ~1 mW/µm²) and for periods of time that ranged from 1 up to 4 mins. After activation, a 2P z-stack with the scanning laser at 920 nm was acquired to reconstruct both mCherry and activated sPA-GCaMP6f fluorescence. As a reference for total motor neuron density and sPA-GCaMP6f expression, large field 1P photoactivation was achieved separately (Zeiss LSM780 confocal microscope) by scanning the whole ventral nerve cord with a 405-nm diffraction-limited spot and imaging with 488 nm and 561 nm excitation.

## 3. RESULTS

### A. Multiplexed Temporally Focused Computer-Generated Holography

We first tested the capabilities of our system by creating 50 replicas of a circular 15-µm-diameter shape using a conventional scheme for CGH based on a liquid-crystal SLM [SLM1; Fig. 1(a)]. The 50 spots were visualized by measuring the 2PE fluorescence from a thin (sub-µm) rhodamine layer in a two-photon microscope
<figure><img src="image_4.png" /><figcaption>**Fig. 2.** MTF-CGH with two SLMs. (a) 2PE fluorescence volume representation of 50 holographic circular spots of 15-µm diameter, each of them lying on a different plane, in a volume of 300 µm × 300 µm × 500 µm. Average laser power at the sample position = 450 mW. (b) *x* − *y*, *x* − *z*, and *y* − *z* projections of three spots, located at *z* = −250 µm, 0 µm, 240 µm from the focal plane. Scale bar, 15 µm. (c) Histogram of the maximal 2PE fluorescence intensity for each spot, normalized to the average intensity of all spots, after diffraction efficiency correction. The results represent an average for each plane from four different realizations of 50-spots light configuration. (d) Axial confinement, calculated as the FWHM of the axial intensity profile of each spot, as a function of the *z* position. Red stars represent the individual measurements for each spot (average on four different realizations of 50 spots), and blue bars show the mean values in a range of 50 µm around the designated *z* position. The mean value across the whole FOE was 11.1 ± 1.8 µm FWHM.</figcaption></figure>

equipped with a 40 ×, 0.8 NA objective [Fig. 2(a) and Visualization 1]. Figure 2(b) shows three replicas of the excitation spot at three different axial planes (–250 µm, 0 µm, and 240 µm from the focal plane). One can notice the speckled intensity profile, typical of holographic spots [16], as well as the similarity of the speckle distribution for spots lying on different planes, confirming that each spot was indeed a replica of the original 2D shape. As previously described [33,45,49], by calculating the phase that we sent to SLM2 with a weighted GSA, we could compensate for diffraction efficiency-induced intensity variations. In this way, the 2PE fluorescence from the 50 spots varied less than 40% around the mean value, corresponding to less than 25% variation in the illumination intensity [Fig. 2(c)].

In Fig. 2(d), we plot the FWHM of the axial intensity distribution for the 50 spots, which was found to vary between 8 µm and 16 µm, with a mean value across the whole investigated FOE (300 µm × 300 µm × 500 µm) of 11.1 ± 1.8 µm and only a few spots, at the very edge of the FOE in *z* direction, reaching a FWHM > 15 µm. As shown in detail in Figs. S1-S3 in Supplement 1, the FWHM was as small as 7 µm at the center of the FOE (expected simulated value 7.3 µm) and increased both in the *x*–*y* plane (~0.4% and 0.5% per µm for *x* and *y* directions, respectively) and in *z* direction (~0.4% per µm) as we moved away from the center of the FOE. Two main effects could cause such axial resolution broadening. First, large axial shifts required beams highly converging or diverging at the back aperture of the objective, whereas large lateral shifts corresponded to strongly tilted beams after SLM2. Therefore, in both cases, the

optical elements that the beam propagated through after SLM2 introduced strong aberrations [51] and a possible cropping of the beam with consequent loss of spectral frequencies. A second possible contribution to the axial broadening may come from spatiotemporal coupling effects related to the spatial separation of the spectral frequencies at the position of SLM2 (Figs. S1-S3 in Supplement 1). This latter effect could also induce the few-micrometer axial shift of the spatiotemporal focal plane when shifting the illumination spots in the direction of TF (Fig. S2 in Supplement 1) not observed in the non-TF direction (Fig. S3 in Supplement 1).

Overall, these results demonstrate that our method can produce multiple spatiotemporally focused spots with a <15 µm axial resolution and uniform (within 40% from the average) light distribution across at least 300 µm × 300 µm × 500 µm. For comparison, we show in Fig. S4 in Supplement 1 the same spot distribution without TF, revealing a three times larger axial FWHM, i.e., worse axial resolution.

## B. MTF-CGH with a Static Phase Mask

Next, we replaced SLM1 with a static custom-made eight-gray-level phase mask, which was fabricated to create a 20-µm-diameter circular holographic spot [See Methods, Fig. 3(a)] when coupled to a 60 × objective (NA = 0.9). Figure 3(b) shows the 3D reconstruction of the 2PE fluorescence generated by 21 excitation spots arranged in a FOE of 130 µm × 130 µm × 400 µm. Figure 3(c) illustrates the details of three replicas for three different *z* planes (–200 µm, 0 µm, 200 µm), demonstrating the
<figure><img src="image_5.png" /><figcaption>**Fig. 3.** MTF-CGH with a static phase mask. (a) Left, picture of the holographic static phase mask mounted on a 1-inch circular holder. Right, eight-level computer-generated hologram used to fabricate the static phase mask. (b) 2PE fluorescence volume representation of 20 holographic circular spots of 20-µm diameter, each of them lying on a different plane, in a volume of 130 µm × 130 µm × 400 µm. Average laser power at the sample position = 200 mW. (c) x-y, x-z, and y-z projections of three spots, located at z = -200 µm, 0 µm, 200 µm from the focal plane. Scale bar, 20 µm. (d) Axial confinement, calculated as the FWHM of the axial intensity profile of each spot, as a function of the z position. The mean value across the whole FOE was 11.0 ± 4.0 µm FWHM.</figcaption></figure>

preservation of the spot quality in a z range of 400 µm. Figure 3(d) shows the dependence of the axial confinement for 21 spots in z direction. The mean axial resolution was 11.0 ± 4.0 µm, reaching a minimum value of ~5 µm at the center of the FOE (expected simulated value 5.3 µm). Using a larger NA and higher magnification objective improved the axial resolution at the center of the FOE but also induced a stronger dependence on the axial position (with the 40 × objective, the FWHM increased by ~0.4% per µm; with the 60 × objective, it increased by ~1% per µm), since in this case, one needs a more divergent beam at the back aperture to obtain the same axial shift, resulting in larger aberrations.

Overall, Fig. 3 demonstrates that the generation of multiple temporally focused spots can be achieved by replacing a dynamic SLM with a fixed phase. This limits the generation of patterns to pre-defined 2D shapes but enables to considerably reduce complexity and cost of the optical system.

### C. Multiplexed Temporally Focused Generalized Phase Contrast

In a third approach, we changed the beam-shaping unit to a GPC interferometer [Fig. 1(b), inset], whose image plane coincided with the grating for TF [20,23]. As Fig. 4 demonstrates, by coupling such a system with the holographic multiplexing of SLM2, we generated 20 MTF-GPC patterns on a FOE of 200 µm × 200 µm × 200 µm. Figure 4(b) shows the excitation spots at three different planes (–95, 0 and 100 µm) from which one can clearly recognize the uniform speckle-free intensity distribution typical of GPC. In agreement with previous findings [20], the flat optical wavefront of GPC enabled achieving a higher axial resolution (6.0 ± 1.5 µm FWHM, ~5 µm at the center of the

<figure><img src="image_6.png" /><figcaption>**Fig. 4.** MTF-GPC. (a) 2PE fluorescence volume representation of 20 GPC circular spots of 12-µm diameter, each of them lying on a different plane, in a volume of 200 µm × 200 µm × 200 µm. Average laser power at the sample position = 150 mW. (b) x-y, x-z, and y-z projections of three spots, located at z = -95 µm, 0 µm, 100 µm from the focal plane. Scale bar, 12 µm. (c) Axial confinement, calculated as the FWHM of the axial intensity profile of each spot, as a function of the z position. The mean value across the whole FOE was 6.0 ± 1.5 µm FWHM.</figcaption></figure>

FOE, expected simulated value 5.0 µm) [Fig. 4(c)] than the one achievable with CGH using the same objective [Fig. 2(c)].

It has to be noted that in this configuration, as the scheme in Fig. 1(b) illustrates, the dispersed beam after the diffraction grating was focused on SLM2, resulting in the illumination of only a small portion of it in the direction perpendicular to TF (y direction, vertical in the optical table). In the TF direction instead, dispersion of spectral frequencies enabled illumination of the full SLM2 chip. With the optical components used in our case, a spot size of 12-µm diameter at the sample plane determined a vertical beam size at SLM2 of ~1.5 mm. This imposed a limit to the total laser power that could be used for avoiding damage of the SLM. In the described experiment, we limited the average laser power on SLM2 to ~0.2 W, which, in turn, limited the total number of spots that we could project. However, Fig. 4 also interestingly demonstrates that, even when illuminating only a small portion of SLM2, the phase modulation that the laser beam underwent was sufficient to create several replicas of the original shape. The next method that we present is based on this property.

### D. Multiplexed Temporally Focused Multi Shapes

As a last configuration, we tested MTF-MS, which combined the advantages of previously described configurations, such as the uniform illumination (typical of GPC or LNAG), the multi-scale capability (as in MTF-GPC and MTF-CGH), and the possibility to independently generate different shapes simultaneously, as in Ref. [33]. The idea behind MTF-MS is based on the results we obtained in the MTF-GPC experiments (Fig. 4) and particularly on the experimental evidence that illuminating SLM2 with a single line is sufficient for generating at least ~20 excitation spots. We therefore exploited this property to create multiple lines at SLM2, each of them aligned with an independent 3D hologram.

In Fig. 5, we present the results obtained when making four different shapes (round, square, star, hexagon) with SLM1 and multiplexing them separately with SLM2 to make 40 spots at the sample plane (10 for each shape). Figure 5(a) shows the phase applied on SLM1. Similar to the example in Fig. 1(c), the four shapes were encoded with a holographic prism phase to displace them laterally at the same x but different y positions. This resulted
<figure><img src="image_7.png" /><figcaption>**Fig. 5.** MTF-MS. (a) Phase applied on SLM1 made up of four different shapes encoded with different prism holographic phases. The unshaped light was blocked using a beam stop. The shapes are elongated on SLM1 to compensate for the tilted illumination of the diffraction grating. After the diffraction grating, the four shapes converted into four parallel lines at SLM2, which independently multiplexed them. (b) and (c) Top and side views of a 2PE fluorescence image of 40 spots, 10 for each shape, in a volume of 300 µm × 300 µm × 400 µm. Average laser power at the sample position = 400 mW. (d) x - y, x - z, and y - z projections of the four different shapes at different planes. Scale bar = 15 µm. (e) Axial confinement, calculated as the FWHM of the axial intensity profile of each spot, as a function of the z position. The mean value across the whole FOE was 9.5 ± 1.5 µm FWHM. Red stars represent the FWHM measurements at each z position (average on four different realizations of 40 spots), and blue bars show the mean values in a range of 50 µm around the designated z position.</figcaption></figure>

in four vertically aligned diffraction-limited spots after lens L1MS,
plus a single spot displaced in the x direction corresponding to the
unshaped light, blocked with the beam stop. This procedure re-
sulted in a power loss of a factor of ~3 after the beam stop.

Figures 5(b) and 5(c) show the 40 spots from top and side views, respectively. From the former image, one can distinguish the different shapes, whereas the latter one illustrates the good axial resolution and homogeneity across the full FOE. In Fig. 5(d), one can more closely see the four different shapes as they appeared at the sample plane. The quality of the spots was comparable to that obtained for MTF-GPC. Finally, in Fig. 5(e), we plot the FWHM of the axial intensity distribution for the 40 spots, which was found to vary between 6 µm and 13 µm, with a mean value across the whole investigated FOE (≈300 µm × 300 µm × 400 µm) of 9.5 ± 1.5 µm (expected simulated value at the center of the FOE 5.0 µm).

These results confirm that MTF-MS removed some of the lim-
itations inherent to other methods. In particular, by making
several lines at SLM2 we could illuminate a much wider area com-
pared to the case of MTF-GPC, use higher power, and generate a
larger amount of spots at the sample plane. At the same time, as
SLM2 was divided into several 3D multiplexing holograms,
MTF-MS was not limited in the achievable number of different
planes, as in the case of [33].

E. In Vivo High-Resolution Multi-Cell Targeting

We finally applied our reference technique for the 3D generation
of multiple temporally focused spots, namely, MTF-CGH, to two
different biological paradigms: the 2P-photoconversion of Kaede
protein [52] in zebrafish larvae (Figs. 6 and S5 in Supplement 1)
and the 2P photoactivation of superfolder GCaMP (PA-GCaMP)
in drosophila larvae [41] (Fig. 7).

1. Kaede Photoconversion in the Hindbrain of Zebrafish Larvae

We prepared samples of zebrafish larvae expressing the Kaede pro-
tein in a very dense population of neurons of the hindbrain using
*Tg(HuC:gal4;UAS:Kaede)* transgenic larvae [Fig. 6(a)]. Kaede is a

<figure><img src="image_8.png" /><figcaption>**Fig. 6.** Simultaneous photoconversion of Kaede-expressing neurons in zebrafish. (a) Superposed brightfield and widefield fluorescence images of the head of a double transgenic *Tg(HuC:gal4; UAS:kaede)* zebrafish larva. The dashed square represents the approximate area where we performed photoconversion. Scale bar, 100 µm. (b) 3D view of a 2P stack (*λ*<sub>imaging</sub> = 780 nm) merging green and red fluorescence after targeted simultaneous 2P photoconversion (*λ*<sub>conversion</sub> = 800 nm) of a set of 11 neurons. Represented volume: 178 µm × 178 µm × 251 µm. The inset represents the 3D MTF-CGH illumination pattern composed of multiple 6-µm-diameter spots used for photoconversion. (c) Top and side single frame views extracted from the 2P stack reported in (b), zooming on three representative photoconverted cells [labeled 1–3 in panel (b)]. Scale bar: 20 µm. (d) Normalized axial intensity profiles of green and red fluorescence integrated over *z* for the three cells reported in (c).</figcaption></figure>
<figure><img src="image_9.png" /><figcaption>**Fig. 7.** Photoactivation of sPA-GCaMP in drosophila larvae. (a) Schematic representation of a dissected drosophila larva. The dissection exposes the ventral cord (red rectangle) in which motor neurons co-express nuclear mCherry (red dots) and photoactivable sPA-GCaMP6f. (b) Max projection of a z-stack of green (sPA-GCaMP6f) and red (mCherry) fluorescence performed after wide 1P (405 nm) photoactivation of motorneurons of the ventral central cord (see Methods). Image acquired on a confocal microscope. Scale bar, 30 µm. (c) 3D view of a 2P stack ($\lambda_{imaging} = 920$ nm) merging green and red fluorescence after 2P ($\lambda_{activation} = 760$ nm) targeted simultaneous photoactivation of a set of six motor neurons (labeled with numbers). Represented volume: $178 \mu m \times 178 \mu m \times 140 \mu m$. The inset represents the 3D MTF-CGH illumination pattern composed of multiple 5-µm-diameter spots used for photoactivation. (d) Top (up) and side (down) max projection of green and red fluorescent after photoconversion, corresponding to panel (c). Numbers label targeted photoactivated neurons. Scale bar, 30 µm.</figcaption></figure>

photoconvertible protein that emits initially green fluorescence and red shifts its emission under UV [52] or near-infrared 2P illumination [53]. We first acquired a 2P scanning z-stack of the green fluorescence from a ~200 µm x 200 µm x 300 µm volume in the larva hindbrain [Fig. 6(b)], from which we selected 11 individual neurons, distributed at 11 different depths, for photoconversion. We then precisely tailored the 3D patterned illumination to simultaneously photoconvert these neurons using 2P excitation ($\lambda = 800$ nm). For this experiment, SLM1 generated a circular spot of 6 µm in diameter to excite individual neurons, while SLM2 multiplied such a shape, temporally focused by the diffraction grating, at 11 distinct positions. SLM2 was also used to adjust the relative intensity of each spot to compensate for both diffraction efficiency and losses due to scattering through different depths of the tissue (see Methods).

Finally, we acquired a second 2P scanning z-stack to measure both the green and red fluorescence. Photoconversion increased the red fluorescence in the target cells by more than a factor of 15 (19 ± 10 fold; *n* = 11 targeted cells) with respect to neighboring cells [Figs. 6(b)–6(d)]. Top and lateral views from three photoconverted cells are reported in Fig. 6(c) (more cells are shown in S5 in Supplement 1). The corresponding normalized fluorescence axial profiles [Fig. 6(d)] show red fluorescence induced solely in the targeted neurons. This confirms the precise targeting and single-cell resolution (FWHM of red fluorescence axial

profiles = 7.7 ± 3.3; *n* = 11 cells) of the patterned illumination, down to ~200 µm deep in the brain tissue with minimal photoconversion induced in neighboring cells, despite the highly packed neuron distribution.

## 2. Targeted Simultaneous 3D Photoactivation of sPA-GCaMP6f in Drosophila Larvae

We subsequently tested the potential of our system in the central nervous system of drosophila larvae, whose cells expressed a recently developed photoactivable genetically encoded calcium indicator, sPA-GCaMP6f. Such an indicator switches from an original dark state to a bright state via UV or 2P infrared illumination [41].

Larvae were dissected to expose the ventral nerve cord where sPA-GCaMP6f was expressed in all motor neurons (OK6-Gal4). These neurons co-expressed a nuclear mCherry [Figs. 7(a) and 7(b)]. A 2P image of the mCherry fluorescence allowed us to reconstruct the 3D distribution of the sPA-GCaMP6f expressing motorneurons [Fig. 7(a)].

We then selected for 2P photoactivation at 760 nm with our MTF-CGH system a subset of six individual motorneurons, belonging to a stereotyped group that all projected to a common hemisegment in the larval body [Fig. 7(c)].

We generated six different 5-µm holographic spots aimed at the cell nuclei. Subsequent imaging of the green fluorescence from sPA-GCaMP6f monitored the photoactivation of sPA-GCaMP6f molecules. As Figs. 7(c) and 7(d) show, green fluorescence increased >15 times only in the targeted neurons. Photoactivation of untargeted neighboring cells was minimal, despite the very dense distribution of sPA-GCaMP6f expressing neurons and the even denser neuropil containing the processes of the expressing neurons [see Fig. 7(b), where photoactivation was done by wide-field 1P illumination]. Within minutes after soma photoactivation, neuronal processes of the targeted cells could be clearly distinguished from background [Figs. 7(c) and 7(d)], making it possible to track neuronal morphology precisely.

## 4. DISCUSSION

We have demonstrated a versatile optical system enabling the generation of multiple temporally focused patterns in 3D in a large volume. The system is based on two independent beam-shaping steps: the first one defines the lateral shape of the illumination spot(s) and projects it on the TF grating; the second performs a lateral and axial multiplexing of the original shape(s) in the sample volume.

Placing a single SLM after the TF grating for performing both shape definition and 3D pattern projection would cancel the TF effect for the shaped patterns. This can be intuitively thought of in these terms: what is temporally focused is what is projected at the diffraction grating plane. If a SLM changes the shape after the grating by using CGH, each spectral frequency will see a slightly different spatial phase, which will result in different speckle patterns at the sample plane, thereby losing the effect of TF.

In the present configuration, the total number of excitation spots, as well as the size of the achievable FOE at the target volume and the number of achievable planes are mostly dependent on the performances of SLM2 (total number of illuminated pixels, pixel size, number of gray levels). This feature represents a strong advantage of our system, as it makes it compatible with several different beam-shaping approaches such as dynamic
CGH, CGH with a static phase mask, GPC interferometry, and amplitude/phase shaping approaches, each of them with advantages and limitations (all summarized in Table 1). This is in contrast to the previous approach [33], in which, because the lateral and axial displacement of the 3D spots was performed by different SLMs, the performances of the system were determined by the properties of both SLMs, imposing the use of highly performing devices. In MTF-LS instead, the first beam-shaping unit should be only good enough to project one (or only a few) pattern(s) at the center of the FOE. This, as we showed, can also be done with a cost-effective static phase mask encoding a specific pattern.

Among the approaches that we tested, dynamic CGH, which uses a reconfigurable liquid crystal SLM, allows for high flexibility and quick lateral shaping capability. Replacing the bulky SLM with a smaller static phase mask reduces the flexibility of the system but leads to a simpler, more compact and cost-effective optical design. A phase mask made on a single substrate with different holograms imprinted on it could offer the flexibility to choose among different spot sizes and shapes and hence to cover more applications.

Similar to dynamic CGH, GPC is capable of quickly adjusting the spot size and shape. Moreover, it generates illumination patterns with superior axial resolution and higher uniformity (speckle-free). In the past, the main limitations of GPC were the reduced FOE imposed by the constraint of keeping the ratio of the illuminated over the non-illuminated area in the FOE to 0.25 [20], as well as the lack of 3D light-shaping capability. As previously shown in Refs. [35,36], using SLM2 for axial and lateral multiplexing removes both these constraints. Our MTF-GPC approach generalizes the scheme of [35] to the use of TF, making the approach highly suitable for in-depth studies. Yet, the <2 mm vertical size of the beam at SLM2 limits the power that can be used and therefore the maximum number of achievable targets.

To overcome this limitation, we have demonstrated a new configuration (MTF-MS) where SLM1 is used both as an amplitude shaper to define multiple spots even of different shapes, and as a phase shaper to optimize the illumination of SLM2. This scheme has two major advantages: (1) it generates uniform (speckle-free) illumination patterns, as with MTF-GPC, but, because of the improved illumination of SLM2, it allows one to use more power and therefore to create more spots than the GPC counterpart. (2) Similarly to [33], it can be used to generate multiple shapes at the same time, but with no limitation in the maximum number of achievable planes, or degradation in the spot quality for a large number of planes, which constituted the main issues of the approach of [33].

The main disadvantage of MTF-MS is the unavoidable power loss, which is inherent in amplitude shapers. As the undesired part of the light impinging on SLM1 is physically blocked [see Fig. 1(c)], this method leads to a total power loss ~2 times higher than for the other methods, as summarized in Table 1. Replacing SLM1 with a GPC interferometer to create the desired shapes, followed by a static holographic phase mask encoding different displacements in y direction to optimize the illumination of SLM2 could completely solve this problem. As for the configuration in Ref. [33], MTF-MS is ultimately limited in the number or zones that SLM2 can be divided into. Here we demonstrated the generation of four different shapes, which led to the ~50% of illumination of SLM2 (see Table 1). Therefore, with the current

<table><caption>Table 1. Comparison of the Four Different MTF-LS Methods Presented in this Studyª</caption><thead><tr><th>TECHNIQUES<br>CRITERIA</th><th>MTF - CGH</th><th>MTF - CGH<br>Phase Mask</th><th>MTF - GPC</th><th>MTF - MS</th></tr></thead><tbody><tr><td>Complexity of the System</td><td></td><td></td><td></td><td></td></tr><tr><td>Number of SLMs</td><td>2</td><td>1</td><td>2</td><td>2</td></tr><tr><td>Phase Mask</td><td>0</td><td>1</td><td>1</td><td>0</td></tr><tr><td>Alignment</td><td>●</td><td>●</td><td>●</td><td>●</td></tr><tr><td>Flexibility</td><td></td><td></td><td></td><td></td></tr><tr><td>Change spot easily</td><td>YES</td><td>NO</td><td>YES</td><td>YES</td></tr><tr><td>MultiShape</td><td>NO</td><td>NO</td><td>NO</td><td>YES</td></tr><tr><td>SLM2 Illumination</td><td></td><td></td><td></td><td></td></tr><tr><td>Surface in %</td><td>100%</td><td>100%</td><td>12%</td><td>48%</td></tr><tr><td>Power Available</td><td></td><td></td><td></td><td></td></tr><tr><td>Total Transmission</td><td>40%</td><td>50%</td><td>40%</td><td>25%</td></tr><tr><td>Method limitation</td><td>None</td><td>None</td><td>&lt; 0.2 W</td><td>&lt; 0.8 W</td></tr><tr><td>Spot Quality</td><td></td><td></td><td></td><td></td></tr><tr><td>Speckle</td><td>YES</td><td>YES</td><td>NO</td><td>NO</td></tr><tr><td>Sharpness</td><td></td><td></td><td>●</td><td>●</td></tr><tr><td>Axial Resolution</td><td></td><td></td><td></td><td></td></tr><tr><td>Average Value</td><td>11 µm</td><td>11 µm</td><td>6 µm</td><td>9.5 µm</td></tr></tbody></table>

ªPerformances for each method are sorted according to the following color code: green (best performance), yellow (average), red (worst performance). MTF-GPC and MTF-MS require a more complex alignment procedure, due to the need of aligning the GPC interferometer or different shapes at the same time (see also the Supplementary Note in Supplement 1). MTF-MS provides more flexibility due to the possibility of having multiple shapes multiplexed at the sample plane. In terms of SLM2 illumination, MTF-GPC is the least optimized method as it produces one focused line of colors. MTF-MS, in the case demonstrated in the text, i.e., for four different shapes, leads to a four times larger illumination of SLM2. For the total power available at the sample, we considered that each SLM, the diffraction grating, and the microscope objective, each reflect (or transmit) 80% of the incoming light. This leads to a total available power of 40% of the incoming light for MTF-CGH and MTF-GPC. We considered negligible losses on the static phase mask. For the MTF-MS, in order to create four shapes (four circles of the same size), one has to divide SLM1 into four zones, and draw in each one a circle of diameter of half the size of the SLM shorter dimension. Given the dimensions of our SLMs, this leads to an additional loss of ~40% with respect to the other techniques. This number may change when changing the sizes and shapes chosen. For the total power available at the sample plane, one has to additionally consider that MTF-GPC is limited to ~0.2 W by the damage threshold of the SLM. MTF-MS allows one to increase the power by a factor of four, provided that the laser source is sufficiently powerful. For the shape quality, we considered that the techniques based on CGH generate speckled and less sharp spots. For the axial resolution, we have given the experimental values calculated as an average over the full FOE.

optics, a maximum number of eight shapes could be made without exceeding the physical size of SLM2. We note, however, that, even before reaching that limit, some crosstalk between the different shapes at SLM2 could occur, as high spatial frequencies (e.g., the ones coming from the sharp edges of the shapes created by SLM1) are diffracted broadly in the Fourier space, as also discussed in Ref. [35]. In the conditions in Fig. 5, i.e., for four shapes, no such crosstalk was observed.

For all the MTF-LS techniques described in this paper, the total FOE at the sample position depends mainly on the SLM2 pixel size and the telescope used to conjugate the SLM2 plane with the objective back aperture. When using the 40 ×, 0.8 NA objective, our system had a theoretical FOE [33] of 750 µm × 750 µm × 990 µm. Experimentally, we could demonstrate an axial resolution as small as 5–7 µm at the center of the FOE, and <15 µm throughout the whole FOE, with an average intensity per spot varying less than 40% within a FOE of 300 µm × 300 µm × 500 µm, limited by the finite size of the optics (mirrors and lenses) placed after SLM2. It should be also noted that extending the experimental FOE further would worsen
the axial resolution, due to aberrations introduced by the optics. In order to reach a larger FOE and maintain at the same time a good axial resolution, one could use optical elements of bigger size and perform a more thorough correction of the aberrations. A possibility in this sense would be to add in the algorithm calculating the phase of SLM2 the possibility to include different aberration corrections at different depths (z values).

In general, when placing excitation spots in 3D, care should be taken in avoiding situations that could lead to crosstalk fluorescence among them. As already characterized in Ref. [33], when placing two spots at the same xy coordinates but at different planes, the minimum axial distance to avoid crosstalk should be >50 µm for our experimental setup.

Regarding the lateral spatial localization accuracy of the patterns, in CGH, this is related to the minimum displacement, $\Delta\delta_{min}$, of the illumination spot that is possible to achieve by spatially modulating the phase of the incoming light beam with a prism-like phase shift. $\Delta\delta_{min}$ has been quantified for holographic optical tweezers [54], and it is inversely proportional to the product $N \cdot g$ of the number of pixels (N) and the number of phase levels (g) of the SLM, which for typical SLM models reaches nm-scale repositioning (<10 nm). Consequently, even if we consider that pixel utilization on SLM2 is reduced to 1/10 (1–2 mm) in one direction, such as in the case of Gaussian, GPC beams, or MTF-MS configuration, the product $N \cdot g$ remains high, and according to [54], still below 10 nm. Thus, localization accuracy is not expected to be affected by such under-illumination of the SLM. The limiting factor in that case remains the damage threshold of the SLM, which prevents infinitely increasing the power sent to such a small area on the SLM and thus practically limits the number of targets.

Similar to our scheme, a multiplexing SLM was recently used to project low-NA temporally focused Gaussian beams [37,38] in 3D. These approaches, of easier implementation, are restricted to the generation of a static and single-sized spot, lacking also the capability of creating multiple shapes simultaneously. As an additional limitation, similar to the case of MTF-GPC, using Gaussian beams results in a vertical under-fill of SLM2. To overcome this, Pégard and colleagues [37] defocused the laser beam before the diffraction grating, achieving a better illumination of SLM2. This procedure, however, had the clear downside of shifting away the spatial and temporal foci with respect to each other, which appeared as separate features at the sample plane, thus spoiling the axial propagation of the temporally focused beam [55]. Notably, the updated version of the same system removed the double foci [39], the flexibility of the method remaining still limited to the performances of a Gaussian beam with a two times worse axial resolution than the one demonstrated here [40]. In Ref. [38] instead, the need of underfilling the objective pupil to obtain bigger spots at the sample made the system more suitable for generation of small (<10 µm) spots, thus limiting its applicability to the optogenetic activation of bigger cells.

As already noticed in Ref. [38], because SLM2 is positioned in the Fourier plane of the diffraction grating, it operates in a plane in which the wavelength components are dispersed. This, especially in the MTF-GPC and MTF-MS configurations, is very similar to a pulse-shaping setup in which a one-dimensional SLM is used to synthesize pulses with customized temporal properties [56]. It is therefore expected that, while we used SLM2 only to produce precise spatial patterns, simultaneous temporal variation

could occur to the pulse. A similar spatiotemporal coupling effect was observed in Ref. [38], where a linear shift in the x direction (the TF direction) simultaneously accounted for a linear shift in the optical frequency $\omega$ and thus an overall time delay. Similarly, in our case, a quadratic phase in the xy coordinates generates a lens effect that shifts axially the spots (Fig. S2). This however, might result in undesired temporal chirp applied to the pulse, which, in turn, might be an additional contribution (apart from aberration) to the worse axial resolution when moving away from the focal plane. A deeper study of these phenomena might give the opportunity to really simultaneously control the space and time dimensions. However, we also wish to stress that, even if temporal distortions to the pulse might happen, the main effect that one achieves with SLM2 is to spatially modify the distribution of targets at the sample volume. In fact, in the phase calculation for SLM2, we did not introduce the grating dispersion, i.e., we calculated a phase as if all the wavelength components would hit SLM2 at the same place and still could accurately place the spots in 3D. This demonstrates that for many applications, one might restrict the calculation to the spatial dimension only, without being concerned by the temporal dimension.

We applied MTF-CGH to the *in vivo* 2P conversion of Kaede protein in the brain of zebrafish larvae and to the *in vivo* 2P activation of a photoactivable version of GCaMP (sPA-GCaMP6f) in the central nervous system of fruit flies. In both applications, we demonstrated in-depth simultaneous targeting of multiple individual neurons. Temporally focused patterns, as already demonstrated in previous works [23,33], are robust against propagation through scattering media, which allowed individual neurons within a highly packed ensemble to be precisely targeted up to a depth of 200 µm, with minimal spurious fluorescence induced in neighboring cells. The primary limitation in photo-converting a higher number of targets was the total laser power available at each position. Longer exposure times combined with the introduction of real-time movement correction (as well as the use of more powerful lasers) should allow increasing the number of targeted neurons.

The capability of the optical system to precisely target multiple cells can be applied to a large variety of photo-switchable proteins [57,58], and could be useful for tracking specific cellular ensembles *in vivo* and during development. In particular, targeted photoactivation of calcium indicators opens the way to simultaneous morphological and functional investigation of specific neuronal sub-circuits where cells are either too dense for traditional analysis, or where there is a lack of cell-specific genetic driver lines [32,41].

Combined with optogenetics, MTF-LS will enable optical control of large neuronal circuits with cellular resolution. In this case, the maximum achievable number of targets will depend on the excitation source and target distribution. For instance, using conventional Ti-Sapphire lasers (80 MHz repetition rate, 1.0–1.5 W exit power at 920–1040 nm where most of the opsins' 2P cross sections peak) to activate neurons expressing ReaChR or CoChR *in vitro* requires 7–35 mW/cell (values at the objective output) and therefore could enable reaching at most 10–60 cells [12,59]. Powerful lasers, as the one used in this study (80 MHz repetition rate, 1040 nm excitation wavelength; 18 W exit power) enable to considerably increase this number. Even more promising are amplified low-repetition rate lasers that, because of the reduced repetition rate, enable efficient optogenetic stimulation at very low average power (e.g., 2.5–5.3 mW/cell for the same opsins and the
same preparations mentioned above) [12,59]. This, in addition to the capability for these sources to deliver tens of watts of exit power, makes possible in principle to simultaneously photostimulate hundreds of cells. Using low-repetition-rate amplified lasers has also the advantage of minimizing heating during photostimulation, which for parallel illumination is the dominant source of possible photodamage [60]. As recently demonstrated for single-cell photostimulation, the use of amplified lasers enables to keep local heating below 1°C (for 3–10 ms illumination time and 11 mw/cell at the exit of the objective). This threshold can be maintained also for multi-target photostimulation providing that the average distance among multiple targets is kept larger than the heat diffusion length ($l_{th} = \sqrt{6Dt}$, with D thermal diffusivity and t illumination time; i.e., 50–90 µm for 3–10 ms illumination time) [60].

## 5. CONCLUSION

In this work, we demonstrated, thoroughly characterized, and applied to biological proofs of principles a novel optical system enabling the generation of multiple temporally focused illumination targets at arbitrary 3D locations. The system is robust and versatile, which makes it compatible with several different beam-shaping approaches.

The demonstrated MTF-LS techniques could therefore constitute the basis of a reliable approach for 3D “all-optical” brain circuits control on large scales, especially if combined with 3D imaging techniques [61–64]. At the same time, its use is not limited only to neuronal activation, but could as well be extended, in combination with camera detections [65,66] and multi-plane spatial demixing algorithms [67], to fast volumetric functional imaging, using calcium or voltage sensors. More generally, any application relying on light-patterning methods and nonlinear phenomena, such as photo-polymerization [68], optical data storage, and photolithography [69], could benefit from this technique.

**Funding.** Defense Advanced Research Projects Agency (DARPA) (N66001-17-C-4015); Agence Nationale de la Recherche (ANR) (ANR-14-CE13-0016, Holohub, ANR-15-CE19-0001-01, 3D HoloPAC); National Institutes of Health (NIH) (U01NS090501-03, 1UF1NS107574 - 01); H2020 Marie Skłodowska-Curie Actions (MSCA) (746173); H2020 European Research Council (ERC) (OPTOLOCO 311673, SYNERGY, HELMHOLTZ 610110); Human Frontier Science Program (HFSP) (RGP0015/2016); Getty Foundation; Fondation Bettencourt Schueller (Prix Coups d'élan pour la recherche française).

**Acknowledgment.** We thank Vincent de Sars for software developing, Leslie Kimerling (Double Helix LLC) for providing the phase mask, Coherent Inc. for the loan of the Fidelity laser, Intelligent Imaging Innovations, Inc. for providing the 2P scanning microscope, Martin Booth for useful discussions, Anna Segú-Cristina for help in the preparation of the zebrafish sample, SCM (Service Commun de Microscopie—Faculté des Sciences Fondamentales et Biomédicales—Paris) for providing the software Imaris (Imaris v8.4, Bitplane, software available at www.bitplane.com [70]), Sophie Nunes-Figueiredo from the ICM zebrafish facility for animal care, Sorbonne Université, Inserm, CNRS, AP-HP, Hôpital Pitié-Salpêtrière), and the team of Jean-René Huynh (Institut Curie, Paris) and of Bassem Hassan

(ICM, Paris) for their help with drosophila transgenic lines. The views, opinions, and/or findings expressed are those of the author and should not be interpreted as representing the official views or policies of the Department of Defense or the U.S. Government. V.E. received funding from Getty Lab. N. A. received funding from the European Union's Horizon 2020 research and innovation programme Marie Skłodowska-Curie Actions. E. R. received funding from the European Research Council SYNERGY Grant scheme. C. W. received funding from the European Research Council and the New York Stem Cell Foundation as a Robertson Neuroscience Investigator.

See Supplement 1 for supporting content.

†These authors contributed equally to this work.

## REFERENCES

1. J. E. Curtis, B. A. Koss, and D. G. Grier, "Dynamic holographic optical tweezers," Opt. Commun. 207, 169-175 (2002).

2. J. Leach, K. Wulff, G. Sinclair, P. Jordan, J. Courtial, L. Thomson, G. Gibson, K. Karunwi, J. Cooper, Z. J. Laczik, and M. J. M. J. Padgett, "Interactive approach to optical tweezers control," Appl. Opt. 45, 897-903 (2006).

3. R. W. Gerchberg and W. O. Saxton, "A practical algorithm for the determination of the phase from image and diffraction pictures," Optik 35, 237-246 (1972).

4. S. Yang, E. Papagiakoumou, M. Guillon, V. de Sars, C. M. Tang, and V. Emiliani, "Three-dimensional holographic photostimulation of the dendritic arbor," J. Neural Eng. 8, 046002 (2011).

5. F. Anselmi, C. Ventalon, A. Begue, D. Ogden, V. Emiliani, A. Bègue, D. Ogden, and V. Emiliani, "Three-dimensional imaging and photostimulation by remote-focusing and holographic light patterning," Proc. Natl. Acad. Sci. USA 108, 19504-19509 (2011).

6. V. Nikolenko, B. O. Watson, R. Araya, A. Woodruff, D. S. Peterka, and R. Yuste, "SLM microscopy: scanless two-photon imaging and photostimulation with spatial light modulators," Front. Neural Circuits 2, 5 (2008).

7. V. R. Daria, C. Stricker, R. Bowman, S. Redman, and H. A. Bachor, "Arbitrary multisite two-photon excitation in four dimensions," Appl. Phys. Lett. 95, 093701 (2009).

8. C. Lutz, T. S. Otis, V. DeSars, S. Charpak, D. A. Digregorio, and V. Emiliani, "Holographic photolysis of caged neurotransmitters," Nat. Methods 5, 821-827 (2008).

9. K. Deisseroth, "Optogenetics," Nat. Methods 8, 26-29 (2011).

10. K. Deisseroth, "Optogenetics: 10 years of microbial opsins in neuroscience," Nat. Neurosci. 18, 1213-1225 (2015).

11. E. Ronzitti, R. Conti, V. Zampini, D. Tanese, A. J. Foust, N. Klapoetke, E. S. Boyden, E. Papagiakoumou, and V. Emiliani, "Sub-millisecond optogenetic control of neuronal firing with two-photon holographic photoactivation of Chronos," J. Neurosci. 37, 10679-10689 (2017).

12. E. Chaigneau, E. Ronzitti, A. M. Gajowa, J. G. Soler-Llavina, D. Tanese, Y. B. A. Brureau, E. Papagiakoumou, H. Zeng, and V. Emiliani, "Two-photon holographic stimulation of ReaChR," Front. Cell. Neurosci. 10, 234 (2016).

13. A. Bègue, E. Papagiakoumou, B. Leshem, R. Conti, L. Enke, D. Oron, and V. Emiliani, "Two-photon excitation in scattering media by spatiotemporally shaped beams and their application in optogenetic stimulation," Biomed. Opt. Express 4, 2869-2879 (2013).

14. D. Oron, E. Tal, and Y. Silberberg, "Scanningless depth-resolved microscopy," Opt. Express 13, 1468-1476 (2005).

15. G. Zhu, J. van Howe, M. Durst, W. Zipfel, and C. Xu, "Simultaneous spatial and temporal focusing of femtosecond pulses," Opt. Express 13, 2153-2159 (2005).

16. E. Papagiakoumou, V. de Sars, D. Oron, and V. Emiliani, "Patterned two-photon illumination by spatiotemporal shaping of ultrashort pulses," Opt. Express 16, 22039-22047 (2008).

17. J. Glückstad, D. Palima, P. J. Rodrigo, and C. A. Alonzo, "Laser projection using generalized phase contrast," Opt. Lett. 32, 3281-3283 (2007).
18. J. P. Rickgauer, K. Deisseroth, and D. W. Tank, "Simultaneous cellular-resolution optical perturbation and imaging of place cell firing fields," *Nat. Neurosci.* **17**, 1816–1824 (2014).

19. B. K. Andrasfalvy, B. V. Zemelman, J. Tang, and A. Vaziri, "Two-photon single-cell optogenetic control of neuronal activity by sculpted light," *Proc. Natl. Acad. Sci. USA* **107**, 11981–11986 (2010).

20. E. Papagiakoumou, F. Anselmi, A. Bègue, V. de Sars, J. Glückstad, E. Y. Iscoff, and V. Emiliani, "Scanless two-photon excitation of channelrhodopsin-2," *Nat. Methods* **7**, 848–854 (2010).

21. I.-W. Chen, E. Ronzitti, R. B. Lee, L. T. Daigle, H. Zeng, E. Papagiakoumou, and V. Emiliani, "Parallel holographic illumination enables sub-millisecond two-photon optogenetic activation in mouse visual cortex in vivo," *bioRxiv* (2017), pp. 1–21.

22. G. Sela, H. Dana, and S. Shoham, "Ultra-deep penetration of temporally-focused two-photon excitation," *Proc. SPIE* **8588**, 858824 (2013).

23. E. Papagiakoumou, A. Bègue, B. Leshem, O. Schwartz, B. M. Stell, J. Bradley, D. Oron, and V. Emiliani, "Functional patterned multiphoton excitation deep inside scattering tissue," *Nat. Photonics* **7**, 274–278 (2013).

24. A. M. Packer, L. E. Russell, H. W. P. Dalgleish, and M. Häusser, "Simultaneous all-optical manipulation and recording of neural circuit activity with cellular resolution in vivo," *Nat. Methods* **12**, 140–146 (2015).

25. L. Carrillo-reid, W. Yang, Y. Bando, D. S. Peterka, and R. Yuste, "Imprinting and recalling cortical ensembles," *Science* **353**, 691–694 (2016).

26. W. Yang, L. Carrillo-Reid, Y. Bando, D. S. Peterka, and R. Yuste, "Simultaneous two-photon imaging and two-photon optogenetics of cortical circuits in three dimensions," *eLife* **7**, e32671 (2018).

27. A. M. Packer, D. S. Peterka, J. J. Hirtz, R. Prakash, K. Deisseroth, R. Yuste, O. Yizhar, B. Grewe, C. Ramakrishnan, N. Wang, I. Goshen, A. M. Packer, D. S. Peterka, R. Yuste, M. J. Schnitzer, and K. Deisseroth, "Two-photon optogenetics of dendritic spines and neural circuits," *Nat. Methods* **9**, 1202–1205 (2012).

28. A. Hopt and E. Neher, "Highly nonlinear photodamage in two-photon fluorescence microscopy," *Biophys. J.* **80**, 2029–2036 (2001).

29. J. P. Rickgauer and D. W. Tank, "Two-photon excitation of channelrhodopsin-2 at saturation," *Proc. Natl. Acad. Sci. USA* **106**, 15025–15030 (2009).

30. R. Prakash, O. Yizhar, B. Grewe, C. Ramakrishnan, N. Wang, I. Goshen, A. M. Packer, D. S. Peterka, R. Yuste, M. J. Schnitzer, and K. Deisseroth, "Two-photon optogenetic toolbox for fast inhibition, excitation and bistable modulation," *Nat. Methods* **9**, 1171–1179 (2012).

31. E. Ronzitti, C. Ventalon, M. Canepari, B. C. Forget, E. Papagiakoumou, and V. Emiliani, "Recent advances in patterned photostimulation for optogenetics," *J. Opt.* **19**, 113001 (2017).

32. M. dal Maschio, J. C. Donovan, T. O. Helmbrecht, and H. Baier, "Linking neurons to network function and behavior by two-photon holographic optogenetics and volumetric imaging," *Neuron* **94**, 774–789.e5 (2017).

33. O. Hernandez, E. Papagiakoumou, D. Tanese, K. Fidelin, C. Wyart, and V. Emiliani, "Three-dimensional spatiotemporal focusing of holographic patterns," *Nat. Commun.* **7**, 11928 (2016).

34. E. Papagiakoumou, E. Ronzitti, I.-W. Chen, M. Gajowa, A. Picot, and V. Emiliani, "Two-photon optogenetics by computer-generated holography," *Neuromethods* **133**, 175–197 (2018).

35. A. Bañas and J. Glückstad, "Holo-GPC: holographic generalized phase contrast," *Opt. Commun.* **392**, 190–195 (2017).

36. M. A. Go, P.-F. Ng, H. A. Bachor, and V. R. Daria, "Optimal complex field holographic projection," *Opt. Lett.* **36**, 3073–3075 (2011).

37. N. M. Pégard, I. Oldenburg, S. Sridharan, L. Waller, and H. Adesnik, "3D scanless holographic optogenetics with temporal focusing," *Nat. Commun.* **8**, 1228 (2017).

38. B. Sun, P. S. Salter, C. Roider, A. Jesacher, J. Strauss, J. Heberle, M. Schmidt, and M. J. Booth, "Four-dimensional light shaping: manipulating ultrafast spatio-temporal foci in space and time," *Light Sci. Appl.* **7**, 17117 (2018).

39. A. R. Mardinly, I. A. Oldenburg, N. C. Pégard, S. Sridharan, E. H. Lyall, K. Chesnov, S. G. Brohawn, L. Waller, and H. Adesnik, "Precise multimodal optical control of neural ensemble activity," *Nat. Neurosci.* **21**, 881–893 (2018).

40. P. Nicolas, A. Mardinly, I. Oldenburg, L. Waller, and H. Adesnik, "Partially coherent holographic temporal focusing for 3D light sculpting with single neuron resolution," in *Optics and the Brain* (Optical Society of America, 2018) paper BW2C.2.

41. S. Berlin, E. C. Carroll, Z. L. Newman, H. O. Okada, C. M. Quinn, B. Kallman, N. C. Rockwell, S. S. Martin, J. C. Lagarias, and E. Y.

Iscoff, "Photoactivatable genetically encoded calcium indicators for targeted neuronal imaging," *Nat. Methods* **12**, 852–858 (2015).

42. M. Tomura, N. Yoshida, J. Tanaka, S. Karasawa, Y. Miwa, A. Miyawaki, and O. Kanagawa, "Monitoring cellular movement *in vivo* with photoconvertible fluorescence protein "Kaede" transgenic mice," *Proc. Natl. Acad. Sci. USA* **105**, 10871–10876 (2008).

43. A. Bañas, D. Palima, M. Villangca, T. Aabo, J. Glückstad, A. Banas, D. Palima, M. Villangca, T. Aabo, and J. Glückstad, "GPC light shaper for speckle-free one- and two-photon contiguous pattern excitation," *Opt. Express* **22**, 5299–5311 (2014).

44. J. Glückstad, "Phase contrast image synthesis," *Opt. Commun.* **130**, 225–230 (1996).

45. R. Di Leonardo, F. Ianni, and G. Ruocco, "Computer generation of optimal holograms for optical trap arrays," *Opt. Express* **15**, 1913–1922 (2007).

46. O. Hernandez, M. Guillon, E. Papagiakoumou, and V. Emiliani, "Zero-order suppression for two-photon holographic excitation," *Opt. Lett.* **39**, 5953–5956 (2014).

47. D. Palima and V. R. Daria, "Holographic projection of arbitrary light patterns with a suppressed zero-order beam," *Appl. Opt.* **46**, 4197–4201 (2007).

48. A. Jesacher and M. J. Booth, "Parallel direct laser writing in three dimensions with spatially dependent aberration correction," *Opt. Express* **18**, 21090–21099 (2010).

49. R. Conti, O. Assayag, V. De Sars, M. Guillon, and V. Emiliani, "Computer generated holography with intensity-graded patterns," *Front. Cell. Neurosci.* **10**, 236 (2016).

50. H. Aberle, A. P. Haghighi, R. D. Fetter, B. D. McCabe, T. R. Magalhães, and C. S. Goodman, "Wishful thinking encodes a BMP type II receptor that regulates synaptic growth in Drosophila," *Neuron* **33**, 545–558 (2002).

51. B. Sun, P. S. Salter, and M. J. Booth, "Effects of aberrations in spatiotemporal focusing of ultrashort laser pulses," *J. Opt. Soc. Am. A* **31**, 765–772 (2014).

52. R. Ando, H. Hama, M. Yamamoto-Hino, H. Mizuno, and A. Miyawaki, "An optical marker based on the UV-induced green-to-red photoconversion of a fluorescent protein," *Proc. Natl. Acad. Sci. USA* **99**, 12651–12656 (2002).

53. K. Isobe, H. Hashimoto, A. Suda, F. Kannari, H. Kawano, H. Mizuno, A. Miyawaki, and K. Midorikawa, "Measurement of two-photon excitation spectrum used to photoconvert a fluorescent protein (Kaede) by nonlinear Fourier-transform spectroscopy," *Biomed. Opt. Express* **1**, 687–693 (2010).

54. C. H. J. Schmitz, J. P. Spatz, and J. E. Curtis, "High-precision steering of multiple holographic optical traps," *Opt. Express* **13**, 8678–8685 (2005).

55. I. Chen, E. Papagiakoumou, and V. Emiliani, "Towards circuit optogenetics," *Curr. Opin. Neurobiol.* **50**, 179–189 (2018).

56. A. M. Weiner, "Femtosecond pulse shaping using spatial light modulators," *Rev. Sci. Instrum.* **71**, 1929–1960 (2000).

57. G. H. Patterson and J. Lippincott-Schwartz, "A photoactivatable GFP for selective photolabeling of proteins and cells," *Science* **297**, 1873–1877 (2002).

58. D. M. Chudakov, V. V. Belousov, A. G. Zarisky, V. V. Novoselov, D. B. Staroverov, D. B. Zorov, S. Lukyanov, and K. A. Lukyanov, "Kindling fluorescent proteins for precise in vivo photolabeling," *Nat. Biotechnol.* **21**, 191–194 (2003).

59. O. A. Shemesh, D. Tanese, V. Zampini, C. Linghu, K. Piatkevich, E. Ronzitti, E. Papagiakoumou, E. S. Boyden, and V. Emiliani, "Temporally precise single-cell resolution optogenetics," *Nat. Neurosci.* **20**, 1796–1806 (2017).

60. A. Picot, S. Dominguez, C. Liu, I. W. Chen, D. Tanese, E. Ronzitti, P. Berto, E. Papagiakoumou, D. Oron, G. Tessier, B. C. Forget, and V. Emiliani, "Temperature rise under two-photon optogenetic brain stimulation," *Cell Rep.* **24**, 1243–1253.e5 (2018).

61. J. N. Stirman, I. T. Smith, M. W. Kudenov, and S. L. Smith, "Wide field-of-view, multi-region, two-photon imaging of neuronal activity in the mammalian brain," *Nat. Biotechnol.* **34**, 857–862 (2016).

62. N. Ji, J. Freeman, and S. L. Smith, "Technologies for imaging neural activity in large volumes," *Nat. Neurosci.* **19**, 1154–1164 (2016).

63. R. Prevedel, A. J. Verhoef, A. J. Pernía-Andrade, S. Weisenburger, B. S. Huang, T. Nöbauer, A. Fernández, J. E. Delcour, P. Golshani, A. Baltuska, and A. Vaziri, "Fast volumetric calcium imaging across multiple
cortical layers using sculpted light,” Nat. Methods **13**, 1021–1028 (2016).

64. A. Song, A. S. Charles, S. A. Koay, J. L. Gauthier, S. Y. Thiberge, J. W. Pillow, and D. W. Tank, “Volumetric two-photon imaging of neurons using stereoscopy (vTwINS),” Nat. Methods **14**, 420–426 (2017).

65. S. Quirin, J. Jackson, D. S. Peterka, and R. Yuste, “Simultaneous imaging of neural activity in three dimensions,” Front. Neural Circuits **8**, 29 (2014).

66. S. J. Yang, W. E. Allen, I. Kauvar, A. S. Andalman, N. P. Young, C. K. Kim, J. H. Marshel, G. Wetzstein, and K. Deisseroth, “Extended field-of-view and increased-signal 3D holographic illumination with time-division multiplexing,” Opt. Express **23**, 32573–32581 (2015).

67. E. A. Pnevmatikakis, D. Soudry, Y. Gao, T. A. Machado, J. Merel, D. Pfau, T. Reardon, Y. Mu, C. Lacefield, W. Yang, M. Ahrens, R. Bruno, T. M. Jessell, D. S. Peterka, R. Yuste, and L. Paninski, “Simultaneous denoising, deconvolution, and demixing of calcium imaging data,” Neuron **89**, 285–299 (2016).

68. L. Kelemen, P. Ormos, and G. Vizsnyiczai, “Two-photon polymerization with optimized spatial light modulator,” J. Eur. Opt. Soc. **6**, 11029 (2011).

69. F. Burmeister, S. Steenhusen, R. Houbertz, U. D. Zeitner, S. Nolte, and A. Tünnermann, “Materials and technologies for fabrication of three-dimensional microstructures with sub-100 nm feature sizes by two-photon polymerization,” J. Laser Appl. **24**, 042014 (2012).

70. Imaris v8.4, Bitplane, software available at http://www.bitplane.com.