Simple integration of fast excitation and offset, delayed inhibition computes directional selectivity in Drosophila

A neuron that extracts directionally selective motion information from upstream signals lacking this selectivity must compare visual responses from spatially offset inputs. Distinguishing among prevailing algorithmic models for this computation requires measuring fast neuronal activity and inhibition. In the Drosophila visual system, a 4th-order neuron—T4—is the first cell type in the ON pathway to exhibit directionally selective signals. Here we use in-vivo whole cell recordings of T4 to show that directional selectivity originates from simple integration of spatially offset fast excitatory and slow inhibitory inputs, resulting in a suppression of responses to the non-preferred motion direction. We constructed a passive, conductance-based model of a T4 cell that accurately predicts the neuron’s response to moving stimuli. These results connect the known circuit anatomy of the motion pathway to the algorithmic mechanism by which the direction of motion is computed.

A prevalent hypothesis for how T4 cells could implement the HR detector was proposed based on different input cell types providing the temporally 14 and spatially 9 offset inputs, however, further analysis of the circuit 15,17 has ruled out this circuit mechanism. The other recent approach to identifying the mechanism responsible for directional selectivity in the T4 circuit has been to use calcium imaging to measure T4 responses to structured visual stimuli. Several studies found evidence for enhanced responses to preferred direction motion 18,19 , while several others found both preferred direction enhancement and null direction suppression [20][21][22] . A number of groups have recently proposed that motion detection in flies may be implemented as a hybrid mechanism featuring elements of both the HR and BL algorithms 15,[21][22][23] . However, direct evidence for either mechanism has been elusive, in large part because these studies rely on calcium imaging. Calcium indicator responses are insensitive to fast events, obscuring the small timing differences required by the HR detector, and are also insensitive to hyperpolarization, thereby preventing the direct measurements of inhibition, a defining feature of the BL model.

Results
To directly measure the physiological properties of T4 neurons, we used targeted in-vivo whole-cell electrophysiology. We confirmed the identity of GFP-labeled T4 neurons by measuring reliable depolarizations in response to small ON flashes ( Fig. 1a and Supplementary Fig. 1). We used on-line stimulus generation and analysis to localize the center (within ~2°) of the receptive field (RF) of each recorded neuron ( Supplementary Fig.  1b,c). To measure directional selectivity in single T4 cells, we presented a narrow (~2° wide) ON bar moving in 8 different directions through the mapped RF center (Fig. 1b,c). The T4 membrane potential showed small depolarizations in response to several directions of motion (Fig. 1b), but large responses to movement in a ~90° range, centered around the preferred direction (PD; opposite to the null direction, ND), in agreement with the tuning width of measured with calcium imaging 11 . Our moving bar stimulus generates apparent motion: the bar appears to move in a series of discrete (~2°) steps, where the speed of movement is determined by the duration the bar remains at each position. To examine the computation of directional selectivity across a behaviorally relevant range, we presented 4 movement speeds. The responses to the moving stimuli were averaged across individual recordings once aligned to the PD (Fig. 1c). We quantified the strength of directional selectivity using a directional selectivity index (DSI, defined in Methods, analysis section) and saw significant tuning at all stimulus speeds (p< 0.05, one sided unpaired t-test), with stronger directional selectivity at the two slower speeds (p< 0.05, one sided paired t-test, Fig.  1d). At slow speeds, the membrane potential exhibited prominent hyperpolarizing responses, both following the response to PD motion, and preceding the depolarizing response to ND motion (arrowheads in Fig. 1c, detailed in Supplementary Fig. 2). The sequence of depolarizing and hyperpolarizing signals depended on the direction of motion, suggesting that inhibitory and excitatory inputs to T4 may be spatially offset in agreement with recent anatomical findings 17 .

Mapping the T4 receptive field reveals a spatiotemporal asymmetry
In order to characterize the fine structure of T4's RF, we first localized the RF center and identified the PD-ND axis. We decomposed the moving bar stimulus into its elementary components-single position bar flashes with a fixed duration-and presented them at all positions, randomly interleaved, along the PD-ND axis. Aligning the single position flash responses (SPFRs) based on the position of peak depolarization (Fig. 2a) reveals two key properties. (1) The center and leading side of the T4 RF exhibit excitatory responses. These responses are larger and last longer for longer flash stimuli (corresponding to slower speeds). Additionally, longer flashes presented on the leading side of the RF reveal depolarizing responses that are not observed for short flashes. (2) The inputs along this axis are spatially asymmetrical; hyperpolarizing inputs only appear on the trailing side of the RF (most clearly seen for the longer duration flashes). Overlaying voltage traces from leading and trailing RF positions exposes a temporal asymmetry in the inputs (Fig. 2b,d). Responses on the trailing side decay faster than responses at equivalent positions on the leading side. This temporal sharpening can be seen across speeds, including the shortest duration flash where hyperpolarization was not directly recorded (arrowheads in Fig. 2b).
For the longer duration flash stimuli our RF mapping ( Fig. 2c and Supplementary Fig. 3), shows a spatially offset distribution of depolarizing and hyperpolarizing inputs to T4, with the hyperpolarizing input on the trailing side of RF. Remarkably the offset between the peaks of excitatory and inhibitory inputs (~6° of visual angle; Supplementary Fig. 3b) corresponds to the approximate angular separation between adjacent ommatidia on the fly eye, matching the predicted structure for the inputs of the Drosophila motion detector 5 .
Because we do not measure excitatory and inhibitory currents directly, the underlying overlap between excitation and inhibition is expected to extended beyond positions where we can robustly measure hyperpolarizing input.
If T4 implements an HR-like mechanism, we expect that SPFRs on the leading side of the RF would be time delayed relative to trailing side SPFRs 2,14 . A simple expectation for relative time delays between offset visual stimulation generated through differential filtering by either upstream cells and/or synaptic transmission is that the responses would occur with a relative temporal offset. However, the onset time of the flash response is constant across the RF (Fig. 2d,e). Nevertheless, a significant position effect is seen in the decay time (Fig.  2d,e), which we attribute to temporal sharpening (arrowheads in Fig. 2b) due to overlapping inhibitory inputs on the trailing side of the RF (Fig. 2c). Rather than a relative time delay between offset inputs, we find that the temporal differences in the SPFRs can be explained by fast excitatory inputs on the leading side combined with slower inhibitory inputs on the trailing side of the RF.

