Designing a TF system for arbitrary 3D targeting

3D-SHOT operates by replicating identical copies of a temporally focused disc of light, termed the custom temporarily focused pattern (CTFP), at arbitrary 3D positions. Here, the dimensions of the CTFP were chosen to match the characteristic size of a layer 2/3 cortical pyramidal neuron35, (Supplementary Table 1) and may be easily adjusted for different applications (Supplementary Table 2). The CTFP is designed by separating a patterned laser beam (characterized by its phase and intensity) into spectral components with a diffraction grating as in a conventional TF system. The beam intensity profile determines the dimensions of the CTFP, while phase, a previously unused degree of freedom, is engineered to make 3D holography and temporal focusing compatible. To ensure good diffraction efficiency of all spectral components by the SLM, we used lens L c to apply a small spherical phase pattern. The focal length was adjusted so that each spectral component of the pulse spans across the short axis of the SLM in the Fourier domain (Supplementary Figs. 1, 2). Besides experimental simplicity, the spherical phase mask imposed by lens L c yields convenient analytical expressions for simulation purposes (Supplementary Notes 1−3). We note, however, that alternate phase masks (for instance generated with a secondary SLM), could also be employed as long as they expand the spectral components to cover enough area of the SLM to enable holography.

The fundamental principle of 3D-SHOT (see Methods section) is to make temporal focusing compatible with 3D CGH by placing the SLM after the diffraction grating. This design forgoes the ability to synthesize custom shapes for each neuron, but represents an acceptable trade-off for many optogenetic applications. The resulting experimental set-up operates an all-optical convolution product given by:

$${{{A_{\rm{E}}}(x,y,z,\Delta k) = {A_{\rm{C}}}\left( {\frac{{{f_4}x}}{{{f_5}}},\frac{{{f_4}y}}{{{f_5}}},\Delta k} \right) \otimes \left[ {{\rm{F}}\left[ {{e^{i\varphi }}} \right]\left( {\frac{x}{{{\lambda f_5}}},\frac{y}{\lambda {f_5}}} \right) \otimes h\left( {x,y,z} \right)} \right],}}$$ (1)

where ⊗ denotes the convolution product. The CTFP, A C (x,y,∆k), adjusted to the characteristic dimensions of a neuron after demagnification, can then be placed on demand at the desired locations by an all-optical convolution with a 3D hologram corresponding to the phase mask, φ, displayed on the SLM (Fig. 1). To simultaneously place identical copies of the CTFP at n neurons located in positions (x i ,y i ,z i ) in space, we computed a hologram optimized so that the Fresnel propagation, h, of F[e iφ] best approximates a cloud of points located at the desired targets with weighted intensities that can be adjusted for each targeted neuron. A demagnified copy of the CTFP was then recreated at each point of the cloud in the resulting field.

Fig. 1 Simplified experimental set-up for 3D-SHOT. a A spherical phase mask is applied to a Gaussian femtosecond laser pulse incident on a blazed diffraction grating. After the grating, the direction of propagation of the first-order beam is wavelength-specific, decomposing the pulse in the temporal domain. Temporal focusing and the associated nonlinear response thus only happens across a disc-shaped area at depth planes corresponding to images of the diffraction grating (dashed, green). We call this 3D intensity distribution a Custom Temporally Focused Pattern (CTFP). b We then copied this temporally focused disc pattern to different areas in 3D by computer generated holography (CGH). To do so, a spatial light modulator (SLM) in Fourier space (dashed, red) generates a point-cloud hologram that replicates the CTFP at each target point in the volume image. The resulting field is demagnified again before impinging on the sample to create custom 3D positioning of the temporally focused disk, each targeted at a particular neuron Full size image

Here, our primary goal was not to render a visually accurate hologram but instead to increase contrast for two-photon excitation at selected locations while avoiding inadvertent photo-activation of non-targeted areas, and we implemented a modified version of the multilevel Gerchberg−Saxton (GS)20 algorithm that emphasizes precise control of the intensity at the desired targets.

