Abstract
Objective.Determining the intricate structure and function of neural circuits requires the ability to precisely manipulate circuit activity. Two-photon holographic optogenetics has emerged as a powerful tool for achieving this via flexible excitation of user-defined neural ensembles. However, the precision of two-photon optogenetics has been constrained by off-target stimulation (OTS), an effect where proximal non-target neurons can be unintentionally activated due to imperfect spatial confinement of light onto target neurons. New approaches are therefore needed to resolve the OTS problem.Approach.Here, we introduce a real-time computational method for mitigating OTS that first empirically samples each neuron's sensitivity to stimulation at proximal locations, and then optimizes stimulation sites using a fast, interpretable model based on adaptive non-negative basis function regression (NBFR).Main results.NBFR is highly scalable, completing model fitting for hundreds of neurons in just a few seconds and then optimizing stimulation sites in several hundred milliseconds per stimulus-fast enough for most closed-loop behavioral experiments. We characterize the performance of our approach in both simulations andin vivoexperiments in mouse hippocampus, showing its efficacy under realistic experimental conditions.Significance.Our results thus establish NBFR-based photostimulus optimization as an important addition to an emerging computational toolkit for precise yet scalable holographic optogenetics.