Directional selectivity results from ND suppression
The classical models for motion detection nonlinearly combine offset inputs, resulting in either an enhancement of PD responses (HR) or a suppression of ND responses (BL). A simple test for directional selectivity is to deliver flash stimuli at two positions along T4's RF and see whether the response to sequential stimulation in one direction is larger than the response to the opposite sequence of stimulation. We implemented this two-step apparent motion stimulus using single position flashes (160 ms duration) for pairs of positions around the RF center (Fig. 3a). To assess the effect of direction, we compared each two-step response to the superposition of the corresponding two single position responses (offset in time and summed; Fig. 3b). This comparison reveals no enhanced response to the second bar appearing towards the PD (left column), but a reduction in the second bar response when it appears towards the ND (arrow, right column). Flashes separated by ~10° (bottom row) do not appear to interact, showing neither enhancement nor suppression. Furthermore, the suppression is most prominent for bar pairs 'moving' in the ND that begin on the trailing side, consistent with our finding that the distribution of inhibitory inputs is skewed to this side of the RF. By comparing the apparent motion responses to the same bar pairs, but in opposite directions (Fig. 3c), we see that the leading side of the RF-corresponding to the primarily excitatory domain of the SPFRs (Fig. 2)-is motion blind (see also Supplementary  Fig. 4). Strong directional selectivity is only seen for the bar pairs that include the trailing side of the RF, and is only produced by ND suppression.

The superposition of stationary responses generates directional selectivity
The two-step apparent motion responses (Fig. 3) suggest that it is the integration of offset excitatory and inhibitory inputs that generates directionally selectivity. However, is this mechanism sufficient to explain the directionally selective responses to moving bars? To address this question, we compared the responses to moving bar stimuli, comprised of an ordered sequence of single position bar flashes (Fig. 4a,b), with the superposition of SPFRs (the sum after appropriate temporal alignment; Fig. 4c). Importantly, the only difference between the summed PD and the summed ND responses was the order in which the SPFRs were aligned. This comparison is conceptually similar to our treatment of the two-step apparent motion responses, but now many interactions across the entire receptive field are being probed. We find that the simple sum of SPFRs (Fig. 4c) captures the essential dynamics of the moving bar response (Fig. 4c,d) and shows significant directional selectivity at all four speeds (Fig. 4e).
The summed responses approximated the measured responses without any nonlinear integration, a surprising result since both the HR and BL models of motion detection require a nonlinear interaction to compute directional selectivity. To be clear, we are not claiming that directional selectivity emerges from linear operations (for example, the DSI computation is nonlinear), but rather emphasize that these directionally asymmetric responses expose a significant discrepancy between the T4 mechanism and the classical models. To gain further insight, we examined features of the SPFRs for contributions to directional selectivity in the summed responses, and found that it is the position dependent differences (such as the response shape, sign, and magnitude) that account for the DSI of the summed responses. (Supplementary Fig. 5). However, the summation of aligned SPFRs only accounts for approximately half of the measured T4 DSI (Fig. 4e). Summing negative and positive potentials will undercount the effect of inhibition. For example, in shunting inhibition a small inhibitory current can eliminate a much larger excitatory current. The effect of this undercounting is most prominently seen in the overestimated ND responses (Fig. 4f). Does this mismatch suggest that T4 implements a nonlinear step like the classical models, or could biophysically realistic integration of inhibitory inputs explain the additional measured DSI?

