High Fidelity Spatial Light Modulator Configuration for Photo-Stimulation

For their capacity to shape optical wavefronts in real time into any desired illumination pattern, phase-only Spatial Light Modulators (SLM) have proven to be powerful tools for optical trapping and micromanipulation applications. SLMs are also becoming increasingly utilized in selective photo-stimulation of groups of neurons in the brain. However, conventional SLM based wavefront modulation introduces artifacts that are particularly detrimental for photo-stimulation applications. The primary issue is the unmodulated light that travels along the 0th order of diffraction. This portion of light is commonly blocked at the center of the object plane, which prevents photo-stimulation in the blocked region. We demonstrate a virtual lens configuration that moves the 1st order diffraction with the desired illumination pattern into the Fourier plane of the 0th order light. This virtual lens setup makes the whole field of view accessible for photo-stimulation and eliminates the need for removing the 0th order light in two-photon applications. Furthermore, in an example application to reconstruct a pattern consisting of an array of points, the virtual lens configuration increases the uniformity of the intensities these points. Moreover, diffraction-induced artifacts are also significantly reduced within the target plane. Therefore, our proposed high fidelity configuration yields target points with high signal to noise ratio.


INTRODUCTION
Optogenetics has brought transformational capabilities to neuroscience: the ability to not only measure but also manipulate the activity of neurons by light targeted at single neurons. This has fundamentally altered how we can address two challenges that are the essence of neuroscience: understanding neuronal connectivity patterns and spatiotemporal patterns of activity in the brain.
Optically measuring the activity of neurons using techniques such as calcium imaging have allowed for powerful, minimally invasive approaches to investigate the neuronal circuitry in the brain [1][2][3][4][5][6]. Since the advent of optogenetics, all-optical approaches have been introduced to carry out both recording and manipulation of neuronal populations [7][8][9][10]. Many global stimulation techniques exist, such as stimulating groups of neurons with banks of LEDs [11]. However, selective targeting of individual neurons with coherent light is becoming more and more popular.
Stimulation of individual neurons with light often does not alter the information flow in the brain in a substantive way. Emerging evidence shows that information in the brain is encoded in the simultaneous or avalanche-like firing of multiple neurons, and that these neuronal groups are usually not direct neighbors [12]. Interrogating these distributed groups of neurons, which collectively process information, requires simultaneous targeting of multiple neurons. This can be achieved by arrays that direct and modulate the intensity of light on a pixel-by-pixel basis such as Digital Micromirror Devices (DMD) [13,14]. DMDs are well suited for targeting multiple neurons in transparent models such as C. elegans, where a single-photon regime is proven effective [15]. However, two-photon infrared microscopy is better suited for non-transparent tissue such as mammalian brains, because of the higher penetration of infrared light, and its quadratic dependence on intensity which results in excitation localized to the focal volume [16]. DMD devices are not an efficient choice for two-photon excitation due to "off" pixels that reflect light away from the sample, effectively wasting laser power. This power is needed for two-photon excitation, due to its quadratic dependence on intensity and therefore requires focusing light into high intensity points. Spatial Light Modulators (SLM) have proven more suitable for such twophoton in-vivo applications due to their ability to modulate the phase of the light, preserving the power of the beam during modulation [17][18][19][20][21][22]. In addition to having higher intensity, phase-only SLMs also allow for the reconstruction of multiple target points in three dimensions [23,24]. However, since SLMs create the desired light field as a 1 st order diffraction pattern from a pixelated phase pattern, they have imperfections and an additional reflected 0 th order light field [25,26]. The 0 th order light is focused in the same plane as the modulated light and can be seen as a bright spot in the center of the image plane in typical SLM based multipoint stimulation systems ( Figure 1A). In neuroscience applications, this would generate additional photo-stimulation at this location, and for optical micromanipulation applications, this creates an inaccessible zone right in the center of the field of view [27]. In addition to this unwanted 0 th order focal point, "ghost patterns" also appear, as shown in an intensity-adjusted image (i.e., displaying the log of intensity) in Figure 1B. These ghost patterns are due to the phase-only nature of many commonly-used SLMs, including the one used in this study, and usually reflect the specific symmetries of the phase modulation pattern. The imperfections have first been noted in other applications of spatial light modulators that are dependent on the exact shape of a light field, such as optical trapping [28][29][30], where force measurements depend on an accurate gradient of light intensity. Ghost patterns also lower the signal to noise ratio for photo-stimulation applications. Figure 1C is the target intensity pattern used for calculating the phase mask, and Figure 1D is the associated phase mask.
Spatial filters are commonly used to block the 0 th order light at the point in the light path where it first comes to focus [17,31]. However, because 0 th order (unmodulated) and 1 st order (modulated) light come into focus in the same plane, it is not possible to block one without the other, i.e., it is not possible to generate points within the blocked region.
Optical designs that are based on higher order diffraction can be used to achieve complete blocking of the unmodulated light without having an inaccessible central region [32][33][34]. However, such designs require filtering out unmodulated light using a slit, which cuts the SLM field of view in half of its original size for binary SLMs. Moreover, less laser power is transmitted through higher order diffraction patterns. Grating-based methods have been developed that utilize SLMs capable of modulating to 4π phase delay, to simultaneously modulate for two phase masks in order to remove the replicated higher orders as well as the 0th order [35]. However, the accessibility of these techniques is somewhat limited due to the popularity of SLMs with a maximum phase modulation of 2π.
Removing the 0 th order from the object plane by axially shifting the focus of the unmodulated light has been suggested using a slightly converging incident beam on the SLM. The modulated light is shaped by the SLM into collimated beam, which focuses in the object plane, whereas the unmodulated beam is focused above the object plane [30]. However, this configuration has limitations. First, because the unmodulated light comes into focus above the object plane, the sample thickness is limited in this approach. Second, because a beam block is implemented in a plane where the modulated light is not collimated, both the phase and amplitude information from the modulated light is obstructed. This results in partially occluded intensity patterns. An alternative approach to limit 0 th order light is through computational removal [36]. This method, which requires calculating a hologram that superimposes and cancels the unwanted intensity, is simple to implement from a hardware perspective, but requires complete characterization of the amplitude and phase components of the 0 th order beam, which is unique to each pattern imposed on the SLM.
Here we address the problem of imperfections and inaccessible regions using a modified beam path with a "virtual" lens added to the calculated holographic pattern which replaces one of the real lenses in the system in the Fourier plane of the incident light. In Optical layout for comparison of the conventional and virtual lens configuration. M1 and M2 are mirrors that steer the beam into the system. The half wave plate (HWP) and polarizer (Pol.) work in concert to pass light to the SLM at its designed polarity. The set of L1 and L2 lenses expand the beam to fill the SLM. M3 and M4 center the beam on the SLM. M5 is a removable mirror that, when in place, reflects the beam to the conventional beam path (cyan) and when removed, allows the beam to pass to the virtual lens beam path (magenta). L3, L4, and L5 are the sequence of lenses that project the illumination pattern on the sCMOS camera on the conventional path, M6 is the mirror that in absence of M5 reflects the beam into the virtual lens beam path and L6 and L7 are the sequence of lenses required to project the illumination pattern on the sCMOS camera. The spatial blocks are placed on the optical axes in the front focal planes of lenses L3 and L6. (B) the ray diagram of the conventional (cyan) and virtual lens (magenta) configurations. The phase masks displayed on the SLM are shown on the left.
Frontiers in Physics | www.frontiersin.org September 2021 | Volume 9 | Article 587112 addition, we show the use of such a configuration in a two-photon application with our custom built two-photon microscope.