Quantitative 3D characterization of two-photon absorption

To evaluate the capabilities of 3D-SHOT and quantify how two-photon absorption is spatially distributed in 3D, we placed a flat phase mask on the SLM, \(\varphi \left( {x,y} \right) = 0\), so that the convolution product in Equation (1) reduces to the simplest case of requesting a single copy of the CTFP to be placed at the center of the operating volume, defined in x = y = z = 0 (that is, the system’s zero-order). We then placed a thin fluorescent film on a microscope slide under the excitation objective and recorded the corresponding two-photon fluorescence with a sub-stage objective coupled to a camera (Fig. 2a). We recorded z-stack images by moving the excitation objective along the z-axis by 1 µm increments. The resulting data correspond to a quantitative 3D measurement of two-photon absorption induced by the CTFP. In the specific case of a flat phase pattern on the SLM, we have also derived an analytical expression for the instantaneous two-photon absorption, \({\left| {{A_{\rm{F}}}\left( {x,y,z,\Delta t} \right)} \right|^4}\)(Supplementary Fig. 3), which we used to predict and visualize the CTFP in space and time, and also to compare simulation and experiments.

Fig. 2 Optical characterization of the spatial resolution of CGH vs. 3D-SHOT. a We used a fluorescent calibration slide and an inverted microscope to compare two-photon absorption patterns in 3D. b For conventional holography, we consider a 10 µm diameter disk target, and show (from top to bottom) example projection views of two-photon absorption in the (x,y), (z,y), and (z,x) planes. With 3D-SHOT, the CTFP was adjusted to a 10 µm diameter target and the same projection views were recorded c experimentally, and d rendered with simulation. e Simulation additionally provides space-time projections (Supplementary Notes 1−3). The primary focus (green arrow) at z = 0 displays the characteristic depth-sectioned properties of temporal focusing, with a perceived femtosecond pulse line object rapidly swept along the x-axis. The secondary focus (pink arrow), a static line along the x-axis in y = 0, is a geometric projection of the spherical phase pattern induced by lens L c . The pulse duration at the secondary focus is stretched in time (~1000 fs) which minimizes nonlinear response Full size image

We first compared 3D-SHOT to conventional 3D holography (Fig. 2b). Using CGH, we computed a 10 µm disk image target at z = 0 where we imposed a high-frequency speckle pattern to maximize spatial confinement along the z-axis. Projection views of two-photon absorption along the x, y, and z axes show how even in an optimized hologram unwanted photostimulation remains above and below a neuron targeted with this method. When the 10 µm CGH pattern is replaced by a 3D-SHOT CTFP of equal size, experimental results (Fig. 2c) and simulations (Fig. 2d−e) show that temporal focusing significantly enhances spatial confinement along the z-axis.

Scanless two-photon optogenetics using 3D-SHOT

We evaluated the spatial resolution of 3D-SHOT via optogenetic stimulation of opsin-expressing Chinese Hamster Ovary (CHO) cells and mouse neurons in acute brain slices and in vivo. We evaluated the spatial resolution (or physiological point spread function (PPSF)) by recording the photocurrent response to multiphoton photostimulation as a function of the displacement between the holographic target and the patched cell (Fig. 3a, e). The set-up is fitted with a pair of mirrors on a sliding stage to rapidly swap between CGH and 3D-SHOT (Supplementary Fig. 1). The two optical paths are aligned so that the centers of the CTFP (3D-SHOT path) and the disc illumination (CGH path) are co-aligned along all 3D. This allows both methods to be tested on individual cells without any realignment.