A conductance-based simulation quantitatively predicts the T4 motion response
To answer this question, we built a conductance-based model of a T4 neuron reconstructed from electron microscopy data (Fig. 5a). In our model, we randomly distributed excitatory and inhibitory synapses along the dendritic arbor of the cell, but fit the synaptic strengths, the time course of the excitatory and inhibitory conductance changes, and membrane and axial resistivity, using an optimization procedure that minimizes the error between simulated responses to bar flashes and our measured SPFRs (from all the positions and all the speeds; Fig. 5a, Supplementary Fig. 6a,b,c). We then used the resulting model to simulate T4's response to a moving bar (Fig. 5b). Importantly, we fit our model's parameters using responses to stationary stimuli (the SPFRs), but used the model to predict the responses to an independent motion stimulus (the moving bar responses), thus testing the generalization of this model.
In comparison to the summed responses ( Fig. 4d), the simulated responses more accurately reproduced the measured responses to both PD and ND motion (Fig. 5b,c). Furthermore, the same simulation qualitatively reproduced the dynamics of T4 responses (Fig. 5b) and quantitatively reproduced the magnitude of the directionally selective responses (Fig. 5c,d and Supplementary Fig. 6d,e,f) at all tested speeds, suggesting that the same mechanism can account for directional selectivity, even at the fastest speeds tested where hyperpolarization was not directly measured (Fig. 2).
One classical neuronal computation of directional selectivity based on passive cable properties 24 , is that sequential depolarization directed towards the (thicker) axon generates stronger responses than activation in the opposite direction. To test whether this mechanism could contribute to directional selectivity in T4, we zeroed all inhibitory conductance changes in our model. When the simulation was repeated, only the excitatory synapses were activated as the "stimulus" swept in the PD or ND. We found that in the absence of inhibition, the DSI of the simulated T4 is abolished at all speeds ( Fig. 5d, middle), indicating that depolarizing inputs alone cannot produce directional selectivity. This suggests that inhibitory inputs to T4, in addition to providing slow hyperpolarization that characterizes responses to slow motion (Fig. 1c), also establish the temporal sharpening of trailing side responses, critical for directional selectivity at faster speeds ( Supplementary Fig. 5b).
The striking retinotopic alignment of T4 dendrites with the PD-ND axis was an important anatomical clue in their identification as directionally selective cells 9,25 . We used our simulation to test whether the neuron's morphology substantially contributes to directional selectivity. By positioning all 154 synaptic inputs (inhibitory and excitatory) at the base of the dendrite (all other parameters held constant), we found that these simulation results were almost indistinguishable from the unmodified simulation (Fig. 5d, right). As a consequence of this result, we expected that a single -compartment neuron simulation should also be able to capture the response dynamics of T4. Indeed, this simpler model reproduces the moving bar responses of T4 with only negligible differences to the multi-compartment simulation results (Fig. 5d, right). These results suggest that the critical role of T4's elaborate and directional dendrite is limited to collecting different input signals across a small region of the fly's eye. Taken together, these modelling results corroborate our central finding that inhibitory inputs sculpt the essential asymmetry for directionally selective responses in T4 cells-no additional mechanisms are required.

Discussion
We used intracellular recordings to probe the mechanism of directionally selectivity for ON motion in T4 neurons. Using on-line stimulus generation, we finely mapped the receptive field of T4 neurons (Fig. 2). Remarkably, this receptive field structure, comprised of responses to stationary ON bars, can be used to predict the response of T4 to moving bars (Fig. 4). We then improved these predictions with a parsimonious, biophysical model integrating offset excitatory and inhibitory conductances (Fig. 5).
In the present study, we show that directional selectivity in T4 neurons arises solely from ND suppression. Recent studies that used calcium imaging of T4 neuron responses to a twostep apparent motion stimulus found evidence for PD enhancement 18,19 or for both PD enhancement and ND suppression 20,22 . These discrepancies may arise from differences in the stimulus design, differences between single neuron and population recordings, differences between measurements of membrane potential versus calcium indicator fluorescence, or from combinations of these factors. Since the transformation between membrane potential and calcium indicator fluorescence is likely to be superlinear 21 , measured calcium responses may appear enhanced when compared to their summed components, even though the underlying voltage response does not show this enhancement ( Supplementary Fig. 7). However, as Fisher, et al. 18 have controlled for this possibility, we believe that the difference is most likely explained by differences in stimulus design (centered bars versus edges 18 ; centered narrow bars versus centered wider spots 20 ). Haag, et al. 20 found PD enhancement in T4 cells, but only for stationary stimuli wider than those used here. These larger stimuli, in addition to strongly depolarizing the measured T4 cells, are also effectively stimulating neighboring T4 cells. But since T4 neurons synapse onto other T4 cells with exquisite precision-only cells with the same directional tuning are connected, and only in the direction of motion 17 -this circuit mechanism should produce a superlinear response in one direction (along the PD), but not in the opposite direction. This enhancement of PD motion over a slightly larger spatial scale appears to be evidence for directed facilitation from neighboring T4 cells, but not for an HR-like mechanism responsible for directional selectivity (since blocking synaptic transmission in T4 neurons does not substantially reduce directionally selective responses in T4 cells 15,22 ). This factor may partially explain the measurement of PD enhancement in Fisher et al. 18 , but future experiments will be required to clarify these discrepancies.
Anatomical studies have shown that dendrites of T4 cells are aligned with the PD 9,25 and receive spatially offset synaptic inputs from distinct columnar neuron types 17 . The arbors span several (3)(4) retinotopic columns in the medulla 16 , which given the ~5° visual angle per column, corresponds well to our measured RF width of ~20° (Fig. 2). The cholinergic columnar neurons Mi1 and Tm3 preferentially synapse onto T4s in the central to distal part of the arbor, while the GABAergic neurons Mi4, C3, and CT1, synapse mainly onto the base of the dendrite 15,17,26,27 . This anatomical arrangement agrees remarkably well with the functional organization of our measured T4 receptive field, with leading-side excitation and trailing-side inhibition.
A recent study from our lab used circuit perturbations to also propose a hybrid mechanism for T4 motion responses 15 . Although we showed nonlinear integration of excitatory inputs by T4, we did not show that this nonlinearity contributes to the computation of directional selectivity, so these results do not conflict with the current findings. In fact, EM-based circuit analysis 9,17 , as well as a number of functional studies 14,15,23,26,28,29 , suggests that multiple cell types (at least Mi1 and Tm3) contribute to the excitatory ON component of our measured RF, without evidence for a spatial offset required for an HR-like mechanism 17 . In our previous study, we also showed that silencing one of the main inhibitory inputs to T4 (Mi4) does not reduce directional selectivity 15 . Since our current results strongly suggest that inhibition is necessary for computing directional selectivity, it is entirely possible that the critical inhibitory inputs to T4 are not simply contributed by a single cell type (other candidates include CT1, C3, and TmY15 17 ).