OPTICAL DESIGN
To decouple the focal planes of the unmodulated and modulated light, we added an additional focusing lens to the diffraction pattern programmed into the SLM. The SLM is thus programmed to display a modular sum of two phase modulations: the phasemask corresponding to the target intensity pattern and a Fresnel lens. Since only the modulated light is affected by the virtual lens, the beam path is configured such that the modulated light focuses in the Fourier plane of the unmodulated light, and the unmodulated light focuses in the Fourier plane of the modulated light. To compare this novel optical configuration with the conventional configuration we set up a system with optical paths for the conventional and the virtual lens configurations (Figure 2A).
The beam path in cyan shows the conventional configuration and the beam path in magenta shows our virtual lens configuration. The two beam paths were set up to have an identical layout, except that the conventional beam path uses a real lens, L3, after the SLM instead of the virtual lens phase-mask displayed on the SLM (Holoeye LC-R 2500) which was used for the virtual lens beam path. In the conventional beam path, L3 and L4 are placed with a 4-F configuration to image the phase mask containing the phase information in the back focal plane of the imaging lens (L5). A similar 4F configuration is obtained in the virtual-lens path, by using the virtual-lens and L6 couple. As illustrated in Figure 2, the SLM surface projecting the virtual lens is positioned at a F vl + F L6 distance from L6. The conjugated phase mask plane forms at the back focal plane of the imaging lens (L7). Additionally, in the conventional beam path, L3 is placed at its focal length from the SLM and L4 and L5 are placed in 4-F configuration with respect to the intermediate image and object planes to maximize the pupil of the lens system. In the virtual lens beam path, L6 and L7 are placed in 4-F configuration with respect to the intermediate image and object planes so that they play the same role as L4 and L5. For consistency between the two beam paths, L6 and L4 were both chosen to have a nominal focal length of 400 mm and L7 and L5 were both chosen to have a nominal focal length of 500 mm. The focal length of the virtual lens displayed on the SLM was set equal to the nominal focal length of L3, which was 400 mm because the virtual lens and L3 both serve the same function. Figure 2B shows ray diagrams for each of the two beam paths. The unmodulated light is represented in black while the modulated light is shown in cyan in the conventional beam path and magenta in the virtual lens beam path. In the conventional configuration, the unmodulated light focuses to a bright point along the optical axis in the object plane. Traditionally, a spatial block is used at the center of the intermediate image plane to remove this 0 th order point. This spatial block also prevents the modulated light from reaching the center of the image plane (dashed lines). Alignment is performed in a similar fashion as traditional lens alignment. A virtual lens is projected onto the surface of the SLM and L6 is added such that the focal lengths of the SLM and L6 coincide. Collimation can be checked using a shearing interferometer, and fine adjustments can be made by shifting L6 back and forth on an optical table to achieve collimation. A similar effect can also be achieved by changing the focal length of the virtual lens displayed.
The outline of the formed image in the object plane can be traced by an example ray diagram in cyan. The ray diagram for the unmodulated light is shown in gray. Note that the central portion of this image is obstructed due to the use of the spatial block. In the virtual lens beam path, however, the unmodulated light is decoupled from the modulated light and instead of coming into focus as a bright central spot, it is collimated in the intermediate image plane, forming a dim Gaussian background intensity. The ray diagram of the unmodulated light is shown in gray. To remove this background from the object plane, a spatial block with (D 3 mm) can be positioned in the focal plane of L6 (intermediate image plane) where the unmodulated light comes to focus. However, since the modulated light is collimated in this plane and carries only the phase information, the image formed in the object plane remains intact. Subsequently, the field of view of the SLM remains fully accessible. The ray diagram in magenta shows the outline of the resulting image formed in the object plane. As illustrated in the diagram, in contrast to the conventional beam path, the central portion of the image is not blocked.
In order to decouple the two intermediate image planes for unmodulated and modulated light, the SLM displays a modular sum of two phase modulations: the phase-mask computed with the Gerchberg-Saxton algorithm applied to the target intensity pattern and a phase-modulation of a convex lens with a focal length equal to that of L3 (F VL F L3 ). Such an SLM display gives the modulated light the combined phase modulation from these two masks at the same time and causes the image to focus after the SLM, but before L6. The use of a spatial filter in this configuration reduces the intensity of the desired pattern created by the SLM uniformly and proportional to the size of the beam block. The field of view of the SLM remains fully accessible in this configuration as illustrated by the ray diagram in magenta/gray, which shows a 1 st order diffraction image formed in the object plane. To implement this design in a microscope, the optical train and virtual lens should be designed such that the phase mask, rather than the SLM surface is imaged onto the back focal plane of the objective and fill the back aperture, i.e., the back aperture of the objective is positioned at lens L7's back focal plane.