Fig. 3 3D-SHOT generates axially confined photo-activation. a A photostimulation pattern generated with CGH was mechanically stepped along the optical z-axis and passed through a cell expressing opsin. Photocurrents were recorded in the whole-cell voltage clamp configuration. b−f The response profile for CGH with a 10 µm disk target and different power levels on CHO cells for CGH b or 3D-SHOT f (n = 12 cells, data points are a representative example cell). d The FWHM of the characteristic response profile for both methods at various power levels on CHO cells (n = 12 cells, data represent mean ± s.e.m.). e As in a, but in mouse brain slices. c, g as in b, f, but in mouse brain slices (n = 11 neuron, data points are a representative example neuron). h The FWHM of the characteristic response profile for both methods at various power levels in mouse brain slices (n = 11 neurons, data represent mean ± s.e.m.) Full size image

Since power levels needed for photostimulation vary across cells due to differences in opsin expression and excitability, we compared the spatial confinement of 3D-SHOT and CGH photo-excitation as a function of laser power density. With conventional holography, we observed substantial photocurrents 25–50 µm above and below the target, indicating that photo-activation of non-targeted neurons is likely to occur (Fig. 3b, c). As predicted by simulations (Supplementary Fig. 3), temporal pulse stretching significantly enhanced spatial resolution with 3D-SHOT, as photocurrents were more significantly attenuated above and below the primary focus (Fig. 3f, g). In neurons and CHO cells, axial resolution with 3D-SHOT was significantly improved relative to CGH, even when using several orders of magnitude more laser power (Fig. 3d, h). This implies that one may increase excitation light to generate action potentials without compromising spatial confinement.

3D-SHOT photostimulation with single-neuron resolution

We next quantified the physiological spatial resolution of CGH and 3D-SHOT in neurons by measuring the spiking probability along the lateral (x,y) and axial (z) dimensions. Experimental results show similar spatial resolution with both methods in the lateral direction in the focal plane, with a FWHM of 10 ± 2 µm for holography, and 9 µm ± 1.3 for 3D-SHOT, (p = 0.57, Mann−Whitney U-test) consistent with the dimensions of the disc and CTFP (Fig. 4a). With CGH, the spike probability along the z-axis does not permit single-cell resolution (FWHM = 78 ± 6 µm). In contrast, 3D-SHOT provides far superior resolution (FWHM = 28 ± 0.7 µm, p = 0.006, Mann−Whitney U-test, Fig. 4b, c) compatible with single-cell resolution in 3D, in that the FWHM of spike probability is on par with the typical dimensions of a cortical neuron and their inter-somatic spacing. 3D-SHOT also has a secondary focus that is sheared off-axis relative to the linear (x,y,z) dimensions (Fig. 2). Although, we did not predict significant two-photon excitation to occur at the secondary geometric focus, we tested the spatial resolution by photo-stimulating a 3D grid pattern (50 × 50 × 100 µm3 x,y,z). This experiment revealed that the neuron was photo-activated only when the disc image was targeted to the cell body (Fig. 4d).

Fig. 4 3D-SHOT provides high spatial resolution photo-activation of neurons in vitro and in vivo. a Spatial profile of two-photon evoked spiking of a L2/3 pyramidal neuron in a mouse brain slice in the radial dimension. (CGH: black, n = 12 neurons; 3D-SHOT: red, n = 14 neurons; p = 0.56 Mann−Whitney U-test. Data represent mean ± s.e.m). b As in a) but along the axial dimension (CGH n = 11 neurons, 3D-SHOT n = 5 neurons, p = 0.006). c Quantification of the FWHM comparing CGH and 3D-SHOT (data represent mean and s.e.m.). d Full volumetric assessment of photostimulation resolution using 3D-SHOT. Points throughout the volume were tested, but only points that elicited spike probability greater than zero are shown (data represent mean of n = 7 neurons). e−g As in a−c but for neurons recorded via in vivo 2P guided patch: radial: p = 0.46; axial: p = 0.004, CGH (n = 6 neurons), and 3D-SHOT (n = 6 neurons). h as in d, but in vivo cell-attached patch using 3D-SHOT (data represent mean of n = 5 neurons) Full size image