Synthesis of experimental results with classical computational models for motion detection
Historically, the computation of directional selectivity has been conceptualized with algorithmic models that have outlined the general properties that transform non-selective inputs into a directionally selective output. Here we compare our results with the implications of the classical models, and present an algorithmic summary of our findings. Motion detector models typically describe a 'fully-opponent' computation, whereby local motion estimates in opposing directions are subtracted to minimize non-motion signals 1 . Since T4 is now understood to reside one step before this opponent subtraction 30 , we only consider the subunits of each model type before this subtractions stage. The classical model for insect motion detection is the Hassenstein-Reichardt Detector 2 . This detector generates directional selectivity by delaying leading side excitatory input and combining it with trailing side excitatory input with a nonlinear amplification, thus enhancing the preferred direction response (Fig. 6a). If T4s directional selectivity was based on an HR-like mechanism, we would expect to find: (1) excitatory inputs spanning the receptive field, (2) differing temporal filtering of inputs resulting in a delayed leading side, and (3) enhanced responses to PD motion (Fig. 6a). We did not find evidence for any of these properties: (1) T4 receives offset excitatory and inhibitory inputs (Fig. 2c), (2) leading side responses are not temporally delayed (Fig. 2d,e and Supplementary Fig. 8), and (3) PD motion is not enhanced (Fig. 3,4,5). Furthermore, the excitatory region of the receptive field is motion blind (Supplementary Fig. 4). An alternative classical model is the Barlow-Levick detector 3 that integrates fast leadingside excitation and slower trailing-side inhibition through the nonlinear 'AND NOT' operation ( Fig. 6b). Directional selectivity is computed since motion is signaled when excitatory input precedes the inhibitory input; in the reverse order ND motion is suppressed. We find several properties in our T4 recordings that agree with this framework: (1) leadingside excitatory responses and trailing-side inhibitory responses (Fig. 2), (2) longer temporal filtering on the trailing side, such that inhibition outlasts excitation (Fig. 2, 5 and Supplementary Fig. 8), and (3) clear evidence for ND suppression with both two-step and moving bar apparent motion (Fig. 3c, 4f).
While the organization of the T4 RF agrees with the algorithmic principle of the BL model, we find an important difference in the integration mechanism. The BL model uses a strong nonlinearity, and so does not produce directionally selective responses from the superposition of the responses to stationary inputs (which our T4 recordings show, Fig. 3,4). This seemingly technical distinction is in fact quite consequential, since in both the HR and BL models, the nonlinearity is a defining characteristic-without it there are no directionally selective responses. In contrast, our T4 results show that directional selectivity is already present in the superposition of the stationary stimulus responses.
A 3 rd class of motion detectors-the Adelson-Bergen (AB) motion energy model 31generates directional selectivity by using filters that are oriented in space-time. These linear filters are combined spatial and temporal filters that feature a prominent space-time tilt indicating the preferred direction. In Fig. 6c we present only the relevant subunit of the full AB model for comparison with our data. This subunit has (1) different spatial filters on each of its arms, (2) excitatory and inhibitory inputs, (3) a linear integration step that produces a directionally selective response from the superposition of stationary responses (as seen in simple cells of the cat visual cortex 32 ), and (4) a static amplifying nonlinearity. This flexible model, whose commonalities with variants of the classical motion detection models have been broadly discussed 1,31,33 , provides a useful framework for representing the T4 computation.
In light of the commonalities and discrepancies between classical algorithmic models and our results, we next provide a summary of our understanding of T4 in a format that is directly comparable to these models (Fig. 6d), with an excitatory and an inhibitory arm. The more complex spatial and temporal filters of the AB model, selected to match cortical recordings, are replaced with the filters describing T4 responses ( Fig. 5 and Methods). The spatial filters create the leading vs. trailing offset, and the temporal filters create the fast vs. slow difference, between the excitatory and inhibitory arms. In contrast to the 'point sampling' inputs of the classical HR and BL models, T4 shows spatially extended responses to visual input (Fig. 2b), which has previously been shown to improve the accuracy of motion detection 34 . While the sum of the linear filter outputs produces asymmetric responses to PD and ND motion (Fig. 6d), T4 neurons further enhance this selectivity through nonlinear integration. While the AB model employs a static, amplifying nonlinearity, we measure a suppressing nonlinearity, which is well approximated with a simplified passive, biophysical model (similar to a previous formulation 35 ; Fig. 5d, 6d, and Methods).

