Hardware Setup
OPTOGENETIC HARDWARE SETUP
Optogenetics in Cardiogenic Control: a micro-LED mounted to a wearable vest [ PDF]
Hsueh B, Chen R, Jo YJ, Tang D, Raffiee M, Kim YS, Inoue M, Randles S, Ramakrishnan C, Patel S, Kim DK, Liu TX, Kim SH, Tan L, Mortazavi L, Cordero A, Shi J, Zhao M, Ho TT, Crow A, Yoo ACW, Raja C, Evans K, Bernstein D, Zeineh M, Goubran M & Deisseroth K. Nature, 615, p292–299 (2023)

We developed a noninvasive and optogenetic pacemaker for temporally precise, cell-type-specific control of cardiac rhythms of up to 900 beats per minute in freely moving mice, enabled by a wearable micro-LED harness and the systemic viral delivery of a potent pump-like channelrhodopsin.
Wearable optical pacemaker hardware
Custom-made wearable optical stimulators were constructed using 3 × 4.5 mm 591-nm PC Amber Rebel LEDs (Luxeon LXM2-PL01-0000). 30AWG flexible silicone wire (Striveday) was soldered to the LED pad and coated with electrically insulating, thermally conductive epoxy (Arctic Alumina), and adhered to copper sheet cut to 10 × 15 mm for thermal dissipation and subsequently glued to a fabric vest designed for freely moving mouse behaviour (Coulbourn A71-21M25). Wiring was held in place on the vest using hot glue and the free ends were inserted into a breadboard for stimulus control by an LED Driver (Thorlabs LEDD1B T-Cube). The optical power was set to 160–240 mW mm−2 measured from the surface of the LED. Light was delivered at intervals consisting of a 10-ms pulse width at 15 Hz (900 bpm) for 500 ms with 1,500 ms OFF time by using either a Master-8 or an Arduino microcontroller synchronized to behaviour recording software. Computer-aided design schematics were created with Onshape. Thermal measurements were performed using a FLIR C2 Compact thermal camera (FLIR) and the thermal profile at the surface of the micro-LED is plotted in Extended Data Fig. 4C.
Voltage imaging of hippocampal dynamics during virtual reality behavior [ PDF ]
Fan LZ, Kim DK, Jennings JH, Giocomo L, Cohen AE, Deisseroth K. Cell, 186, 543–559 (2023)

Holographic structured-illumination voltage imaging (red), micromirror-patterned optogenetic stimulation (blue), and VR rig (cyan and gray)
Optical system
The optical system combined a voltage imaging microscope with a two-photon microscope (Bruker, Ultima). Voltage imaging paths were guided into a Bruker two-photon microscope body via a folding mirror, along with a short-pass dichroic (AVR optics, FF880-SDI01-T3-25X38) to combine with the two-photon beams. Several modifications were made to the voltage imaging microscope.
1. Red laser path
A red laser (CNI Inc., MLL-FN-639, λ = 639 nm, 1000 mW single transverse mode) was attenuated with a half-wave plate and polarizing beam splitter, expanded to a collimated beam of ∼42 mm diameter, then projected onto the surface of a reflection-mode liquid crystal spatial light modulator (BNS) as with the macroSLM73 with a resolution of 1536×1536 pixels. Polarization of the beam was set with a zero-order half-wave plate. Zero-order diffraction was blocked by a custom anti-pinhole comprised of two magnetic beads (K&J Magnetics, D101-N52) on each side of a glass slide (VWR, Menzel Glaser, 630–2129), placed in a plane conjugate to the sample image plane. The SLM was re-imaged onto the back-focal plane of the objective via a series of relay optics and the Bruker two-photon microscope. Objective lenses were a 25× water immersion objective with numerical aperture 1.05 (Olympus, XLPLN25XWMP2), and a 25× water immersion objective with numerical aperture 1.00 (Leica, HC IRAPO L 25x/1.00 W motCORR). A mechanical shutter blocked the red laser between data acquisitions and a series of OD filters were placed after the red laser for modulating intensity.The SLM device was controlled by custom software. A user specified area for the SLM to target by drawing on a wide-field epifluorescence image or a 2P fluorescence image. To reduce motion artifact, illumination targeted to somas were used in majority experiments where motion artifacts were observed. The SLM phased pattern was calculated using the Gerchberg-Saxton algorithm. Red laser intensity was ∼ 2.5 – 3 mW per cell for in vivo imaging.
2. Blue laser path
A blue laser (Coherent, Obis series, λ = 488 nm, 150 mW) was expanded to a collimated beam of ∼17 mm diameter, then projected onto a digital micromirror device with a resolution of 1024 x 768 pixels (DMD, Vialux, V-7001 VIS). The patterned blue beam was combined with the patterned red beam via a dichroic mirror. The DMD was re-imaged onto the sample at a magnification such that one DMD pixel corresponded to 0.88 μm in the sample plane. The DMD optical system enabled patterned blue light stimulation across a field of view of ∼670 x ∼890 μm.
3. Wide-field fluorescence imaging path
The image was relayed from the objective to the camera via a series of three lenses including the tube lens inside the commercial Bruker two-photon microscope. Fluorescence was collected on a scientific CMOS camera (Hamamatsu ORCA-Fusion). The final magnification of the optical system was 12.5, corresponding to 0.52 μm in the sample plane per camera pixel. Fluorescence from the sample was separated from the blue and red excitation beams via a dichroic mirror (Di03-R405/488/561/635-t3-40x55). An emission filter (Semrock 635 nm long-pass, BLP01-635R-25) further separated somQuasAr6a fluorescence from scattered excitation light. An IR-blocking emission filter (Semrock, BSP01-785R-25) was placed for blocking scattered infrared excitation light. All movies are acquired at 1 kHz. To image at 1 kHz, the camera region of interest (ROI) was restricted to typically 200 rows, centered on the image-sensor midline.
4. Contralateral fiber stimulation path
For optogenetic modulation of CA2/3, a 594 nm laser (Hubner, Cobolt Mambo series, λ = 594 nm, 100 mW) was focused into a multi-mode optical fiber (Thorlabs, RJPSL4) and coupled into a 200 μm core diameter, 0.39 NA, 3 mm optical fibers (Thorlabs, FT200EMT) implanted over CA2/3. For optogenetic activation and inhibition, 1.4 – 3.2 mW at the 200 μm fiber cannula tip was used. This corresponds to 45 – 102 mW/mm2 at the 200 μm fiber cannula tip, and ∼2.8 - 6.4 mW/mm2 at the 400 μm depth around the target cells.
5. Control software
The entire setup was controlled by custom software written in LabView. Interfacing was via a National Instruments DAQ (NI cDAQ-9178). The software contained routines for registration of the DMD, SLM, 2P microscope coordinates to the camera via affine transformations.
COSMOS macroscope for the cortical window [ PDF ]
Kauvar IV, Machado TA, Yuen E, Kochalka J, Choi MS, Allen WE, Wetzstein G, Deisseroth K. Neuron, 107(2), p351-367 (2020)