To demonstrate 3D-SHOT’s single-neuron spatial resolution under in vivo conditions, we quantified the PPSF for L2/3 pyramidal neurons using 3D-SHOT and CGH in living mice. We obtained two-photon guided loose patch recordings from opsin-expressing neurons in anesthetized mice, generated action potentials in targeted neurons with light pulses, and measured the PPSF for CGH and 3D-SHOT by digitally displacing the holographic target. As in brain slices, CGH and 3D-SHOT exhibited similar spatial resolution in the lateral (x,y) dimensions (lateral FWHM: CGH: 15 ± 4 µm, 3D-SHOT: 11 ± 2 µm, p = 0.46, Mann−Whitney U-test, Fig. 4e). However, along the z-axis, 3D-SHOT achieved significantly better spatial confinement than CGH (Axial FWHM: CGH: 70 ± 16 µm, 3D-SHOT: 29 ± 3 µm, p = 0.004, Mann−Whitney U-test, Fig. 4f, g). Measuring spike probability in response to 3D-SHOT stimulation throughout a 3D 50 × 50 × 100 µm3 grid revealed no off-axis excitation by the secondary focus (Fig. 4h). Together, these data validate 3D-SHOT as a novel scanless optogenetic stimulation paradigm that can achieve single-neuron spatial resolution during optogenetic stimulation in the mouse brain in vivo.

Spatially precise remote control with 3D-SHOT

Since the major advantage of 3D-SHOT is the ability to target multiple neurons arbitrarily in 3D, it is vital that 3D-SHOT can activate neurons with high spatial resolution even when digitally focusing light far from the zero-order of the optical system. Therefore we next evaluated the accessible depth within the volume by measuring the activation and spatial resolution as a function of the distance from the holographic natural focus plane. Toward this end, we recorded photocurrents in CHO cells via a voltage clamp and then measured spike probability in neurons via a current clamp in mouse brain slices (Fig. 5a, e). To test whether the CTFP can be digitally displaced along the z-axis, we systematically moved the digital focus of the hologram, and accordingly corrected the mechanical position of the objective by the same distance (δz Digital = −δz Mechanical ). This test showed that 3D-SHOT effectively photostimulates cells at locations distal to the zero-order, as photocurrent and spike-probability were not affected by digital offset in z (Fig. 5b, CHO cells p = 0.39, Fig. 5f, neurons p = 0.2, Kruskal−Wallis).

Fig. 5 3D-SHOT provides cellular resolution photostimulation in a large volume through digital focusing. a To quantify the spatial resolution of 3D-SHOT as a function of hologram target depth, we recorded photocurrents in CHO cells while digitally targeting varying positions along the optical axis (z), and measuring resolution by mechanically sweeping the objective over the entire (z) range and measuring the response at each point. b Normalized photocurrent in CHO cells while targeting the same cell from different axial displacements (n = 5 cells; p = 0.39, Kruskal−Wallis test with multiple comparisons correction, data are mean and s.e.m.). c Axial photocurrent resolution as a function of digital displacement—shaded green colors denote mechanical sweeps across the optical axis for different digital displacements. d Quantification of the FWHM for the axial fit of photocurrents in CHO cells as a function of digital defocus from the focal plane (n = 5 cells, p = 0.07, data are mean and s.e.m.). e−h As in a−d, but spike probability recorded in mouse brain slices via current clamp instead of photocurrent in CHO cells recorded in voltage clamp (f: p = 0.2; h: p = 0.17, n = 3 neurons) Full size image

We next asked if the axial resolution of stimulation was constant when stimulating away from the natural focal plane at z = 0. For this we measured the FWHM of the axial PPSF as a function of digital defocus. As before, we digitally moved the holographic target along the z-axis, but instead of matching the digital and mechanical offset, we stepped the objective across the entire range of the z-axis and measured the physiological response at each location. This allowed us to measure the axial resolution of photostimulation from locations distributed on either side of the optical axis. Results show that 3D-SHOT effectively confines excitation to the desired depth range throughout the 180 µm range that we sampled, as the FWHM of stimulation did not change as a function of digital defocus in z (Fig. 5c-d, CHO cells p = 0.07, neurons, Fig. 5g-h. p = 0.17, Kruskal−Wallis test). These experiments show that 3D-SHOT retains axial confinement capabilities compatible with single-cell resolution for photocurrents and spike probability while targeting neurons at any depth within the accessible volume defined by the SLM and the microscope assembly (Supplementary Fig. 4, Supplementary Note 4).