Spatiotemporal receptive fields of T4 cells
Representing the response properties of neurons using spatiotemporal receptive fields, equivalent to the response of the spatiotemporal filters in the AB model, has provided significant insight into transformation along the visual pathway of mammals 36 , and has recently also been applied to the responses of directionally selective neurons in flies 19,21 . We have replotted the averaged SPFRs to approximate the spatiotemporal receptive field of a T4 neuron ( Supplementary Fig. 8, left). As expected for a directionally selective neuron, we find a distinctive tilt in this receptive field, indicating the preferred direction. This RF has both excitatory and inhibitory lobes, which both appear tilted, an organization that may suggest PD enhancing and ND-suppressing mechanism 19,21 . To explore the basis of the RF tilt, we used our multi-compartment T4 model, and replotted the simulated SPFRs ( Supplementary Fig. 6c) as a spatiotemporal RF (Supplementary Fig. 8, middle). Since the model was fit to the SPFR data, the qualitative agreement between these RFs is not surprising. The simulated RF also features a tilted excitatory lobe. When we removed inhibition in our model (Fig. 5d) and reproduced the RF ( Supplementary Fig. 8, right), we found that the excitatory lobe was no longer tilted, consistent with our inference that inhibition sharpens trailing side responses (Fig. 2b). This simulation shows that a tilted, bilobed spatiotemporal RF does not necessarily support a hybrid mechanism, and reiterates the lack of evidence in our data for PD enhancement.
It is worth noting that the receptive fields of T5 cells, the OFF directionally selective neurons, look qualitatively similar to those estimated for T4 neurons [19][20][21] . Therefore, it is possible that T5 neurons compute directional selectivity using the same simple mechanism that we have established here for T4 neurons. Interestingly, no small field inhibitory inputs 37,38 to T5 have thus far been identified, raising the possibility of different implementations of the same motion computation in ON and OFF pathways 39,40 .

Histology
To visualize the expression pattern of the T4 driver line (SS02344), brains of female flies were immunolabeled and imaged as described 41 . anti-Brp was used as a stain for the neuropil marker (anti-nc82 1:30, Developmental Studies Hybridoma Bank) and pJFRC225-5XUAS-IVS-myr::smFLAG (rat anti-FLAG 1:100, Novus Biologicals) in VK00005 42 was used as the reporter for GAL4 expression. For Supplementary Fig. 1a, the image shown was generated from a confocal stack imaged on a Zeiss LSM 710 microscope with a 63× objective, and resampled using Vaa3D 43 .

Electrophysiology
Experiments were performed on 1-2 day old female Drosophila melanogaster (flies were reared under constant light conditions at 24°C, some flies experienced periods of darkness, including overnight, prior to dissection). To target T4 cells, a single genotype was used: pJFRC28-10XUAS-IVS-GFP-p10 44 in attP2 crossed to stable split-GAL4 SS02344 (VT015785-p65ADZp (attP40); R42F06-ZpGdbd (attP2)) generously provided by Aljoscha Nern in Gerry Rubin's lab (line details with expression data available from http:// splitgal4.janelia.org/). Flies were briefly anesthetized on ice and transferred to a special chilled vacuum holder where they were mounted, with the head tilted down, to a customized platform machined from PEEK using UV-cured glue (Loctite 3972). CAD files for the platform and vacuum holder are available upon request. To reduce brain motion the proboscis was fixed to the head with a small amount of the same glue. The posterior part of the cuticle was removed using syringe needles and fine forceps. The perineural sheath was peeled using fine forceps and, if needed, further removed with a suction pipette under the microscope. To further reduce brain motion, muscle 16 45  The mounted, dissected flies were positioned on a rigid platform mounted on an air table. Recordings were obtained from labeled T4 cell bodies under visual control using a Sutter SOM microscope with a 60× water-immersion objective. To visualize the GFP labeled cells, a monochrome, IR-sensitive CCD camera (ThorLabs 1500M-GE) was mounted to the microscope, an IR LED provided oblique illumination (ThorLabs M850F2), and a 460 nm LED provided GFP excitation (Sutter TLED source). Images were acquired using Micro-Manager 47 , to allow for automatic contrast adjustment.
All recordings were obtained from the left side of the brain. Current clamp recordings were low-pass filtered at 10KHz using Axon multiClamp 700B amplifier, and were sampled at 20KHz (National Instrument PCIe-7842R LX50 Multifunction RIO board) using custom LabView (2013 v.13.0.1f2; National Instruments) and MATLAB (2015a; Mathworks) software. The membrane potential of recorded cells was set around −65mV (uncorrected for liquid junction potential), which required injecting a small, hyperpolarizing current (0-3 pA), which after initial adjustment was maintained at a constant value throughout the recording. To verify recording quality, current step injections were performed intermittently, throughout the experiment. Recordings from cells in which either visual or current step responses diminished noticeably were terminated.