COSMOS macroscope and lenslet array. Raw macroscope data contain two juxtaposed images focused at different depths (offset by 620 mm).
Optical implementation
The COSMOS macroscope uses a 50 mm f/1.2 camera lens (Nikon) as the main objective. It is mounted on a 60 mm cage cube (Thorlabs LC6W), which was modified to be able to hold a large dichroic (Semrock FF495-Di03 50mm x 75mm). It is also possible, though not optimal, to use an unmodified cage cube with a 50mm diameter dichroic. Illumination is provided by an ultra-high power 475 nm LED (Prizmatix UHP-LED-475), passed through a neutral density filter (Thorlabs NE05A, to ensure that the LED driver was never set to a low-power setting, which could cause flickering in the illumination), an excitation filter (Semrock FF02-472/30), and a 50mm f/1.2 camera lens (Nikon) as the illumination objective. An off-axis beam dump is used to capture any illumination light that passed through the dichroic. The detection path consists of an emission filter (Semrock FF01-520/35-50.8-D), followed by a multi-focal dual-lenslet array which projects two juxtaposed images onto a single sCMOS camera sensor (Photometrics Prime 95B 25mm). The approximate system cost was $40,000 USD, where the Prime 95B camera was ∼$30,000. Raw images collected by the COSMOS macroscope contain sub-images from each lenslet, each focused at a different optical plane. The camera has a particularly large area sensor with a 25mm diagonal extent. The lenslet array is fabricated by mounting two modified 25mm diameter, 40mm focal length aspherized achromats (Edmund Optics #49-664) in a custom mount (fabricated by Protolabs.com CAD file provided upon request). To maximize light throughput as well as position the optical axis of the two lenslets such that the two images fit side-by-side on the sensor, 7.09 mm was milled away from the edge of each lenslet (using the university’s crystal shop). The mount was designed to offset the vertical position and hence the focal plane of each lenslet by a specified amount - in our case 600μm. The mount was further designed to position the camera sensor at the midpoint between the working distance of each lenslet. A small green LED (1mm, Green Stuff World, Spain) was placed close to the primary objective such that it did not obstruct the image but was visible to the sensor and was synchronized to flash at the beginning of each behavioral trial. We measured the point spread function of each sub-image using a 10 μm fluorescent source; the focal planes were offset by 620 μm, close to the designed 600 μm.There were a number of factors contributing to this final system design, which we describe here.
First, based on our simulation analyses in Figure S2, we determined that a multi-focal approach would yield the highest signal-to-noise ratio (SNR) across the target field of view. In particular, a dual-focal design best leveraged all of the light passing through the main objective, achieving a balance between increasing the total transmitted signal from each neuronal source and keeping the signal from each source compact. Although one obvious approach to increasing the depth of field of an imaging system is to simply close down the aperture, this comes at the cost of reducing the light throughput, SNR, and maximum spatial resolution of the system (Brady and Marks, 2011). Such a trade-off has spurred the development of multiplexed computational imaging approaches for extending the depth of field while maintaining high SNR. Computational imaging yields performance advantages specifically when the average signal level per pixel is lower than the variance of signal-independent noise sources, such as read noise (Cossairt et al., 2013). In particular, multiplexing approaches begin to fail when the photon noise of the signal overwhelms the signal-independent noise (Schechner et al., 2007; Wetzstein et al., 2013). As shown in Figure S2, our imaging paradigm falls within the regime where computational imaging ought to be beneficial. In particular, this is due to the bright background from autofluorescence and out-of-focus fluorescence that adds significant noise to the neuronal signal. We thus took inspiration from a number of computational imaging techniques to develop an approach suitable for the requirements of our preparation: large field of view, microscopic resolution, high light-collection, high imaging speed, and minimal computational cost. In particular, there exist a number of potentially applicable extended depth of field (EDOF) imaging techniques, including use of a high-speed tunable lens (Liu and Hua, 2011; Wang et al., 2015), multi-focal imaging (Abrahamsson et al., 2013; Levin et al., 2009), light field microscopy (Levoy et al., 2006), and wavefront coding (Dowski and Cathey, 1995). While these techniques extend the depth of field, they require deconvolution to form a final image, which is computationally expensive and, as demonstrated later in our noise analysis, also provides a lower SNR for shot noise-limited applications such as our own. Additionally, further analyses of these techniques have demonstrated that the performance of any EDOF camera is improved if multiple focal settings are used during image capture (Brady and Marks, 2011; Hasinoff et al., 2009; Levin et al., 2009). We thus decided to pursue a multi-focal imaging approach and to design our system such that post-processing did not require a spatial deconvolution step.
Second, we found that the maximum illumination power is limited, and it was therefore essential to optimize the light throughput of the detection path in order to achieve maximum SNR. We found empirically that there was a maximum allowable illumination power density: continuous one-photon illumination intensity of around 500 mW/cm2 yielded adverse effects on the mouse, including an enhanced risk of blood vessel rupture. Thus, indeterminately turning up the illumination power to increase signal is not an option, even if ultra-bright light sources exist.
Third, we require high image quality across a large, centimeter-scale field of view. When paired with the light throughput requirement, this means the optical system must have high etendue; without the use of large and extremely expensive custom optics, it is difficult to simultaneously maintain image quality and prevent light loss when passing the image through relay optics. We thus preferred designs that minimized the number of optical components in the detection path. In particular, rather than demagnifying an image onto a smaller camera sensor, we gained flexibility by using a large area sensor. Furthermore, it was also problematic to use a beamsplitter approach followed by relaying images to separate cameras, in terms of light throughput, image quality, and data acquisition complexity. Not only is a multi-camera beamsplitter approach costly and complex, but the beamsplitter approach is worse than the lenslet approach: in this setup, each image from the beamsplitter shares light that passed through the same central region of the aperture of the main objective; on the other hand, each lenslet image uses light that passed through one of two non-overlapping regions of the aperture of the main objective. Thus, for a given depth of field of each sub-image, and consequent f/# of either the lenslet or post-beamsplitter relay optics, each lenslet image will receive twice as much light as compared with the each beamsplitter image.
Finally, because the lenslets themselves are physically large, we needed to be wary of aberrations (geometric and chromatic) induced by the lenslets. For microlenslets, this is less of an issue and is often ignored. The easiest, most cost-effective, and most reproducible way to fabricate high performance lenslets is to leverage the design of commercial off-the-shelf aspherized achromats. We found that with minor machined modifications to existing optics, it was possible to produce lenslets with the right physical dimensions while maintaining the high performance associated with aspheric optics. In the end, our image quality and light throughput of each lenslet image was on par with an image from a simple macroscope with equivalent aperture-size (as shown in Figure 1G, H); the multi-focal design is thus uniformly better than the conventional approach. Note that to generate Figure 1H, we manually merged the two focally offset sub-images (in Photoshop, Adobe). This was the only instance in which we ever needed to merge the image data; for all other processing, we processed each sub-image separately and then merged the extracted neural sources.We characterize the resolution of our system in Figure S2N, and we find it to be sufficient for our application. The resolution of the system would likely be improved with smaller pixels; at the time of development, the only sCMOS camera available with a large enough sensor and fast enough framerate had 11 μm pixels, which with the magnification of our system yields pixels that sample from 13.75 μm in the specimen. However, the current resolution is likely acceptable for a number of reasons. First, cortical neuron somas are around 10-20 μm in diameter; with scattering, the point spread function of each neuronal source is further enlarged. Second, our current labeling strategy also labels dendrites, which serves to further increase the spatial spread of each source. Third, although an increased resolution could potentially help in distinguishing nearby sources, because of scattering it is unlikely that a slightly increased resolution would fundamentally change the data. Fourth, an increased resolution would lead to larger dataset sizes and consequent processing times without a concomitant increase in capability.
Nevertheless, future improvements in the design will likely harness increased resolution. In particular, the most immediate improvements to the system could be achieved by using a custom primary objective with larger numerical aperture, or a camera with a larger or higher resolution sensor. Additionally, use of structured illumination is a viable route for potentially reducing the effect of scattering and for increasing the ability to discriminate between nearby sources.
Custom Multi-photon 3D imaging and optogenetic Stimulation Microscope (MultiSLM) [ PDF ]
Marshel JH, Kim YS, Machado TA, Quirin S, Benson B, Kadmon J, Raja C, Chibukhchyan A, Ramakrishnan C, Inoue M, Shane JC, McKnight DJ, Yoshizawa S, Kato HE, Ganguli S, Deisseroth K. Science, 365;558 (2019)

MultiSLM was designed as an optical hardware solution for spatially specific >kHz targeting of any of the thousands of neurons located throughout a three-dimensional (3D) volume of tissue. While imaging neural activity (e.g., fluorescent activity reporter), simultaneous photostimulation (e.g., with optogenetics) of user-specified targets is possible—both at high spatial resolution (< 1 μm lateral). One to hundreds of diffraction limited spots can be generated in precise locations, simultaneously (within < 1 ms), using holograms generated by combining high peak power lasers with an array of several customized, high-resolution spatial light modulators (SLMs) which are controlled by custom computational hardware and software. In addition to enhancing the individual performance of an SLM, the MultiSLM approach presented here utilizes multiplexing of multiple optical beams to gain additional utility beyond a single SLM device.
All-optical physiology microscope design and characterization
As described in detail below, the all-optical (read/write) microscope used in this manuscript was optimized to address neural ensembles distributed over large volumes beyond millisecond temporal precision for the first time. Achieving these biologically-important specifications required development and optimization of several components, including an entirely new, highpixel-count, fast spatial light modulator (SLM) with new electronics and software interfaces (MacroSLM), new multiplexing strategies (MultiSLM, Figs. S4-8), and a unique pairing with a three-dimensional (3D) imaging strategy during head-fixed mouse behavior. In prior work, when realizing all-optical physiology using SLMs at high spatial resolution (e.g., NA > 0.4), the addressable targeting volume has thus far been significantly constrained relative to the available imaging volume due to a ceiling on the number and size of available pixels provided with current commercial devices. Furthermore, generation of new ensemble-targeting hologram patterns using near-infrared wavelengths has been limited in overall refresh rate by the SLM response time and the stimulation durations required by previous multi-photon optogenetic opsins and protocols (see, for example, refs (24–26, 32, 61)). This has restricted the ability to write in activity patterns at fundamental biological timescales (~1 ms) over volumes spanning several cortical layers and whole brain areas in the mouse (~0.5-1mm spatial scale). Therefore, we sought a solution where the addressable optogenetic volume meets or exceeds the volume available for imaging, potentially spanning multiple functional areas/volumes across cortical layers—and developed a hardware and biological interface allowing millisecond-level precision of ensemble stimulation during behavior.
MacroSLM: To achieve the frame rates, trigger responsiveness, and 3D field of view used in this work, we designed and built a custom liquid crystal on silicon (LCoS) spatial light modulator (SLM). The MacroSLM achieves 500 Hz hologram-to-hologram frame rate at λ = 1064 nm at 85% diffraction efficiency (Fig. S4E). The square 1536 x 1536 pixel array was selected to provide near uniform 2P excitation efficiency and low chromatic dispersion across the transverse dimensions of the sample at high numerical aperture (NA) (Fig. S4A,B) and employs high-voltage (0-12V analog) pixel addressing, and carefully-timed transient voltages (also known as overdrive (62)), for increased liquid crystal (LC) response speed, requiring development of new driving electronics. In addition, a built-in water-cooled, copper heat sink allows temperature control for the LC to operate at a fixed temperature where LC viscosity is low, thereby improving the maximum refresh rate, while adjusting automatically for illumination- and data-throughput-related heating effects.
MacroSLM optimization for three dimensional fields of view: Achieving a large addressable field of view with high spatial precision was a key driving force behind the design of the MacroSLM, influencing the choice of pixel count and pixel size. Pixel count determines the addressable holographic field of view of the microscope when the magnification of the optical system is fixed to image the SLM onto the pupil of the objective lens. The MacroSLM 1536 x 1536 pixel array provides a theoretically addressable field of view of >> 1mm at high NA (> 0.4) when using appropriate relay optics and microscope objectives (i.e. a total magnification of 0.469x into the pupil of an Olympus 10x/0.6NA objective, Fig. S4A) We designed the SLM with a relatively large 20 µm pixel pitch to achieve several advantages over smaller pixels. The large pixel pitch makes the effect of fringing fields small and minimizes interpixel cross-talk ((63) that would otherwise act like an unwanted low-pass filter on the pattern that the SLM displays). This allows the SLM to maintain high diffraction efficiency (DE) at large steering angles, including when generating large numbers of excitation spots. The resulting large 30.7 x 30.7 mm array allows the input beam to be spread over a large square area which, along with internal light shielding layers, aids peak power handling. The large pixel pitch was also chosen for several important reasons: it enables large voltage swings (here 0-12 V analog), which in turn increases hologram transition speed; it is sufficient to store enough charge (178 fF) to hold the electric field across the liquid crystal while it is switching patterns; and it provides an extremely high fill factor since the active pixel (19.5 μm width) is much larger than the gap between the pixel pads needed to prevent shorting (0.5 μm). Ultimately, fill factor determines the DE ceiling of the device, with DE = (fill factor)*2 x pixel reflectivity, or theoretically for this device (0.96)*2 x 0.95 = 0.88. This high DE improves overall efficiency of the system while minimizing potential artifacts from non-diffracted light. Also, achieving this DE value through realizing a high-fill-factor obviates the need for a dielectric mirror coating, which is typically used to increase DE, but dielectric mirrors increase the chances of unwanted optical artifacts and are associated with decreased LC response time. Lastly, larger pixels will be responsible for minimizing the lateral chromatic aberration inherent to using the SLM as a diffractive optic when addressing large fields-of-view (maximum deflection angle is 1.4°) and therefore improve the relative efficiency for multi-photon excitation at the focal spot (64). Our calculations indicate that when using the fixed-wavelength ultrafast laser source reported herein (Coherent Monaco 1035-80-60 at λ = 1035nm) at a pulse-width (sech2 ) of Δ𝑡 ൎ 300𝑓𝑠 (spectral width of 4.5 nm), a maximum chromatic shift of only +/- 0.64 𝜇𝑚 would be present at the maximum diffraction angles necessary to address the full-width of the scanned imaged plane (reported herein to be 710𝑥710𝜇𝑚 with a Nikon 16x/0.8NA objective and 1020𝑥1020𝜇𝑚 with an Olympus 10x/0.6NA objective).
MacroSLM liquid crystal speed response: High-voltage (0–12 V analog) pixel addressing makes the LC response fast, along with the use of high transient voltages (also known as “overdrive”, see ref (62)). ‘Phase wrapping’ was implemented for each pixel to shorten the distance in phase between phase values in time. We also maintain the LC temperature with the use of backplane Peltier heating/cooling, allowing the device to operate at a temperature (45°C) where LC viscosity is low while also adjusting for the varying heating effects of high-power laser illumination. We optimized the SLM thickness for the use of overdrive at our NIR (~1064 nm) target wavelength, and for maintaining full ≥ 2π phase modulation.
MacroSLM data handling: Data handling is another significant aspect for increasing speed, since the system must be capable of calculating the required transient voltages to achieve fast LC switching from phase to phase at each pixel, while loading the transient 1536x1536 images onto the SLM pixels at ~1250 Hz continuous frame rate. We use a custom field-programmable gate array (FPGA) solution for handling these high data rates, including on-board storage of 2045 images, on-board application of spatially-varying voltage calibrations, and on-board calculation of individual transient voltages for every pixel. The driver board receives data over a PCIe interface to a Xilinx Kintex-7 primary FPGA. This FPGA distributes the data to 8 secondary Kintex-7 FPGAs using the Xilinx Aurora high-speed serial interface. Each secondary FPGA is capable of performing the overdrive processing for, and supplies the data to, its own section of the SLM (this feature was not yet available for data collected in this manuscript; overdrive frames were precomputed and loaded into the on-board storage for these experiments). The primary FPGA also contains a Microblaze soft microcontroller that performs a number of additional functions, such as loading certain parameters over I2C, temperature monitoring, and automatic safety-shutdown for both the driver board and SLM head. Interruptible image downloads mean that new holograms can be triggered at arbitrary rates exceeding 1 kHz (rather than at integer multiples of the SLM’s base refresh rate), without missing triggers. For integration into precisely timed and synchronized experiments, the high-speed triggering system instructs the SLM to transition to the next commanded hologram with low latency and jitter. The latency between a trigger arriving and the voltage changing on the SLM is 6 µs with a range of 3-9 µs, so that the transition to a new hologram can be very predictably initiated. We developed a MATLAB-based software development kit (SDK) to interface with the SLM. Under these conditions, we could trigger and transition between different holograms at 330-500 Hz with 85-100% target hologram efficiency (Fig. S4E).
All-optical physiology microscope design: We developed a custom MultiSLM photostimulation path that was integrated into a commercial multi-photon imaging microscope including a resonantscanner imaging path and piezo-coupled microscope objective holder (Bruker Nano Surfaces Division, Ultima, Middleton, WI). We developed custom optical elements and opto-mechanics, alongside commercial elements when possible, to integrate the optogenetic stimulation path, including the multiple SLMs, into this microscope. The optical path was modeled in both Zemax OpticStudio (Zemax LLC, Kirkland, WA) and MATLAB (The Mathworks, Natick, MA) and optimized to maximize the field of view at the full available back aperture of the microscope (Fig. S4A, B). Integration is realized via a two-position drop-down mirror located before the existing uncaging galvanometer unit of the microscope. For the imaging light path, a tunable-wavelength femtosecond pulsed light source is utilized (Coherent Chameleon Ultra II, 𝜆௧௬. ൌ 920nm, Santa Clara, CA). For the optogenetic stimulation, a fixed-wavelength (𝜆 ൌ 1035nm) femtosecond pulsed light source (Coherent Monaco 1035-80-60, Santa Clara, CA) is used at a user-selected 10 MHz pulse repetition rate. The integrated gate and power-modulation signals of the optogenetic laser were utilized to guarantee zero residual optogenetic-laser illumination on sample. An optical switch (Conoptics LTA360-80 with 302RM driver) (OS, Fig. 2A) is used to selectively direct the optogenetic stimulation light towards two alternative paths at 200 kHz temporal resolution, each path with a dedicated SLM. Each path has a 20x beam expander (Thorlabs GBE20-B) (BE, Fig.2A) and a custom pair of turning prisms (Edmund Optics, 36º-54º-90º prism, NIRII coated, PN 913418) (TP1 and TP2, Fig. 2A, see also Fig. S7A-E) to maintain a compact footprint, thereby minimizing mechanical drift issues as well as facilitating simple beam alignment by keeping the optics at 90° angles (Fig. S7D). One light path requires a pair of half-wave plates (Thorlabs WPH20ME-1064) (HWP, Figs. 2A and S7D) in order to maintain optimal polarization alignment through the turning prisms, the SLM liquid crystal alignment layer and the beam combining polarization cube (Thorlabs PBS513) (PBS, Fig. 2A). A custom optical relay (Special Optics 54- 44-783 AR-coated doublet and 54-8-750 AR-coated triplet) (RL1 and RL2, Fig. 2A) was designed to de-magnify the SLM active area at a 5:1 ratio, matching the SLM size to the clear aperture of the dedicated optogenetic galvanometers (OGS, 6 mm clear aperture, Fig. 2A) mounted within the commercial multi-photon microscope. This relay was optimized to correct for chromatic aberration, field curvature and distortion. To block residual DC signal from the un-diffracted optogenetic beam off the SLMs, a pair of magnets (D101-N52, K&J Magnetics, Inc, Pipersville, PA) are mounted to each side of a glass cover slip (Fisher Scientific, 12-546-2) and placed in the intermediate image plane of the microscope (located between the two lenses of the SLM relay, BB, Fig. 2A). A majority of the optogenetic optical path resides on custom 3D printed optomechanics which facilitates alignment and improves compactness as well as total costs (Fig. S7F, for individual mechanical parts the files are available through contacting the authors). The optogenetic galvanometers (OGS, Fig. 2A) are utilized to generate the temporal spiral raster scans which trace the SLM-diffracted beamlets across the neuron cell body membranes. The optogenetic and resonant-imaging beams are combined by a dichroic notch filter (Semrock NFD01-1040) (DC, Fig. 2A). After both beams are combined, they pass through the commercial scan lens, tube lens and emission filter (SL, TL, and FLTR_EM, respectively, Fig. 2A) before reaching the microscope objective. Axial scanning during image acquisition was realized with a 1 mm-throw piezo-coupled microscope objective (objective for 3D scanning: Nikon 16x/0.8NA (16XLWD-PF), whereas the objective for 2D imaging: Olympus 10x/0.6NA). Optical fluorescence emission is collected by the appropriate microscope objective (OBJ, Fig. 2A) and redirected via the emission filter to a collection lens and a pair of PMTs (PMT1 and PMT2, Fig. 2A) which collect the red and green fluorescence channels (523/70nm and 627/73nm).
For more details, please refer to the Supplementary Materials.
Widefield OEG for Global Representations of Goal-Directed Behavior [ PDF ]
Allen WE, Kauvar IV, Chen, MZ, Richman EB, Yang SJ, Chan K, Gradinaru V, Deverman BE, Luo L, Deisseroth K. Neuron, 94(9), p891-907 (2017)


Two-photon imaging and behavioral setup and triple-transgenic strategy for tTA-amplified expression of GCaMP6f in VGluT1+ excitatory neurons throughout the brain. Surgical preparation to record single-cell activity from across cortex.
We develop and apply methods for cortex-wide Ca2+ imaging in mice performing decision-making behavior and identify a global cortical representation of task engagement encoded in the activity dynamics of both single cells and superficial neuropil distributed across the majority of dorsal cortex.
Widefield imaging
Mice were anesthetized with isoflurane, the scalp was removed, skull cleaned and dried, and custom head-plate was cemented to contacts over the cerebellum and in front of the olfactory bulb. The skull was then covered in a thin layer of cyanoacrylate glue (Apollo 2000, Cyberbond), clear dental acrylic (Ortho-Jet, Lang Dental), and clear nail polish (Electron Microscopy Services) (Guo et al., 2014). Buprenorphine (0.1 mg/kg) was injected subcutaneously at end of surgery. Mice were given > = 1 wk recovery before experiments. Imaging was performed on a custom-built fluorescence macroscope designed for high light collection efficiency and large field of view. The macroscope consisted of back-to-back 50 mm f/1.2 camera lenses (Nikon), separated by a FF495-Di03-50.8-D dichroic mirror (Semrock), mounted in a 60 mm cube (Thorlabs). An F-mounted ORCA Flash 4.0 (Hamamatsu) was used to record images, with a FF01-520/35-50.8-D emission filter (Semrock). Alternating 410nm and 488nm illumination for non-calcium dependent artifact removal was controlled using a microcontroller (Arduino) slaved to the frame output trigger of the camera.
Simultaneous fast measurement of circuit dynamics at multiple sites [ PDF ]
Kim CK, Yang SJ, Pichamoorthy N, Young NP, Kauvar I, Jennings JH, Lerner TN, Berndt A, Lee SY, Ramakrishnan C, Davidson TJ, Inoue M, Bito H & Deisseroth K. Nature Methods, 13, p325-328 (2016)


(a) Schematic of the microscope used for simultaneous FIP Ca2+ recordings. The diagram at the lower left shows the time-division multiplexing scheme for simultaneous imaging of GCaMP6 at 470 nm and 410 nm (f) Schematic of surgery and recording setup for VTA-DA projection imaging.

(a) Schematic of dual-color imaging surgery (e) Schematic of combined imaging and optogenetics surgery
The main FIP platform consists of a wide-field microscope capable of imaging a bundle of one or more (up to seven in our case) fiber faces, with a series of dichroic mirrors integrated into the microscope to simultaneously couple in excitation light sources of various wavelengths. Custom MATLAB (Mathworks) routines are used to control the timing of the different excitation light sources, to synchronously acquire camera frames and to digitally sum and compute the total fluorescence from each of the fibers in each camera frame in real time. The excitation light sources, dichroics and acquisition-timing protocols can be reconfigured to support the concurrent acquisition of isosbestic control signals, combinations of dual-color recording, and simultteous recording and stimulation.
Core FIP setup
A custom patchcord of seven bundled 400-μm-diameter 0.48-NA fibers (Doric Lenses) was used to collect fluorescence emission. One end of the patchcord terminated in an SMA connector (Thorlabs, SM1SMA) mounted at the working distance of the objective, and the other end terminated in seven individual 1.25-mm-diameter stainless steel ferrules. These ferrules were coupled via ceramic sleeves (Thorlabs, ADAL1) to 1.25-mm-diameter ferrules implanted into a mouse. The bundled fiber faces were imaged through a 20×/0.75-NA objective (Nikon, CFI Plan Apo Lambda 20×) through a series of reconfigurable dichroic mirrors. Fluorescence emission from the fibers passed through a 535-nm bandpass fluorescence emission filter (selected for GCaMP recording; Semrock, FF01-535/22-25). The fluorescence image was focused onto the sensor of an sCMOS camera (Hamamatsu, ORCA-Flash4.0) through a tube lens (Thorlabs, AC254-035-A-ML). The reconfigurable dichroic mirrors were mounted in removable dichroic cube holders (Thorlabs, DFM1) that enabled two different light sources to be coupled in. In the standard configuration, a 470-nm LED filtered with a 470-nm bandpass filter (Thorlabs, M470F1 and FB470-10) was fiber-coupled into the dichroic cube holder using a 1,000-μm-diameter 0.48-NA fiber (Thorlabs, M71L01) and a 405-nm, f = 4.02 mm, 0.6-NA collimator (Thorlabs, F671SMA-405 and AD11F) with a 495-nm longpass dichroic mirror (Semrock, FF495-Di02-25 ×36). This produced an excitation spot of ∼2.5-mm diameter (10-mm objective focal length ÷ 4.02-mm collimator focal length × 1,000-μm-diameter fiber) at the working distance of the 20× objective. This spot was sufficiently large to fill all of the fibers of the seven-fiber branching patchcord. Typically the light powers emitted from the different fibers will be within 25–50% of each other. The LEDs were controlled by a driver enabling digital modulation up to 1 kHz (Thorlabs, LEDD1B). Supplementary Note 6 describes additional system design, alignment and calibration considerations.
Modifications for sCMOS and lock-in amplifier photoreceiver comparison
In order to precisely replicate the previous photoreceiver lock-in detection approach using a single 400-μm, 0.48-NA imaging patchcord, we introduced an optical chopping wheel after the collimated 470-nm LED (Thorlabs, MC1510 and MC2000). We coupled the LED to the microscope via a 200-μm-diameter, 0.39-NA fiber (Thorlabs, M75L01) and a 543-nm, f = 7.86 mm, 0.51-NA collimator (Thorlabs, F240FC-A and AD12F) to illuminate only the center ∼254-μm-diameter region of the 400-μm-diameter patchcord (10-mm objective focal length ÷ 7.86-mm collimator focal length × 200-μm-diameter fiber). We achieved this alignment by positioning the collimator using a five-axis kinematic mount (Thorlabs, K5X1) and using the camera to visualize both the 400-μm-diameter imaging patchcord and the size of the excitation spot from the 200-μm-diameter fiber-coupled LED using a fluorescent slide (Chroma, 92001) mounted at the working distance of the objective. The filtered GCaMP6 emission was then directed to both the sCMOS and the photoreceiver using a 50:50 beamsplitter (Thorlabs, BSW10R). A 10×/0.45-NA objective (Nikon, CFI Plan Apo Lambda 10×) was used to focus half of the GCaMP emission onto the ∼1-mm sensor of the photoreceiver (Newport, 2151), which was mounted on an x-y-z translator (Thorlabs, PT1 and PT2). Lastly, the signal from the optical chopping wheel was synchronized to a lock-in amplifier (Stanford Research, SR810 DSP), the output of which was sampled and digitized at 10 kHz using data-acquisition hardware (National Instruments, NI PCIe-6343-X).
Setup for concurrent acquisition of isosbestic control
For measurements of GCaMP6 emission, we used both a 405-nm LED and a 470-nm LED (Thorlabs, M405F1 and M470F1) as excitation sources for the Ca2+-dependent and Ca2+-independent isosbestic control measurements, respectively. The two LEDs were filtered with 410-10–nm and 470-10–nm bandpass filters (Thorlabs, FB410-10 and FB470-10), fiber coupled as described above, combined using a 425-nm longpass dichroic mirror (Thorlabs, DMLP425R) and coupled into the microscope using a 495-nm longpass dichroic mirror (Semrock, FF495-Di02-25 ×36).
Dual-color recording setup
To enable simultaneous GCaMP6 and R-CaMP2 recording, we removed the 535-nm bandpass emission filter and introduced an image splitter (Photometrics, DualView-Lambda) between the camera and the tube lens, which enabled us to record the GCaMP6 and R-CaMP2 emission onto separate halves of the same camera sensor. Inside the image splitter, a 560-nm dichroic mirror (Chroma, T560lpxr-UF2-26 × 28 × 2 mm) separated the emission into two channels, each of which was additionally filtered by a 600-37–nm (Semrock, FF01-600/37-25) and a 520-35–nm emission filter (Semrock, FF01-520/35-25) and then projected onto the camera sensor. An additional dichroic cube allowed us to incorporate a 565-nm LED (Thorlabs, M565F1) for R-CaMP2 excitation with a 560-14–nm excitation filter (Semrock, FF01-560/14-25), in conjunction with the 410-nm and 470-nm LEDs as described previously for GCaMP6 recording. Each of the three LEDs was coupled via a 1,000-μm-diameter, 0.48-NA fiber (Thorlabs) to either a 405-nm, f = 4.02 mm, 0.6-NA collimator (410-nm and 470-nm LED: Thorlabs, F671SMA-405 and AD11F) or a 543-nm, f = 4.34 mm, 0.57-NA collimator (560-nm LED: Thorlabs, F230SMA-A). The 410-nm and 470-nm output from the collimators were first combined with a 425-nm longpass dichroic mirror (Thorlabs, DMLP425R) and then combined with the 560-nm light using a second 520-nm dichroic (Semrock, FF520-Di02-25 ×36) before finally being coupled into the microscope using a third multiband dichroic (Semrock, FF410/504/582/669-Di01-25 ×36).
Setup for simultaneous recording and stimulation
For combined imaging and optogenetic stimulation, the 565-nm LED used for dual-color recording was replaced with a 594-nm laser (Cobolt, Mambo, 100 mW). The 594-nm laser was filtered with a 590-10–nm bandpass filter (Thorlabs, FB590-10). An additional 525-39–nm GFP emission filter (Semrock, FF01-525/39-25) was placed in front of the tube lens along with a 594-nm notch filter (Semrock, NF03-594E-25) to minimize direct laser emission detected by the camera. A multiband dichroic (Semrock, Di01-R405/488/594-25 ×36) was used to reflect 470-nm and 594-nm excitation light into the back of the 20× objective. A high-speed shutter (Stanford Research Systems, SR474) modulated the laser in synchrony with the other LEDs and the camera. To enable the delivery of 470-nm excitation light at two different power levels for 470-nm cross-stimulation experiments, we replaced the 594-nm laser with another 470-nm LED and replaced the dichroic combining the 470-nm and 594-nm light with a 50:50 beamsplitter. During the cross-stimulation experiments, one 470-nm LED was set to a lower power and activated for every camera exposure, and the other 470-nm LED was set to a similar or higher power and activated only during the stimulation periods.
Time-division multiplexing
To enable the concurrent recording of multiple channels per fiber (or for simultaneous optogenetic stimulation), we used a time-division multiplexing strategy to time-sequentially sample each channel individually. Schematics of the time-division multiplexing strategy used for each experiment are shown in Figure 1a and 2f and Supplementary Figure 6. Briefly, for GCaMP6 imaging, consecutive camera frames were captured using alternating 470-nm and 410-nm excitation sources, such that every other camera frame was captured using either 470-nm or 410-nm light. Thus if the camera was capturing images at 40 Hz, the individual 470-nm and 410-nm signals were sampled at 20 Hz. For simultaneous GCaMP6 and R-CaMP2 imaging, camera frames were captured using either alternating excitation sources of 470 nm and 560 nm or 410 nm alone. For simultaneous GCaMP6 imaging and optogenetic stimulation, camera frames were captured only with 470-nm excitation light, and additional 470-nm or 594-nm stimulation light pulses were independently controlled.
Integrated device for combined optical neuromodulation and electrical recording for chronic in vivo applications [ PDF ]
Wang J, Wagner F, Borton DA, Zhang J, Ozden I, Burwell RD, Nurmikko AV, van Wagenen R, Diester I, Deisseroth K. J Neural Eng, 9:016001 (2012)

We previously demonstrated, in vitro, the dual capability (optical delivery and electrical recording) while testing a novel hybrid device (optrode-MEA), which incorporates a tapered coaxial optical electrode (optrode) and a 100 element microelectrode array (MEA). Here we report a fully chronic implant of a new version of this device in ChR2-expressing rats, and demonstrate its use in freely moving animals over periods up to 8 months.
Optogenetics in Neural Systems: Neuron Primer [ PDF ]
Yizhar O, Fenno LE, Davidson TJ, Mogri M, Deisseroth K. Neuron, 72:9-34 (2011)

Here we provide a primer on the application of optogenetics in neuroscience, focusing on the single-component tools and highlighting important problems, challenges, and technical considerations.
Optetrode: a multichannel readout for optogenetic control in freely moving mice [ PDF ]
Anikeeva P, Andalman AS, Witten I, Warden M, Goshen I, Grosenick L, Gunaydin LA, Frank LM, Deisseroth K. Nature Neuroscience, 4;15(1):163-70 (2011)

We designed and validated the optetrode, a device that allows for colocalized multi-tetrode electrophysiological recording and optical stimulation in freely moving mice. Optetrode manufacture employs a unique optical fiber-centric coaxial design approach that yields a lightweight (2 g), compact and robust device that is suitable for behaving mice. This low-cost device is easy to construct (2.5 h to build without specialized equipment). We found that the drive design produced stable high-quality recordings and continued to do so for at least 6 weeks following implantation.
Integrated device for optical stimulation and spatiotemporal electrical recording of neural activity in light-sensitized brain tissue [ PDF ]
Zhang J, Laiwalla F, Kim JA, Urabe H, Van Wagenen R, Song YK, Connors BW, Zhang F, Deisseroth K, Nurmikko AV.J. Neural Eng, 6(5):055007 (2009)

We report here a novel dual-modality hybrid device, which consists of a tapered coaxial optical waveguide (?optrode?) integrated into a 100 element intra-cortical multi-electrode recording array. We first demonstrate the dual optical delivery and electrical recording capability of the single optrode in in vitro preparations of mouse retina, photo-stimulating the native retinal photoreceptors while recording light-responsive activities from ganglion cells. The dual-modality array device was then used in ChR2 transfected mouse brain slices. Specifically, epileptiform events were reliably optically triggered by the optrode and their spatiotemporal patterns were simultaneously recorded by the multi-electrode array.
Optogenetic interrogation of neural circuits: technology for probing mammalian brain structures [ PDF ]
Zhang F, Gradinaru V, Adamantidis AR, Durand R, Airan RD, de Lecea L, Deisseroth K. Nat Protoc, 5(3):439-56 (2010)

Interrogation of even deep neural circuits can be conducted by directly probing the necessity and sufficiency of defined circuit elements with millisecond-scale, cell type-specific optical perturbations, coupled with suitable readouts such as electrophysiology, optical circuit dynamics measures and freely moving behavior in mammals. Here we collect in detail our strategies for delivering microbial opsin genes to deep mammalian brain structures in vivo, along with protocols for integrating the resulting optical control with compatible readouts (electrophysiological, optical and behavioral).
An optical neural interface: in vivo control of rodent motor cortex with integrated fiberoptic and optogenetic technology [ PDF ]
Aravanis AM, Wang LP, Zhang F, Meltzer LA, Mogri MZ, Schneider MB, Deisseroth K. J. Neural Eng, 4:S143-S156 (2007)

We describe here a novel optical neural interface technology that will allow neuroengineers to optically address specific cell types in vivo with millisecond temporal precision. Channelrhodopsin-2 (ChR2), an algal light-activated ion channel we developed for use in mammals, can give rise to safe, light-driven stimulation of CNS neurons on a timescale of milliseconds. Because ChR2 is genetically targetable, specific populations of neurons even sparsely embedded within intact circuitry can be stimulated with high temporal precision. Here we report the first in vivo behavioral demonstration of a functional optical neural interface (ONI) in intact animals, involving integrated fiberoptic and optogenetic technology.