Selective photostimulation of vertically stacked neurons

We next considered the particularly challenging scenario of activating two vertically stacked neurons without activating a neuron located between them. To test this scenario, we computed holograms that simultaneously target two axially aligned targets vertically separated by about 80 µm along the optical z-axis, either two disc patterns with conventional 3D CGH or two copies of the CTFP target made with 3D-SHOT and a two-point hologram. We then compared the photo-induced response in a single patched cell (CHO cells and neurons). Since the typical size of a L2/3 cortical pyramidal neuron is 15–20 µm in the axial dimension (plus additional strong photocurrent contributions from an apical dendrite oriented along the optical axis)43, without an (x,y) offset we expect that two pyramidal neurons would rarely be packed closer than 80 µm in z with a third neuron positioned between them44,45,46. Thus this scenario represents a challenging, yet physiologically relevant test case.

As in the previous experiment, a CHO cell or neuron was patched to record photocurrent and/or spike probability as a function of the respective displacement between the cell and the photostimulation pattern with two targets on the optical axis (Fig. 6a). With conventional holography and two disk targets, we observed a significant amount of photocurrent when the cell is located between the two targets (Fig. 6b, c), where no photocurrent is desired. Conversely, with 3D-SHOT and two similarly axially separated copies of the CTFP, no photocurrent was observed at the intermediate location, and thus spatial resolution was significantly improved (Fig. 6b, c). In neurons, the added non-linearity introduced by the cell’s action potential threshold further enhanced the axial contrast in terms of spike probability (Fig. 6d, Supplementary Fig. 5, Supplementary Note 5).

Fig. 6 Single-neuron resolution with simultaneous photostimulation of two targets along the axial dimension. a Using CGH or 3D-SHOT we simultaneously photostimulated two targets separated by 80 µm along the optical z-axis. The photocurrent was recorded as a function of the respective displacement Δz between one patched cell and the volume hologram in an example CHO cell (b, n = 11 cells) or in an example cortical neuron (c, n = 5 neurons), with conventional holography (black) and with 3D-SHOT (red). d As in c, but recording spike probability instead of photocurrent for 3D-SHOT Full size image

Addressing arbitrary 3D locations with precise power control

Our results so far establish that 3D-SHOT allows optogenetic activation of neurons with high spatial precision in vivo and can arbitrarily target light in 3D with high spatial resolution. However the major advantage of 3D-SHOT over existing approaches is its ability to simultaneously illuminate many regions of interest located throughout a volume, each at a different axial z-depth. To demonstrate the ability of 3D-SHOT to simultaneously target disc images to 50 unique z-planes, we computed a phase-mask corresponding to a point-cloud hologram with 50 targets placed in a spiral pattern, each with a unique z-position. We measured the two-photon absorption in the vicinity of each targeted spot and in 3D with a sub-stage camera (as in Fig. 2, but repeatedly near each target), demonstrating that 3D-SHOT can illuminate this complex set of 50 targets at 50 separate axial depths (Fig. 7a).

Fig. 7 Power corrected 3D-SHOT simultaneously illuminates 50 spots. a Uncorrected simultaneous 3D-SHOT with a hologram targeting 50 spots in a spiral pattern, occupying 50 individual z-planes. Spots are color coded by normalized 2P absorption in each spot (measured with a sub-stage camera). b Correction factor computed for each spot via 3D power interpolant. c Measurements of 2P-induced fluorescence with 3D-SHOT, and a power-corrected hologram targeting the same locations as in a. d Mean intensity images of power-corrected 50 spot spiral hologram showing (z,y) (top left), (z,x) (bottom left), or (x,y) (right) projection views. e Box plots showing the variance in normalized 2P absorption from each spot within the corresponding hologram before and after power correction (p < 1 × 10−12, F-test of equality of variances, error bars correspond to range, red line is median, n = 50 spots) Full size image