Visual stimuli
The display was constructed from an updated version of the LED panels previously described 48 . The arena covered slightly more than one half of a cylinder (216° in azimuth and ~72° in elevation) of the fly's visual field, with each pixel subtending an angle of ~2.25° on the fly eye. Green LEDs (emission peak: 565 nm) were used, bright stimuli were ~72 cd/m 2 , and were presented on an intermediate intensity background of ~31 cd/m 2 .
Visual stimuli were generated using custom written MATLAB code that allowed rapid generation of stimuli based on individual cell responses. In contrast to the published stimulus control system 48 , we have now implemented an FPGA-based panel display controller, using the same PCIe card (National Instrument PCIe-7842R LX50 Multifunction RIO board) that also acquired the electrophysiology data. This new control system (implemented in LabView) streams pattern data directly from PC file storage, allowing for on-line stimulus generation. Furthermore, this new control system featured high precision (to 10 μs) timing and logging of all events, enabling reliable alignment of electrophysiology data with visual stimuli.
To map the receptive field (RF) center of each recorded cell, three grids of flashing bright squares (on an intermediate intensity background) were presented at increasing resolution. Each flash stimulus was presented for 140 ms. First, a 6 × 7 grid of non-overlapping 5 × 5 LEDs (~11°×~11°) bright squares was presented. If a response was detected, a denser 3 × 3 grid with 50%-overlapping 5 × 5 LEDs (~11°×~11°) bright and dark squares (to further verify these were T4 Cells) was presented at the estimated position of the RF center (see Supplementary Fig. 1). If a recorded cell was consistently responsive to the first two mapping stimuli, a third one was presented to identify the RF center. A 5 × 5 grid of 3×3 LED bright squares separated by 1 pixel-shifts was presented at the estimated center of the second grid stimulus. The location of the peak response to this stimulus was used as the RF center in subsequent experiments. Once the RF center was identified, the moving bar stimulus was presented in 8 directions and 4 step durations. The bar was 1 × 9 pixels. When moving in the cardinal directions, the motion spanned 9 pixels. In the diagonal directions bar motion included more steps to cover the same distance (9 steps vs. 13 steps). Once the preferred direction had been estimated, bright bar (also 1 × 9 pixels) flashes were presented on the relevant axis. To verify full coverage of RF, this stimulus was presented over an area larger than the original motion window (at least 13 positions). In addition to these stimuli, most cells were also presented with additional stimuli following this procedure. All stimuli were presented in a pseudorandom order within stimulus blocks. All stimuli were presented 3 times, except for single bar flashes which were repeated 5 times. The inter-stimulus interval was 500ms for moving stimuli and 800ms for single bar flashes (to minimize the effect of ongoing inhibition on the responses to subsequent stimuli).

Analysis
All data analysis was performed in MATLAB using custom written code. Since the T4 baseline was typically stable, we included only trials in which the mean pre-stimulus baseline did not differ from the overall pre-stimulus mean for that group of stimuli by more than 10 mV. We also verified that the pre-stimulus mean and overall mean for that trial did not differ by more than 15 mV (or 25 mV for slow moving bars, due to their strong responses). This was designed to identify those rare trials in which the trace became unstable only after the stimulus was presented. Responses were later aligned to the appearance of the bar stimulus and averaged (or the appearance of the bar in the central position in case of the 8-orientation moving bar). T4 cells are expected to signal using graded synapses. Consistent with this expectation, we find that T4 recordings only occasionally feature very weak, fast transients (~1-2 mV in size) that could not be verified as spikes. Therefore, we have focused our analysis on the graded (sub-threshold) components of T4's responses.
Determining PD-First, 8 direction responses were aligned to the center position for each cell. Second, for the duration of bar presentation, the mean vector response was calculated for each time point as R t = ∑ k = 1 8 R θ k , t e iθ k . With θ k being the direction of motion (in 45° intervals), and R(θ k ,t) the response at that direction at time t. Supplementary Fig. 2 shows the result of this procedure for the normalized vector magnitude and θ. This procedure can be thought of as mimicking a downstream neuron, receiving input from T4s with the same RF center but different PDs. θ for the cell was selected at the time point when the mean vector magnitude was maximal (repeated for 4 step durations and averaged). In the polar plot of Fig. 1b, this time point is used for the response to each bar direction. The PD was determined as the θ k with the minimal difference to θ. For Fig. 1c, responses were then circularly shifted to align the PD with rightward motions for plotting and averaging purposes. Single Position Flash Response -depolarization-Responses were defined as the 0.995 quantile (a robust estimate of the max) of the response during the time between bar appearance and flash duration + 75ms. If this number did not exceed 3 standard deviations of the pre-stimulus baseline (for all bar flashes for that cell), the response was defined as zero.
Single Position Flash Response -hyperpolarization-Same as above only the time window was until end of trial (due to slower time course for inhibition) and the threshold was 2 SDs (due to lower magnitude of hyperpolarization). These calculations were used for Fig. 2c and Supplementary Fig. 3.
Depolarization (Hyperpolarizatio) normalization-All detected averaged SPFRs for a given duration were normalized to the maximal depolarizing (hyperpolarizing) absolute response for that duration and that cell. Fig. 2c shows the average of these normalized responses for a single duration. Supplementary Fig. 3a shows the sums for each cell, for 4 normalized depolarizing responses, and the 2 slowest hyperpolarizing responses (since hyperpolarization was hard to detect for brief flashes). A position which showed the maximal response for all durations, will therefore, have a value of 4 for depolarizations and 2 for hyperpolarizations.
Onset time calculation-Data during a window of 200ms before stimulus presentation from all the single bar flashes presented to a cell was used for a per-cell estimate of the standard deviation of the baseline. Only presentations in which the average SPFR was detected as depolarizing were used for onset time calculation. Onset time was defined as the time from stimulus presentation (after it was corrected for a small display latency) in which the response crossed 0.5 × baseline S.D. This threshold value did not exceed 0.5mV. This calculation is used in Fig. 2d and e. Because positions in the center of the RF feature a mixture of excitation and inhibition, the peak time is 'contaminated' by the inhibitory contribution and could not be used as an independent, reliable measure of the properties of the excitatory input.
Decay time calculation-The decay time (from 80% to 20% of maximal response) was calculated for all the cells and all the positions in which a depolarizing response was detected. If 20% of max response was not attained by the time recording ended, that data point was excluded. This calculation is used in Fig. 2d and e. Number of cells which passed the above threshold and were included in figure 2d is: 160ms -17, 17, 17, 17, 17, 15, 9; 80ms -15, 16, 17, 17, 16, 15, 6; 40ms -11, 13, 16, 16, 16, 10, 8; 20ms -1, 8, 11, 17, 12, 8, 4. Summed SPFRs (superposition)-Single bar flash responses were aligned to the time of the corresponding position appearance in the moving bar stimulus. Responses were padded with zeros (since all were baselines subtracted) to extend brief single bar responses to the timescale of a moving bar. This procedure was used both for the two-step apparent motion stimuli and the moving bar stimuli (Figs. 3 and 4, Supplementary Figs. 4, 5 and 7). For moving bar analysis, responses in which hyperpolarization did not return to zero by the end of the recording were padded with a linear fit to the last 250ms that was extended to zero (to avoid abrupt changes) Fig. 4: For this analysis one cell was not included, since the dataset for this recording was incomplete.