Virtual Lens Makes the Full Field of View Accessible for SLM Optical Stimulation
First we verified the expected effects of the conventional and virtual lens beam paths on the accessibility of the field of view using a Cartesian axis intensity pattern ( Figure 3A) generated by the phase mask in Figure 3B. Figures 3C,D show images of the generated intensity captured at the object planes of the conventional configuration ( Figure 3C) and virtual lens configuration ( Figure 3D) without a spatial block. As expected, the unmodulated light focuses to a point at the center of the image plane in the conventional configuration, while in the virtual lens configuration the unmodulated light has a wide low-intensity Gaussian profile proportional to the light intensity profile of the expanded and collimated laser beam. Figures 3E,F show both configurations with a spatial block. In the conventional configuration light is blocked in a region around the center whose width is proportional to the size of the beam blocker. In the virtual lens configuration, the pattern has uniform brightness, demonstrating that uniform accessibility of the whole field of view is achieved.

Virtual Lens Beam Path Increases Fidelity of Target Points
To compare the intensity pattern generated by the SLM in each beam path, we used an eleven-by-eleven matrix of points as a target illumination pattern. In order to ensure that differences in the SLM-generated intensity patterns from each path are only due to the difference in their optical configurations, spatial filters for blocking the zeroth order of diffraction were not used in either path. A revised version of the Crocker-Grier object-finding algorithm was used to locate the target illumination points in each image. The integrated intensity and standard deviations in major axis lengths were calculated for each generated point and compared between the two beam paths. Figure 4A and Figure 4B show the SLM generated patterns for the conventional and virtual lens beam paths respectively. A logarithmic adjustment was applied to the intensity map. To compare the quality of the points generated by each path, the width of each point was quantified by fitting its intensity profile to a 2-dimensional Gaussian and registering their widths (σ x and, σ y ). The average image of the points in the conventional beam path (excluding the 0 th order) and the virtual lens beam path is shown in Figure 4C (right and left images respectively). Figure 4D shows the distribution of the 2D standard deviation for all generated points. The results indicate that the use of the virtual lens configuration leads to comparably sized points to their counterparts from the conventional beam path, despite the suboptimal Fresnel lens formed by the pixelated array of the SLM. Of note, however, is the increased variance in focal point size in the virtual lens configuration. This could be caused by a modulated point spread function due to a more limited opening angle of the light cone produced by the SLM, an effect induced by the imposition of the lens function [37]. In photo-stimulation applications in neuroscience, uniformity in size is less important due to irregularities in the shape and size of neurons, but uniformity in intensity is of particular importance, due to a desire for low variance in induced photocurrent across multiple channels. Figure 4E shows the histograms of the integrated intensity of all pixels above a fixed threshold in each extracted point. This fixed threshold in turn is set by the general size of the reconstructed points and is the same for the conventional beam path and the virtual lens beam path. The standard deviation of the intensities generated is 29% of the mean intensity in the conventional beam path and 13% in the virtual lens beam path (p 0.025). Therefore, while the points in the conventional and virtual paths have similar mean intensities, the latter are more uniform.