However, we note that while each spot in this 50 region of interest hologram clearly displays a replica image of the CTFP at each targeted point, the total two-photon energy deposited from target to target exhibits a high variance (27%). Precise power control on each target represents a critical challenge for 3D-SHOT, since both the neuronal response and the spatial resolution are related to the stimulation power (Fig. 3). In holographic optical systems such as 3D-SHOT, spatial non-uniformities in the distribution of power are related not only to well-known photon losses throughout the optical system, but also to the SLM’s diffraction efficiency and its ability to accurately render specific CGH patterns.

For precise control of the power distribution across multiple targets, we have developed a model of the diffraction efficiency as a function of target location, and we relied on simulations during hologram computation to compensate for the known spatial dependence of the SLM’s diffraction efficiency. As for additional physical losses through the optical system, we measured the difference between expected and actual received power at 15,000 discrete points randomly distributed throughout our addressable volume (Supplementary Fig. 6). We then generated a 3D interpolant to adjust the weights for each spot in multi-target holograms (Fig. 7b). By combining simulation and experimental calibration data, our system compensates for non-uniform power distributions (Supplementary Note 6). To test the performance of this approach, we re-computed a phase mask targeting the same 50 spots with power compensation and measured 2P absorption as before. The results show a dramatic reduction in the variance (down to 9%) of the 2P absorption in each spot (Fig. 7c−e, p < 1 × 10−12 F-test), validating that 3D-SHOT used in combination with our power correction algorithm can deposit equivalent amounts of energy and achieves spatially precise 2P excitation in at least 50 distinct axial planes.

Control of large volumes with high spatial resolution

To test the ability of 3D-SHOT to accurately target large numbers of spots in a large volume, we measured 3D-SHOT spatial resolution in numerous contexts. We characterized individual spots within multi-target holograms as a function of increasing the numbers of targets, decreasing the distance between targets, propagation through scattering medium, and (x,y,z) position of the target. We generated holograms targeting 20–750 spots spaced 17–135 µm apart, and imaged them through 0–800 µm thick brain slices using high-dynamic range imaging with a sub-stage camera. Using principle component analysis (Supplementary Notes 7, 8), we defined which of these parameters affected the resolution of individual spots within multi-target 3D-SHOT holograms.

The limiting factor for deep brain photostimulation is propagation through brain tissue, where absorption, optical aberrations, and scattering degrade spatial resolution even when operating in the infrared wavelength range. We quantified the effects of optical aberrations on the FWHM by measuring two-photon absorption in 3D through various depths of mouse brain tissue (Supplementary Figs. 7, 8). The effect of scattering on axial resolution was statistically significant after 400 µm (no scatter: 18.1 ± 5.1 µm, 400 µm brain tissue: 19 ± 5.5 µm, p = 7.34 × 10−4, Kruskal−Wallis with multiple comparisons), but the degradation of the PSF did not exceed 1 µm until 600 µm of mouse brain (600 µm brain tissue: 25.2 ± 66 µm). We also observed that performance loss was not only due to a gradual degradation of spatial resolution in deeper layers of the brain, but also to unwanted deposition of energy outside of the desired volume after passing through about 500 µm of brain tissue. This result defines the maximal operating depth for 3D-SHOT and is similar to other two-photon technologies operating in mouse brain tissue with temporal focusing47.