Slope calculation (onset and decay times)-To
Rectified SPFR sums-Same as for standard sum, but now all negative values in individual SPFRs were set to zeros ( Supplementary Fig. 5b).

Scaled center response SPFR sums-Individual
SPFRs were replaced with a central response trace after rectification scaled to the amplitude of the original positional response. This was done to eliminate the positional change in response width (Supplementary Fig. 5b). Fig. 4d and f and Supplementary Fig. 5a-Positions from all cells were aligned to the center zero position before averaging. All trajectories that were longer than 8 positions were included in this analysis. Some were extracted from the original 8 direction stimuli (Fig. 1), which was used to determine PD. And some from additional trajectories that were presented just along the PD axis. Supplementary Fig. 7-The averaged measured data (presented in Supplementary Fig. 7a) was squared (after baseline subtraction) for both the individual presentations and the two-step positions. To generate the expected sum, individual squared responses were temporally aligned and summed. Supplementary Fig. 8-Averaged SPFRs were aligned temporally to stimulus appearance. A 2-dimensional Gaussian was used to smooth the data both temporally (σ = 250ms) and spatially (σ = 1 position) using MATLAB function imgaussfilt. Contour plots were generated using MATLAB function contourf, with a fixed 'level list' that was manually generated in order to include smaller steps for the hyperpolarized range. An identical procedure was performed on the simulated SPFRs and simulated SPFRs without inhibition (see Conductance model for details).

Statistics
To determine statistically significant differences, one sided unpaired Student's t test were used for comparing groups (Fig. 2e and 4e, and Supplemental Fig. 5b). Data distribution was assumed to be normal but this was not formally tested. No statistical methods were used to pre-determine sample sizes, however our sample sizes are similar to those reported in previous publications [49][50][51] . Data collection and analysis were not performed blind to the conditions of the experiments.

Data Plotting Conventions
All boxplots presented (apart for Fig. 2d) were plotted with MATLAB conventions. Box represents quartile, line represents median, and whiskers represent the farthest point within the q 3 + IQR (q 1 -IQR range). Boxplots for Fig. 2d depict only median and quartiles due to spatial constraints. For