Virtual Lens Creates Fewer and Lower Intensity Ghost Patterns
Another benefit of the virtual lens beam path is its ability to remove undesired ghost patterns from the object plane by displacing them axially into other focal planes. In order to visualize these speckles, Figures 4A,B show examples of the array of points image from the conventional beam path (A) and the virtual lens beam path (B). A logarithmic adjustment was applied to the intensity map. These ghost patterns contribute to the background intensity and they are problematic for precise photo-stimulation as they deliver light to arbitrary locations of the field of view. To demonstrate how these ghost patterns contribute to the background intensity, Figure 4F shows the histogram of the background intensity for the conventional beam path and the virtual lens beam path. The virtual lens beam path yields dimmer background intensity despite having the unfocused unmodulated light in the background. Using a block for the unmodulated light can further reduce this background intensity.
To locate and quantify the ghost patterns in the previously shown dot matrix pattern, features were extracted for a fixed low threshold for the conventional and virtual lens beam path. A total of 607 ghost features were found in the conventional beam path whereas only 72 features were found for the virtual lens beam path. Moreover, to have a measure for the signal to noise ratio (SNR) in both beam paths, we calculated the ratio of the dimmest target point to the brightest ghost feature for both paths. The SNR for the conventional beam path is 1.21 and for the virtual lens beam path is 8.8. Thus, not only does the virtual lens path yield fewer ghost patterns, but it also reduces the peak intensity of the ghost patterns. Since the formation of ghost patterns is dependent on the symmetry of the target intensity pattern, we also measured the ghost pattern intensity for a ring of points, which has a different symmetry than the previous pattern. Using the same threshold as before, 71 ghost features were extracted in the conventional beam path. However, only 25 ghost points were extracted in the virtual lens beam path. The dimmest point was significantly brighter than the brightest ghost pattern for this ring arrangement of points, with the signal to noise ratio of the two at 21.72 and 26.72 respectively for the conventional and the virtual lens beam paths.