To identify the influence of spatial location and target number on spatial resolution independently of the predominant effect of scattering, we conducted additional experiments without scattering tissue. Increasing the number of spots did not significantly degrade the axial resolution until 750 spots were simultaneously illuminated (Fig. 8a, d: 500 spots vs. 600 spots, p = 0.9, 600 spots vs. 750 spots, p < 3 × 10−5, Kruskal−Wallis with multiple comparisons). However, we observed a gradually increasing level of off-target two-photon absorption for holograms containing more than 400 targets (Fig. 8d). Since the physical location of each target is known a priori, we computed the contrast ratio by quantifying the amount of two-photon absorption in the targeted neuron-sized volumes, divided by the total two-photon absorption in the entire volume of interest. We estimated that the maximal number of targets in a single hologram to be 380–500, assuming 1–5% background illumination. Contrast further degraded as the number of targets was further increased (Fig. 8e). Notably, this decrease in resolution is not a feature of 3D-SHOT per se, but relates to the overall quality of point cloud holograms, which is limited by the pixel density of the SLM that we employed. Using an SLM with a higher pixel count should allow more targets to be encoded before significant loss of contrast occurs.

Fig. 8 Spatial resolution with simultaneous targets throughout a large volume. a−b Example 3D renderings from tomographic images of two-photon absorption from single-shot holograms targeting increasing numbers of randomly distributed spots. The FWHMs of the two-photon response was computed for each target, c radially, and d axially. Results show that spatial resolution and axial confinement are not significantly degraded by increasing the number of simultaneous targets in any given hologram. e The contrast ratio of the holograms was quantified as a function of the number of targets, and shows that contrast, rather than resolution determines the total number of targets that can be photostimulated in a single hologram. f 3D recordings of various scaling of the same point cloud were made to evaluate density as a possible factor affecting spatial resolution (error bars correspond to range, red line is median) Full size image

Furthermore, we also observed that the FWHM depends on the physical location of targets (Supplementary Fig. 9, Supplementary Note 9). We identified target location along the optical axis to be the dominant factor, d(FWHM)/dz = 1.8 × 10−2, which corresponds to known asymmetric geometrical aberrations and magnification properties when attempting to focus light on either side of the natural focal plane of the microscope objective.

We did not observe significant changes in resolution for multi-target holograms as a function of (x,y) position, or as a function of the spacing of spots within a hologram (radial p = 0.17, axial p = 0.29, Kruskal−Wallis with multiple comparisons, Fig. 8f, Supplementary Fig. 9b, d). This independence is bounded by the limiting case in which spots are targeted within one spot-size (specified by the CTFP) of each other, whereupon they constructively interfere and form a continuous area of excitation.

Overall, as with CGH, the performance of 3D-SHOT is limited by either the SLM, the total available laser power, or the microscope system. Altogether, these determine the accessible volume (Supplementary Fig. 4) and the number of neurons that can be simultaneously illuminated with the desired spatial resolution. Here, using an SLM with 600 × 800 pixels, we characterized single shot photostimulation of up to 750 targets (limited by laser power) with degradation of resolution within a 0.034 mm3 volume (350 × 350 × 280 µm, Fig. 8), and improvement of an order of magnitude over previous work using multi-level TF42.

Volumetric optogenetics at high spatial resolution

We next tested the ability of 3D-SHOT to stimulate ensembles of cells distributed in a volume with high spatial resolution. To quantify the PPSF in the context of ensemble stimulation, we generated holograms simultaneously targeting multiple regions of interest distributed throughout the addressable volume and obtained whole-cell recordings from CHO cells while mechanically displacing the multi-target hologram (Fig. 9a). Consistent with direct measurements of 2P absorption, we observed no changes in the lateral (Fig. 9b) or axial (Fig. 9c) PPSF photocurrent FWHM even when simultaneously stimulating 50 regions of interest (p = 0.64 Kruskal−Wallis).