Conductance model
A model T4 neuron was implemented using the morphology of a single T4 cell, reconstructed from Electron Microscopy data. The neuron morphology was generously shared by Kazunori Shonomiya and Janelia's FlyEM project team. The FlyEM team collected a data set containing approximately half of a Drosophila optic lobe, that was imaged with isotropic 8-nm voxels by focused ion-beam milling scanning electron microscopy (FIB-SEM). The sample was prepared from the head of a female fly as previously reported, using high-pressure freezing followed by freeze-substituted embedding 9,52 . A 153 × 85 × 180 μm volume containing connected regions of the lamina, medulla, lobula, and lobula plate was imaged. The imaged volume was segmented automatically based on an algorithm similar to one previously described 53 . NeuTu-EM (https://github.com/janelia-flyem/NeuTu/tree/flyem_release) was then used to proofread the segmented volume, where segmented fragments are neurons are merged and split to form the complete morphology of neuron. A reconstructed T4 neurons was identified based on its distinctive morphology, with dendritic compartments spanning ~20 μm in the medulla and an axon projecting to a distinct layer of the Lobula Plate. The reconstructed neuron morphology contained 344 sections.
To correct for a small number of inconsistencies in the reconstructed morphology, the diameter of each dendritic section was smoothed by performing a moving average of the diameter of five adjacent sections (using the TREES toolbox 54 ). The simulation was implemented and run using NEURON v. 7.4 (http://www.neuron.yale.edu/neuron/). Analog synapses were placed randomly throughout the dendritic arbor (after this compartment, containing 235 sections, was defined manually), and a recording electrode was attached to the soma. After identifying the primary dendritic axis (used to simulate stimulation along the PD-ND axis), we assigned each dendritic section a value corresponding to its projection on this axis (x*, between 0-1). We subdivided the axis into M=11 intervals, where each interval contains an equal number of dendritic sections (21 sections), to map onto the 11 stimulated positions required to enclose the T4 receptive field. We used 11 intervals since the average traces in Fig. 4d, which were the reference for the simulation, spanned positions −5 to 5 (see Analysis subsection). Within an interval, we randomly selected a fixed number of dendritic sections Ne = 9 (Ni = 5) where excitatory (inhibitory) graded synapses were placed. The reversal potential for excitatory synapses was set to 0 mV and to −70 mV for inhibitory synapses. The resting membrane potential was set to −65 mV. To simulate a visual input, mimicking the appearance of the bar at one position, all the synapses in the region were activated with conductance dynamics that were uniform for all E and different, but uniform for all I synapses. Our model simplifies the transformation from visual input to a synaptic conductance change, so while we are not explicitly modelling the optical and neuronal prefiltering that is upstream of T4, these details are implicitly incorporated into the model, since these elements contribute to the SPFRs, which the model was fit to reproduce. To simulate an analog synapse, we used the single electrode voltage clamp (SEVC) point process and injected the inverse of our calculated conductance (see below) into the SEVC R s (zero conductance was change to 1e9 resistance).
We computed the E and I conductance time course at each synapse ( g E t, x * , g I t, x * ) according to the following: where C = {E, I}, and (τ C, rise , τ C, decay ) denote the rise (decay) time constants of the synapse, I c t, x * is the synaptic input, and a C x * scales the conductance based on the location of the synapse on the PD-ND axis. We modeled the amplitude as a Gaussian profile with an overall amplitude parameter A C , a peak location along the dendrite μ C , and a width σ C . We chose a Gaussian profile since it reasonably approximates the spatial profile of E and I inputs measured for the SPFRs (Fig. 2c, Supplementary Fig. 3a), and to reduce the number of parameters needed to describe the inputs to the simulated T4 neuron. The synaptic input, I c t, x * , was modeled as a pulse of unit amplitude with duration T, where T = 20,40,80,160ms, and was identical for all the synapses located within one of the M intervals.
Three additional parameters of the neuronal model are the membrane resistivity (R m ), membrane capacitance (C m ) and axial resistivity (R a ). For all simulations, C m was fixed at C m = 1 μF/cm 2 . We optimized the remaining model parameters, by performing non-linear least square minimization between the numerical simulation results combining all stimulus positions (M=11 intervals) and durations (T) resulting in 44 simulated SPFR responses, and the corresponding measured SPFRs (Supplementary Fig. 6c). The minimization used lsqcurvefit() function from MATLAB's Optimization Toolbox. Having fit the model parameters using the single position flash stimuli, we used the same optimized parameters to simulate the dynamics of the model in response to moving bars (apparent motion stimulus). The moving bar stimulus was implemented by sequentially activating the synaptic inputs along the dendritic axis, with each interval being active for a duration T.

Model manipulations-(1)
We moved all synaptic inputs (99 excitatory and 55 inhibitory synapses) to the first dendritic section (Fig. 5d) (2) We removed all conductance changes mediated by the inhibitory synapses, while keeping all other settings of the model fixed. This was accomplished by setting the duration of all inhibitory synaptic inputs to zero (Fig.  5d).

Single compartment conductance model
We modeled the time course of the membrane potential of a T4 neuron, V t , according to the single compartment dynamics where C M is the membrane capacitance, g L is the leak conductance (resulting in the integration time constant of the neuron τ V = C M /g L ), V L , V E , V I are the resting, excitatory and inhibitory reversal potentials respectively (values in Table 1). The excitatory and inhibitory conductances, g C t , C = E, I , were modeled as a Gaussian weighted linear combination of stimulus location-specific conductances, g C t = ∑ i = 1 M a C x i f C t, x i where, as for the model described in the previous section, a C x i , the conductance change elicited by the presentation of a stimulus I c t, x i in one of M = 15 locations x i , follows the dynamics Stimuli had characteristics identical to those described in the previous section. All the parameters (with the exception of the reversal potentials) were optimized to minimize the mean squared error between model responses to single bar inputs and average T4 SPFRs.
As with our original model, solutions to the single compartment model conformed to one of the two solution clusters. The solutions either had fast (< 10 ms) time constants for E and slow membrane time constant (solution cluster 1), or slower E time constants and negligible membrane time constant (solution cluster 2).
When the time constant of the neuron is negligible compared to the time scale of the stimuli and conductances ( τ V 0), the relative change of membrane potential with respect to the resting potential can be written as , E t = g E t /g L , and I t = g I t /g L . This is the expression used in the model schematics depicted in Figure 6.
Note that if one combination of excitatory and inhibitory conductances elicit an hyperpolarizing response, while a second one produces a depolarizing response, For instance, when E 1 = 0,
A Life Science Reporting Summary is included.

Code Availability
The essential code used to generate the primary results and conduct the simulations for this study are available here: https://figshare.com/projects/Gruntman_et_al_2017_Data/26347

Supplementary Material
Refer to Web version on PubMed Central for supplementary material.      The Barlow-Levick detector 3 combines a slow trailing side 'inhibitory' arm with a faster leading side 'excitatory' arm through an 'AND-NOT' operation that vetoes motion in the null direction. (c) The Adelson-Bergen detector 31 , uses oriented spatiotemporal filters, created from offset spatial and fast and slow temporal filters, to produce directional selectivity. (d) A summary of the T4 mechanism formatted for comparison to the algorithmic models, based on the Torre-Poggio model 35 . The simple RF structure of T4 ( Supplementary Fig. 8), does not require the more complex spatial and temporal filters used in the AB model. Instead we use filters fit to T4 measurements ( Figure 5), that produce a fast, excitatory leading signal and a delayed, inhibitory trailing signal. As in the AB model, directionally selective responses can be obtained through a linear combination of these signals (grey lines). The dynamic nonlinearity operates on the magnitude of excitatory (E) and inhibitory (I) conductances (detailed in Methods) to produce a directionally selective membrane potential response.