Validation of the Virtual Lens Configuration in Two-Photon Application
We have adopted the virtual lens configuration in a custom built two-photon microscope. This microscope consists of one upright microscope (Sutter Instruments) and one inverted microscope that both focus on the same object plane as illustrated in Figure 5A. The virtual lens path uses a Boulder Nonlinear Systems 1536 × 1536 SLM. The system also has a second path that uses a galvo-resonant pair for two photon imaging. No 0 th order blocker is used in our two-photon microscope. The bottom inverted microscope, shown below the sample plane in Figures  5A, is a Nikon TE200 with additional motorized stage and focus drive, connected to a Hamamatsu ImagEM X2 EMCCD set up to perform epifluorescence microscopy and to collect the fluorescent emission from the sample. The camera is equipped with a filter that blocks the 1040 nm illumination (Thorlabs FESH1000). For this demonstration we are using a 20X Olympus Objective with 1.00 NA (XLUMPLFLN20XW) for the top microscope and a 25X Olympus objective with 1.05 NA (XLPLN25XWMP2) for the bottom microscope.
In this system we are able to demonstrate that a virtual lens configuration is compatible with two-photon excitation. A long focal distance virtual lens (F vl 600 mm) is used for two reasons: First, a longer focal distance lens leads to Fresnel fringes that are spaced further apart, limiting the interference with the added phase mask. Second, the higher order diffraction patterns generated by the weaker Fresnel virtual lens will become further spaced apart axially from the first order of diffraction. To show the two-photon excitation capability of the photostimulation path we used a thin, uniform fluorescent sample made by a droplet of 2 mM X-Rhod-1, AM dye in 100% dimethyl sulfoxide (DMSO), sandwiched between two No. 1.5 coverslips in the object plane. We illuminate the sample with a 1040 nm laser modulated with a superposition of a virtual lens and a phase mask that produces a ring of 16 focal points. A sample image of the ring of points as captured by the camera is shown in Figure 5B. This result shows that even in the absence of a spatial block, only the intended target points generate two-photon fluorescence. This demonstrates the suitability of our virtual lens configuration to neuroscience photo-stimulation experiments utilizing twophoton excitation principles [38,39].
Additionally, while ghost patterns are still formed, they occur in deeper planes and thus have reduced impact in many experimental settings, especially those in neuroscience, due to additional absorption and scattering. Below, we demonstrate this axial displacement of the ghost patterns, created by the second order of diffraction, with respect to the target pattern ( Figure 6). Figure 6A shows the target pattern at the object plane (Z 0 μm). The objective is then moved away from the sample until the second order of diffraction comes into focus at Z 40 μm ( Figure 6B). To compare the intensities created in each point, the peak intensity from each point is extracted. Figure 6C shows the distribution of the peak intensities. The first order of diffraction is shown to be approximately 4-fold more intense than the points comprising the second order ghost pattern.