Fig. 9 Spatially precise volumetric optogenetics with 3D-SHOT. a Schematic demonstrating 3D-SHOT stimulation of a CHO cell with a single spot in a hologram targeting multiple spots in the volume. The objective was moved to measure the physiological point spread function via voltage clamp recordings. b Normalized photocurrent and quantification of FWHM as a function of radial displacement for holograms targeting 1–50 spots (data represent mean ± s.e.m. of n = 3 cells, p = 0.39, Kruskal−Wallis test with multiple comparison correction). c As in b but axially (n = 3 cells, p = 0.64). d Schematic showing whole cell recordings in brain slices while stimulating multiple targets. To measure spatial resolution of 3D-SHOT, a series of new holograms was computed that displaced only the center target while holding all other spots stationary. e Photocurrent measurements from brain slices for radial digital offset of a center spot at several stimulation powers (colors, 0.5–2 W), quantification of FWHM as a function of stimulation power through the objective (data are mean ± s.e.m. of n = 5 neurons, p = 0.69, Kruskal−Wallis test with multiple comparison). f As in e but axially (p = 0.11). g As in d, but for in vivo loose patch recordings; example image of a 2P guided patch of a L2/3 pyramidal neuron expressing ST-ChrimsonR-mRuby2 (scale bar = 50 µm). h Radial and axial physiological point spread functions showing resolution of 3D-SHOT while targeting an ensemble of 21 neurons while only the center spot was moved (data represent mean and s.e.m. from an example neuron). i Bar graph showing mean ± s.e.m. of the radial and axial PPSFs from targeted in vivo patch while stimulating 21 cells (n = 17 radial and n = 18 axial). j Scatter plot showing axial FWHM vs. the depth below the cortical surface of individual neurons (axial PPSF is from experiments with 1 or 21 holograms, n = 24). Red dot indicates the mean values, and the black line is the line of best fit—within this range, cortical depth can explain none of the variance in axial FWHM (R 2 = −0.03) Full size image

We next tested volumetric optogenetics resolution in neurons by eliciting photocurrents with a single hologram targeting 21 spots, each in a unique z-plane. Instead of mechanically displacing the objective, we computed holograms where only one target was digitally displaced, and the others held in place (Fig. 9d). This approach directly tests the spatial resolution of the target spot while accounting for contamination from non-target spots. These experiments revealed that off-target spots or general loss of contrast do significantly affect photocurrents (Fig. 9e−f). We repeated this experiment for various average power levels, demonstrating that 3D-SHOT is capable of distributing even very high levels of two-photon light (up to 2 Watts of average power) into spatially confined packets distributed in true 3D throughout a large volume (Fig. 9e−f), and simultaneously (Supplementary Fig. 10).

To validate spatially precise ensemble stimulation in vivo, we used two-photon targeted loose patch in anesthetized mice. As before, we generated holograms that targeted 21 random spots placed throughout a 250 × 250 × 200 µm3 volume, and used the SLM to digitally displace the spot targeting the patched neuron while holding the other spots stationary. In this context, we measured a radial spiking PPSF of 13 ± 2 µm and an axial PPSF of 29 ± 5 µm (n = 18). These values are very similar to measurements obtained with only one hologram (Fig. 4), and are narrower than the resolution recorded in brain slices due to the additional non-linearity of the action potential threshold (Fig. 9g−i). As predicted from measurements of PSFs through scattering brain slices, there was no relationship between the axial resolution and the depth of the neurons from which we recorded (113–323 µm below the pial surface, Fig. 9j).

Finally, we used a simple model (Supplementary Note 9) to assess expected off-target activation during ensemble stimulation using 3D-SHOT. We randomly placed neurons throughout a 400 × 400 × 400 µm3 volume of brain tissue at physiological density48 and superimposed 3D Gaussian fits of our PPSF on randomly selected target neurons. This model revealed that even while targeting 500 neurons, on average, non-target neurons are unlikely to be activated (Supplementary Fig. 11a, b). The number of non-target neurons predicted to be active was only a small fraction of the target number, and increasing the number of spots linearly increased the number of activated non-target neurons, indicating that contrast should remain high past 500 spots (Supplementary Fig. 11c). Finally, most of the expected off-target spikes evoked by volumetric 3D-SHOT stimuli resulted from neurons with low spike probabilities, indicating that few off-target neurons should reliably follow repetitive stimulation of a particular neuronal ensemble (Supplementary Fig. 11d).