DISCUSSION
Holographic multiphoton stimulation of multiple neurons is emerging as a powerful technique to understand and modulate the operation of the brain. Spatial light modulators are capable of splitting a single laser beam into multiple points, and optogenetics leverages this capability for targeted activation of multiple neurons. Since information flows through interconnected networks of neurons, the ability to selectively activate groups of neurons is critical for understanding brain function. In this work, we have introduced a virtual lens configuration that addresses several limitations of widely used SLM approaches.
First, we separate the focal planes of the unmodulated light from the modulated light such that the unmodulated light focuses in the Fourier plane of the modulated light. This provides significant benefits for studies involving optical stimulation of the brain. The entire field of view in the object plane remains accessible for optical stimulation, and the unmodulated light can be removed without substantial information loss by a spatial  block positioned after the first physical lens. This new capability is critical when aiming to stimulate neurons in vivo, as targeted neurons may be located anywhere in the field of view. Furthermore, it is possible to remove the spatial block without generating a high intensity 0 th order focal point anywhere in the sample volume (the region after L7) since the unmodulated light is collimated after L7. This configuration also improved the uniformity of the targeted points in the field of view. Moreover, we show that the size and shape of the points generated in both paths remain comparable despite the use of a more complex phase modulation in the virtual lens beam path. We also show that our configuration can reduce the number of "ghost patterns" associated with the phase-only property of the utilized SLM. In the conventional configuration the intensity of these ghost patterns can become comparable to the intensity of the targeted patterns for certain pattern symmetries. We show that the ghost patterns created are fewer in quantity when using a virtual lens. These advantages of the virtual lens configuration are essential for photo-stimulation as it expands to target multiple neurons simultaneously in deep layers of the brain.
The increased uniformity will support targeting each neuron in a group with comparable probability, while the reduction of ghost patterns will lower the probability of stimulating nontargeted neurons.
Finally, we show that in two-photon applications, due to the quadratic dependence of absorption probability on light, the unmodulated light will not need to be blocked because it remains unfocused in the imaging volume. This advantage will be most significant for high power lasers that are prone to damaging the beam blocker. It should be noted that shorter focal lengths of the virtual lens may limit the maximum possible lateral deviation and limit the intensity of points far from the optical axis created by the SLM. The strength of the effect increases with numerical aperture of the objective and decreases with increasing resolution of the SLM [37,40]. However, this effect should be relatively negligible at the long focal lengths typically used in two-photon fluorescence microscopy applications.
The virtual lens phase mask has a diffraction efficiency function consisting of a set of on-axis lenses with focal lengths F N F vl N [41,42]. Therefore, one feature of the virtual lens configuration is introducing a shift of diffractive orders along the optical axis. Although this can potentially reduce the general diffraction efficiency, it also reduces the effects of ghost patterns in the object plane. As previously shown in our experimental configuration, when tested in a non-scattering medium, the ghost patterns from the second order of diffraction appear 40 microns deeper and are a factor of four dimmer than the first order of diffraction ( Figure 6). In neuroscience applications, this increased depth of focus of higher order patterns significantly reduces their adverse impact. Prior studies have shown that in the highly scattering media of brain tissue, this axial shift would reduce two-photon absorption exponentially with depth, thus greatly reducing ghost effects. This would result in a factor of approximately 2.5 more attenuation in our case [43][44][45], resulting in a corresponding increase in the signal to noise ratio.
One additional caveat is dispersion when the virtual lens configuration is used e.g., with ultra-fast lasers in multiphoton applications. The SLM diffraction is wavelength dependent, and thus the virtual lens will focus light with some axial separation by wavelength (worse than what can be achieved with dispersion compensated lenses) [37]. The strength of this effect is inversely related to the pulse width of the laser used and will be most apparent with ultrashort and supercontinuum lasers. This effect could be harnessed for temporal focusing, when used with a static diffraction grating [46].
The virtual lens configuration introduced here only requires small changes to hardware and software. On the optics hardware side, the virtual lens configuration requires the removal of one lens, the corresponding shortening of the beam path, and allows for the removal of the beam blocker for unmodulated light. On the software side the virtual lens configuration entails a change in the calculation of the SLM phase pattern to include a virtual lens. Both changes are straightforward to implement and thus these powerful benefits should be accessible to users of many commercial systems in the field of neuroscience.

DATA AVAILABILITY STATEMENT
The raw data supporting the conclusion of this article will be made available by the authors, without undue reservation.

AUTHOR CONTRIBUTIONS
SA designed the single photon and two-photon photostimulation optical setup, led analysis effort and drafted the manuscript. SA and PA co-designed and built the custom two-photon microscope. MW carried out the single photon experiments and contributed to analysis and drafting the manuscript. GAF contributed to workflow design, WL designed the experiment and analysis workflow and edited the manuscript.

FUNDING
Work supported by the BRAIN initiative grants U01NS090569 and 1U19NS107464.