visual aftereffects are often considered the by - products of neuronal adaptation processes for the optimization of sensory perception . typical examples are calibration between movement perception and self - produced locomotion , decorrelation to increase efficiency of sensory coding , and gain control of sensory stimuli to extend the dynamic range of detection ( thompson and burr , 2009 ) . a particular example of visual aftereffects is the motion aftereffect ( mae ) , in which exposure to continuous , coherent , moving visual stimuli induces , following the cessation of the moving stimulus , the illusory perception of motion in the opposite direction . mae was first described in 330 bc by aristotle in his book parva naturalia ( trans . since then , many studies have described different psychophysical aspects of the  phenomenon ( chaudhuri , 1990 , masland , 1969 , mather et  al . , 1998 , wohlgemuth , 1911 ) . in addition to perceptual mae , continuous , coherent , moving visual stimuli can induce oculomotor mae ( braun et  al . , 2006 , chen et  al . , 2014 , watamaniuk and heinen , 2007 ) . despite the vast literature on mae , only a handful of studies have examined the underlying neuronal mechanisms . mae was found to be associated with either a decrease or an increase in the response of direction - selective neurons . direction - selective neurons are specialized for detecting motion along specific axes of the visual field , and they respond to visual stimulus moving in a given direction ( the preferred direction ) but do not respond or respond less to those  moving in the opposite direction ( the null direction ) . using single - neuron recordings , mae - associated adaptations have been described in different brain regions of different animal species : the rabbit s retina ( barlow and hill , 1963 ) , the owl monkey s medial temporal lobe ( petersen et  al . , 1985 ) , the cat s primary visual cortex ( giaschi et  al . , 1993 ) , the pigeon s nucleus lentiformis mesencephali ( niu et  al . , 2006 ) , and the fly s lobula plate ( srinivasan , 1993 ) . despite these advances , we lack a comprehensive explanation of the underlying mechanisms and the neuronal correlates of mae at the circuit level . to that end , and to shed light on the potential mechanisms underlying visual motion perception , we used transgenic zebrafish larvae expressing the genetically encoded calcium indicator gcamp3 . we monitored the dynamics of large neuronal circuits from different brain regions using two - photon microscopy in an intact , non - anesthetized , behaving vertebrate model . in zebrafish , the retinal ganglion cells ( rgcs ) project to at least  ten arborization fields , with the optic tectum ( ot ) being the largest ( burrill and easter , 1994 , nevin et  al . , 2010 ) . the optic tectum is the zebrafish s most complex layered brain structure , and it is essential for visually guided prey detection and capture ( gahtan et  al . , 2005 , direction - selective neurons are found in both the retina ( nikolaou et  al . , 2012 ) and the optic tectum ( gabriel et  al . , 2012 , gebhardt et  al . , 2013 , , 2013 , romano et  al . , 2015 ) . using two - photon calcium imaging , it has been shown that the pretectum and the superficial layers of the optic tectum respond to large - field coherent visual motion presented to the contralateral eye ( portugues et  al . , 2014 ) . similarly , unilateral stimulation of the pretectal area induced eye movements resembling the optokinetic response ( okr ; kubo et  al . , we show that following the presentation of a coherently moving visual pattern ( conditioning stimulus , cs ) capable of inducing okr , zebrafish larvae generated , in the absence of sensory stimuli , optokinetic movements in the direction opposite that induced by the cs . reminiscent of mae , these results suggest that following the cs , the larvae experienced perception of visual motion in the opposite direction . using optogenetics to  transiently block eye movements during the presentation of the cs , we show that neither muscular fatigue nor eye proprioception feedback plays a role in the generation of optokinetic mae - like behavior . moreover , two - photon laser ablation of the optic tectum significantly reduced mae - like behavior . using two - photon calcium imaging of transgenic zebrafish larva expressing gcamp3 , we monitored the neuronal activities of the larva s two main visual centers ( retina and optic tectum ) . we found that following stimulus cessation , direction - selective neurons tuned to the direction of the cs displayed strong habituation in the optic tectum but not in the retina . furthermore , we observed sustained rhythmic neuronal activity associated with the optokinetic mae - like behavior among a specific group of direction - selective tectal neurons , thus arguing for a neuronal correlate of the mae - like behavior . finally , an empirical mathematical model based on the competition between direction - selective tectal neurons related to their activity could reproduce the okr , the optokinetic mae - like behavior , and the unconditioned spontaneous eye movements observed in the absence of moving visual stimulation . overall , our results propose a functional neuronal circuit in the zebrafish optic tectum that is capable of generating perception of visual motion . to test whether the zebrafish larva is capable of perceiving mae , we took advantage of the larva s okr . okr is a serial combination of smooth pursuits and rapid saccade eye movements generated upon the presentation of a moving visual stimulus . during okr , the smooth pursuits follow the stimulus direction to stabilize the moving external world on the retina , while the saccades reset the eye s position ( huang and neuhauss , 2008 ) . this pursuit - saccade eye - movement pattern repetitively persists throughout the period of stimulation ( figure  1d ) . in the absence of large - field coherent visual motion , the larva performs spontaneous eye rotations composed of a rapid saccade followed by an eye fixation period and a second saccade in the opposite direction ( easter and nicola , 1997 , miri et  al . , 2011 ) , therefore , it is possible to infer whether the larva is perceiving motion and in which direction by looking at the eye - rotation kinematics ( orger et  al . , 2008 , orger and baier , 2005 , qian et  al . , 2005 , that zebrafish larvae can experience mae , we embedded zebrafish larvae in low - melting agarose . when the agarose jellified , we transferred the larvae to an elevated stage within the center of a circular chamber . the chamber was then filled with fish embryo medium and the agarose around the eyes was removed to allow movement . under these conditions , we monitored the eye movements of 79  days post - fertilization ( dpf ) larvae ( figures 1a and 1b ) while projecting on a screen around the larva static , large - field , black - and - white , square - wave gratings for a period of 500  s ( pre - cs control period ) . then , we presented the cs ( unidirectionally drifting square - wave grating ) at different speeds ( 17/s , 26/s , or 59/s ) and for different durations ( 50 , 100 , 200 , 250 , 400 , or 500 s ) , and in both directions ( toward the left or right ) . following the cessation of the cs , the moving grating was stopped and kept stationary for a duration of 500  s ( post - cs control ) . for clarity , we defined the cs direction as the direction of the cs despite its direction ( leftward or rightward ) and the mae direction as the opposite one ( the direction expected if mae was generated ) . during the pre - cs - control period , zebrafish larvae generated spontaneous eye movements ( average duration of saccades , 0.12  0.04 s ; average duration of fixations , 20  10 s ) . in some cases , the eye fixations slowly drifted in a centripetal direction ( figure  1c ) . in contrast to this stereotypic spontaneous eye behavior , the presentation of a coherent motion stimulus ( the cs ) induced a robust okr ( figure  1d ) . following the cessation of the cs ( post - cs control period ) , we observed repetitive , unidirectional eye - rotation pursuit - saccade - like movements in the direction opposite that induced by the cs ( mae direction ; violet curve in figure  1d ; movie s1 ) . similar eye - pursuit movements have been observed in humans during mae ( braun et  al . , we thus interpret these pursuit - saccade movements as an indication that the larva was experiencing visual movement in the opposite direction of the cs , reminiscent of mae , and called these conditioned eye rotations optokinetic mae - like behavior . like humans , who perceive mae with lower velocity and smaller displacement than the cs ( masland , 1969 , wohlgemuth , 1911 ) , the zebrafish larva optokinetic mae - like behavior was composed of eye pursuits of lower rotation speeds and smaller amplitudes than those observed during the cs ( figure  1d ; supplemental experimental procedures ) . to quantify the optokinetic mae - like behavior , we defined the mae index ( figures 1e and 1f ; supplemental experimental procedures ) . this index represents the ratio of the difference between the average number of pursuits in the cs and mae directions and the total average number of eye movements . the mae index will be equal to 1 if only pursuits in the mae direction are observed . it will be equal to 1 if only pursuits in the cs direction are registered and around 0 for spontaneous eye movements ( scanning eye movements or an equal number of pursuits in the cs and mae directions ) . the mae index was computed during the post - cs control for consecutive periods of 50  s and for a  total of 500 s. for statistical purposes , we defined the control index as the mae index during the pre - cs control period . by comparing the statistically significant difference between the mae index and the control index for experiments in which we presented cs of different durations , we observed that the induction and duration of optokinetic mae - like behavior depended on the cs duration ( figure  1f ) . for cs durations of 50 and 100 s , the mae index was not significantly different from the control index ( p > 0.05 for all intervals , kruskal - wallis ) . for cs lasting 200 and 250 s , we observed a significant difference for the first 100  s of the post - cs control period . for cs lasting 300 and 400 s , we observed a significant difference for the first 150  s ( p  < 0.05 , kruskal - wallis ) . for a cs of 500 s , the mae index was significantly higher than the control index for the first 300  s following the end of the cs ( p  < 0.01 , kruskal - wallis ) , and it was significantly higher than those induced by the cs of 200400  s ( p  < 0.01 , kruskal - wallis ) . therefore , to induce the optokinetic mae - like behavior , the larva needs to be stimulated with a cs of at least 100 s. the duration of the mae - like behavior depended on the further increase in the cs duration ( figures 1f and 1 g ) . the optokinetic mae - like behavior was observed in  85% of the experiments in which we used a cs of 500  s ( the  presence of optokinetic mae - like behavior was defined as a mae index larger than 95% of the control index for at least the first 50  s of the post - cs control period ) . along the same lines , we found that the length of mae was positively correlated with the level of habituation of the number of pursuits during the cs ( figure  s1d ) . we then tested the effect of the cs velocity ( 17/s , 26/s , and  59/s ) on the induction of optokinetic mae - like behavior . although we observed a tendency for a larger mae index at cs velocities of 26/s , we found few significant differences in the mae index during the 500  s of the post - cs control periods for the three velocities tested ( p > 0.05 , kruskal - wallis ) ; however , they did not follow the same tendency . these results suggest that cs velocity , within the range of 17/s59/s , does not play  a major role in modulating optokinetic mae - like behavior ( figure  s1a ) . we also studied the effect of different patterns of static visual stimuli during the post - cs control period . we tested three conditions : ( 1 ) a static version of the grating presented during the cs ( white - black square grating ) ; ( 2 ) a stationary noise pattern , built by shuffling the pixel positions of the first condition ; and ( 3 ) a black screen ( supplemental experimental procedures ) . quantification of optokinetic mae - like behavior , by means of the mae index , did not show any significant difference among the three conditions ( p > 0.05 , kruskal - wallis ; figure  s1b ) . we thus suggest that visual feedback during the post - cs control period is not necessary for the generation of optokinetic mae - like behavior . in contrast to results obtained using other animal models , in which a static visual pattern is necessary to perceive mae ( anstis et  al . , 1998 , 2008 ) , zebrafish larvae are capable of perceiving mae in complete darkness . because no visual feedback is necessary to drive mae in zebrafish , mae represents a case in which perception emerges in the absence of visual stimuli ; therefore , it is a useful tool to study the neuronal dynamics underlying visual motion perception in zebrafish . to investigate the mechanism underlying mae , we first asked whether eye muscular fatigue or eye proprioception during the  cs is required for the generation of optokinetic mae - like behavior . for this purpose , we blocked eye movements exclusively during the cs by means of optogenetics . following the cessation of the cs , we released this suppression to assess the induction level of optokinetic mae - like behavior . to block eye movements via optogenetics , we used transgenic larvae expressing halorhodopsin in their entire nervous system ( huc : gal4;uas : nphr ( halorhodopsin)-mcherry line ; supplemental experimental procedures ; arrenberg et  al . , halorhodopsin was locally activated via a 565  nm light - emitting diode ( led ) coupled to a 100  m optic fiber ( figure  2a ; supplemental experimental procedures ) that was positioned unilaterally roughly above rhombomere 5 , which was previously found to affect directional saccade generation in zebrafish when optogenetically inhibited ( schoonheim et  al . , 2010 ) . this location likely corresponds to the nucleus abducens ( ma et  al . , 2014 ) . to assess the effect of halorhodopsin activation on eye movements during cs , we presented to the larva a visual stimulus consisting of a grating moving at 26/s for 300 s. the 565  nm led was turned on after the first 100  s for a period of  100 s. upon halorhodopsin activation , okr was robustly suppressed , and it almost immediately recovered when the stimulating led was switched off . because the optic fiber covered rhombomere 5 unilaterally , the eye - movement - suppression effect was unidirectional . it fully blocked okr toward the ipsilateral direction from the optic fiber positioning , including both the saccades and the pursuits ( the okr direction toward the side on which the fiber was positioned ; figure  2c ; movie s2 ) . once we were able to effectively prevent okr using optogenetics , we tested the effect of cs - induced eye movements on the generation of optokinetic mae - like behavior . we monitored spontaneous eye movements for 350  s ( pre - cs control period ) . then , we visually stimulated the larva with the cs for 500  s while simultaneously activating halorhodopsin . when the cs ceased , halorhodopsin activation was stopped and eye movements were monitored for an additional period of 500  s ( post - cs control ; figure  2d ) . using this paradigm , we were able to abolish or significantly reduce okr ( p  < 0.01 , kruskal - wallis ; figures 2d and 2e ) . despite the significant reduction in the number of eye movements during the cs , we still observed optokinetic mae - like behavior . the number of optokinetic mae - like pursuits was not significantly different from the experiments in which halorhodopsin was not activated ( p > 0.05 , kruskal - wallis ; figure  2e ) . these results suggest that neither eye muscular fatigue nor eye proprioception during the cs plays an essential role in the generation of optokinetic mae - like behavior . to further study the involvement of sensory and motor systems in the generation of the mae - like behavior , we took advantage of another robust behavior of the larva , the optomotor response ( omr ) . during omr , larvae swim by performing directional tail deflections in the direction of a unidirectional coherent motion visual stimulus ( portugues and engert , 2009 ) . although okr and omr share the same behavioral goal , the motor centers controlling both behaviors are different . thus , observing mae - like behavior at the level of omr would suggest that mae is generated within an upstream brain region common to both eye and tail motor centers , most likely the larva s sensory visual system . to test this hypothesis , we presented to the larvae the following experimental paradigm : cs ( moving grating at 26/s for 500 s ) followed by a post - cs control period ( stationary grating for 500 s ) . in this experiment , we removed the agarose around the eyes and around the tail so that the larvae could perform both okr and omr behaviors ( figures 2f and 2 g ) . during the cs however , tail movements were less frequent than eye movements ( only 39%  16% of eye movements were associated with a tail movement ) . during this period , 74%  13% of the cs - induced tail deflections were performed in the direction of the cs ( figures 2 g and 2h ) . during post - cs control , we observed the expected optokinetic mae - like behavior , which was associated with tail flips ( 68%  37% of pursuits had an associated tail flip during post - cs control ) . the tail - flip direction was accordingly reversed ( 73%  13% of tail deflections were performed in the opposite direction of the cs ; figures 2 g and 2h ) . these results suggest that a sensory brain region , rather than the eye s motor circuitry , is involved in the generation of the zebrafish mae - like behavior . therefore , to test whether the optic tectum is involved in the generation of mae - like behavior , we studied the induction of mae in larvae whose tecta were ablated . to perform the ablations , we scanned the entire periventricular layer of the optic tectum of huc : gcamp5 larvae using a two - photon microscope ( supplemental experimental procedures ) . the ablations induced massive tectal apoptosis ( dunn et  al . , 2016 ) . as a first sign of cell damage , we observed a large relative increase in gcamp5 fluorescence , especially in the nucleus ( movie s3 ) . to test for apoptosis of the tectal neurons , we labeled the larvae with acridine orange , a marker of apoptosis ( paquet et  al . , 2009 ) . the labeling was performed either immediately after the ablations or 24  hr after the ablations . in both cases , acridine orange labeled almost the entire tectum , confirming tectal ablation ( figures 3a and 3b ; movie s3 ; supplemental experimental procedures ) . after a 24  hr recovery period , we tested the capacity of inducing the mae - like behavior in tectum - ablated larvae ( figure  3 ; supplemental experimental procedures ) . to quantify the effect of the tectal ablation on the cs - induced eye movements  and the optokinetic mae - like behavior , we calculated the mean of the difference between the number of pursuits in the cs direction and those in the mae direction ( supplemental experimental procedures ) . intact larvae showed okr with a gradual reduction in the number of performed pursuits along the cs . this number of pursuits decreased according to two time constants : 12 and 195  s ( figure  s5a ) . in contrast , fitting the number of pursuits in tectum - ablated larvae with just one time constant or two time constants gave similar results ( the coefficient of the second exponential was negligible with respect to the first ; ratio  = 0.2 ) . moreover , the observed average number of pursuits in the direction of the moving stimulus was significantly lower in tectum - ablated larvae than in intact ones during the first and the last 50  s of the cs ( intact , 14.06 ; ablated , 8.62 ; p  < 0.01 , kruskal - wallis ; figure  3c ) . during the first 100 s , following the cessation of the cs ( post - cs period ) , tectum - ablated larvae showed a significant lower average number of optokinetic mae - like pursuits ( intact , 5.11 ; ablated , 2.44 ; p  < 0.01 , kruskal - wallis ; figure  3c ) , indicating a reduction in the optokinetic mae - like behavior ( n  = 26 trials from 4 larvae ) . thus , the decrease in rather than the full blockage of mae could be explained the inability to ablate the optic tectum . as a control experiment , we ablated the interpeduncular nucleus ( ipn ) , a non - sensory processing region that projects to modulatory brain regions such as the ventral tegmental area ( vta ) and raphe nucleus . ipn ablations did not affect the two habituation time constants during okr ( 16 and 218 s ) and did not affect mae . however , we observed a general increase in the number of pursuits during okr ( figure  s1c ) . a potential hypothesis is that ablation of the  ipn increased arousal or alertness and therefore elicited a stronger okr response . as previously shown by the ablation of the rgc terminals in the optic tectum neuropil ( roeser and baier , 2003 ) , ablation of a large portion of the tectal neurons did not abolish okr , suggesting that the tectum does not play a major role in its generation . however , the tectum seems to be necessary for the initial strong behavioral response to novel stimuli and for cs - induced behavioral habituation ( decrease in the okr gain ) . similarly , the strong novelty response and habituation effect were present  in the cs - induced neuronal responses in the optic tectum but absent in the retina ( figures s2e and s2f ) . the lack of cs - induced behavioral habituation could explain the observed reduction of mae in ablated larvae . we therefore suggest that mae could emerge as a consequence of tectal adaptation to the cs . to test whether the cs induces adaptation of specific tectal neurons , we monitored the activity of the larva s two main visual centers : the retina and the optic tectum . for this purpose , we performed two - photon calcium imaging of zebrafish larvae expressing the genetically encoded ca indicator gcamp3 . we first immobilized the larvae in low - melting agarose and paralyzed them ( 0.3  mg / ml pancuronium bromide ; tocris bioscience ) to avoid any possible rotation of the eyes . to test for potential adaptations of the cs - induced responses of direction - selective neurons in both the retina and the optic tectum ( figures s2e and s2f ) , we used the following paradigm , consisting of three steps : ( 1 ) sequential presentation to the larva of light - moving bars in two directions ( cs and mae directions , presented every 10 s ) ; ( 2 ) presentation of the cs , consisting of a continuous series of moving bars in the same direction for 500 s ; and ( 3 ) post - cs control , in which we presented light - moving bars in alternate directions every 10  s for a period of 500  s ( supplemental experimental procedures ) . the first step determined the direction selectivity of neurons ( cs or mae directions ) and served as a control for the amplitude of their ca responses before the presentation of the cs . the amplitudes were then compared to those induced by the moving bars presented during the post - cs control period . this comparison enabled us to test for a potential adaptation of direction - selective neurons following the cs . , we used the ath5:gal4;uas : gcamp3 transgenic line expressing gcamp3 almost exclusively in the retina ( supplemental experimental procedures ) . this line enabled monitoring of the rgc terminal activity at the tectal neuropil . because cellular resolution is not possible under these conditions , we segmented the tectal neuropil using a grid of square regions of interest ( srois ; nikolaou et  al . , 2012 ; supplemental experimental procedures ) . to quantify a possible modulation of the sroi directional responses following the presentation of cs , we defined an adaptation index ( supplemental experimental procedures ) . to calculate this index , we first calculated the ratio between the population responses of direction - selective srois to the moving bars in the cs direction before and after the presentation of cs . this value was then divided by a similar ratio computed for responses to moving bars in the mae direction . zero indicates equal directional responses before and after cs presentation . using the adaptation index , we observed that cs direction - selective rgcs were slightly habituated with respect to zero ( p  < 0.01 , wilcoxon signed rank ; figures 4a and 4b ; figure however , the dynamics of the habituation did not match the temporal scale of the optokinetic mae - like behavior ( 150200 s ; figure  4b ; figure  s2d ) . to test whether direction - selective neuronal responses in the  optic tectum were modulated by cs , we used a similar experimental design in zebrafish larvae expressing gcamp3 under a pan - neuronal promoter ( huc ; supplemental experimental procedures ) . this transgenic line of zebrafish enabled monitoring , with single - neuron resolution , of a large and significant part of the periventricular layer of the optic tectum ( 839  38 neurons per optical plane ) . direction - selective neurons represented around 14% of the monitored neurons ( 59  8 and 55  7 neurons per optical plane for the cs and the mae directions , respectively ) . in contrast to the rgcs , direction - selective tectal neurons showed an adaptation index of significantly larger negative values ( p  < 0.01 , wilcoxon signed rank ; figures 4a and 4b ; figure s2f ) for a period that better matched the timescale of the optokinetic mae - like behavior ( 150200 s ; figure  4b ; figure  s2d ) . moreover , this habituation observed among direction - selective neurons in the optic tectum was significantly larger than the habituation observed in the direction - selective rgcs ( p  < 0.01 , wilcoxon rank sum ; figure  4b ) . therefore , we suggest that the zebrafish larva optokinetic mae - like behavior mainly reflects habituation of direction - selective tectal neurons in the direction of the cs . because the ablation of the optic tectum affected the generation of mae - like behavior , and mae - like - related neuronal habituation was observed in the larva s optic tectum rather than in the retina , we then investigated the tectal neuronal dynamics associated with optokinetic mae - like behavior . to that end , we imaged tectal activity while simultaneously monitoring eye rotations in non - anesthetized and non - paralyzed larvae using the following experimental procedure . first , we determined direction - selective neurons by sequentially presenting to the larva light - moving bars in two directions . from the responses to these stimuli , we classified the imaged neuronal population into three groups : non - direction - selective neurons , direction - selective neurons in the direction of the cs , and direction - selective neurons in the opposite direction ( mae direction ) . second , during a pre - cs control period , we allowed 500  s of spontaneous  eye movements and tectal neuronal activity in the absence  of visual feedback ( black screen ) . third , during the cs period , a continuous moving bar ( in either the cs or the mae direction ) was presented for a duration of 500 s. lastly , during a post - cs control , larvae were placed under the same conditions as for the pre - cs control period ( supplemental experimental procedures ) . during the post - cs control period , we observed robust optokinetic mae - like behavior ( figure  s2d ) . during the same period , these synchronous activities were mainly observed among direction - selective neurons sensitive to the mae direction ( figure  5a ) . to test whether the synchronous activities of the mae direction - selective neurons were associated with the optokinetic mae - like behavior , we cross - correlated this activity with the kinematics of the eye rotations during the post - cs period ( figure  5b ) . to compare the correlations across different experiments , we normalized the eye rotations according to the 95 percentile value , and then we calculated the mean of the total neuronal activity of the mae direction - selective cells ( supplemental experimental procedures ) . next , to test for the significance of the correlations , we generated a null model for the neuronal activity . we observed that the mae direction - selective neurons were significantly more correlated with the eye pursuits in the mae direction than those of the null model ( p  < 0.01 , kruskal - wallis ; figure  5b ) . a similar phenomenon was observed for the cs direction - selective neurons ( p  < 0.01 , kruskal - wallis ; figure  5c ) . although not significantly different , the correlations of mae direction - selective neurons tended to be higher than those of cs direction - selective neurons ( p  = 0.06 , kruskal - wallis ; figure  5d ) . to quantify the difference in the correlation levels , we subtracted the peak of the correlations from 2 sd above the mean of correlations of the null models ( figure  5d ) . finally , the distribution of the ratios between the activity of mae and that of cs neurons at the time of each eye movement in the mae direction , during the post - cs period , was largely skewed to positive values ( for the ratio values above 0.06 and below 0.06 , 72% were positive and 28% were negative and the average ratios were 30.1 and 6.4 , respectively ) . thus , we suggest that an imbalance between the activity of the mae and that of the cs direction - selective neuronal population drives the direction of the eye movements . during mae , this imbalance is biased toward mae direction - selective neurons ( positive values ; figure  5e ) . we took advantage of the rhythmic nature of optokinetic mae - like behavior and the population neuronal events during the post - cs period to perform spectral analysis . the normalized  power spectrum of optokinetic mae - like movements showed significant peaks at a fundamental frequency ( 0.048  0.008  hz ) and its harmonics ( n  = 9 trials from 8 larvae ; figure  6a ; supplemental experimental procedures ) . we then performed the same type of  spectral analysis on the population activity of  the  three neuronal groups : non - direction - selective , cs direction - selective , and mae direction - selective neurons . during the  post - cs control period , the mae direction - selective group exhibited a normalized power - spectrum profile that closely matched that of the optokinetic mae - like behavior , with significant large power values around the optokinetic mae - like fundamental frequency and its harmonics . in contrast , the cs direction - selective and non - direction - selective neuronal groups showed a more uniformed normalized power spectrum without preference for any particular frequency ( figure  6a ) . to quantify the level of association between the synchronous activities of the mae direction - selective , cs direction - selective , and non - direction - selective neuronal groups with that of the optokinetic mae - like behavior , we measured for each neuronal group the normalized power spectrum of their activities during the post - cs control period ( figure  6a ) . we then calculated the  normalized power for the frequency bands significantly associated with the mae - like okr for each of the three neuronal groups ( figure  6b ; supplemental experimental procedures ) . to compare across different experiments , the power of the frequencies was normalized by the mean power of all neurons across the significant frequencies . this method enabled us to compare the relative power of the three direction - selective neuronal groups specifically within the frame of optokinetic mae - like behavior . we observed that in all experiments , mae direction - selective neurons showed significantly higher power than that of cs direction - selective and non - direction - selective neurons . as a control , we performed the same analysis , but for frequency bands not significantly associated with optokinetic mae - like behavior ( figure  6b ; supplemental experimental procedures ) . we observed that none of the neuronal groups showed significantly different power levels . during the mae - like period , the rate of ca events for all three neuronal groups was similar ( cs direction - selective neurons , 0.08  0.03 ; mae direction - selective neurons , 0.08  0.04 ; non - direction - selective neurons , 0.07  0.03 ) . therefore , the difference in power among the different neuronal groups during the optokinetic mae - like behavior was specific to frequencies associated with mae - like behavior , rather than being a direct consequence of an overall increase in the activity of mae direction - selective neurons . by correlating the population activity of the tectal direction - selective neurons with the eye - rotation kinematics ( supplemental experimental procedures ) , we found two classes of neurons : ( 1 ) direction - selective neurons that did not show spontaneous activity associated with optokinetic mae - like behavior and ( 2 ) direction - selective neurons that showed correlated activity with optokinetic mae - like behavior during the post - cs period ( eye - motion - selective neurons ) . these direction - selective and eye - motion - selective neurons represented 26%  0.06% of the total population of direction - selective neurons ( figure  s3b ) . finally , we observed that the synchronous ca events associated with the mae - like behavior emerged mainly from the activity of single neurons among the eye - motion - selective neuronal population . their rhythmic activity was highly correlated and phase locked to the synchronous population events ( figures 6c and 6d ) . these rhythmic neurons were sparsely dispersed within the tectal network , without showing clear topography ( figure  6e ) . overall , these results represent the first example of sustained rhythmic activity as a neuronal correlate of mae . the competition between two directional - selective neuronal populations has long been thought to underlie mae , but this  has never been experimentally demonstrated . our results show that during the presentation of the cs , the cs direction - selective neurons are more active than those in the opposite direction . due to cs - induced habituation , during the post - cs control period , cs direction - selective neurons are less spontaneously active than mae direction - selective neurons ( figure  5a ;  figure  s3a ) . a comparison between these two populations could qualitatively explain the mae - like effect that we  observed . therefore , the mae - like behavior could emerge from a tectal sub - circuit that compares the activities of both direction - selective neuronal groups and generates adequate directional motor commands . this hypothesis is supported by the identification of direction - selective and eye - motion - selective neuronal groups . to consider whether our findings could be explained within the  framework of this hypothesis , we developed an empirical mathematical model . this model was based on a comparator tectal sub - circuit consisting of two cross - inhibiting neuronal populations : a cs comparator and a mae comparator , each of them receiving excitatory inputs from the corresponding group of direction - selective neurons ( figure  7a ; supplemental experimental procedures ) . these comparator populations represent the sub - groups of mae direction - selective neurons displaying  synchronous rhythmic activity associated with optokinetic mae - like behavior ( figures 5a and 6a ) . the comparator circuit  computes the difference between the activities of the two groups of direction - selective neurons : each rhythmic stimulation produces a winner - takes - all dynamic in which one of the two comparator populations dominates the other in an input - dependent manner . in the model , the rhythmicity was implemented by a periodic input of similar magnitude on the two comparator populations . this periodic stimulus could originate from an intrinsic rhythmic tectal activity , a rhythmic tectal afferent , or a proprioceptive input associated with the eye saccades . we found that paralyzed larvae incapable of moving their eyes did not show , following the cessation of the cs , spontaneous rhythmic activity among mae direction - selective neurons ( figure  s4 ) . thus , we suggest that the neuronal rhythmicity is generated by the closed loop between the neuronal command to move the eyes and the eyes proprioception induced by the physical movement of the eye . simulations of the model resembled the experimental results ( figures 7b and 7c ; figures s5c , the two comparator populations received similar inputs ; thus , each population won in an alternative manner ( laing and chow , 2002 ) . fluctuations in the modeled rhythmic inputs made this alternation imperfect . during the cs , inputs from the cs direction - selective neurons biased the competition in favor of the cs comparator neurons . following the cessation of the cs , spontaneous inputs from the non - habituated mae direction - selective neurons were slightly larger than those from the habituated cs direction - selective ones . the habituation slowly decreased until it reached control values , bringing the model back to the pre - cs  regime . using parameters obtained from experimental data ( behavioral and neuronal adaptation time constants and the mean and peaks of spontaneous activity frequency of cs direction - selective neurons ; supplemental experimental procedures ) , the model was capable of reproducing the temporal dynamics of the neuronal and mae - like behavior and the spontaneous scanning - like eye movements . the dependence of the mae duration on the duration of the cs was also reproduced relatively well ( figure  7c ; figures s5c these results suggest that our experimental findings are sufficient for the generation of several features associated with larva s mae - like  behavior . we thus believe that the tectal circuit underlying the comparison between the activity of the cs direction - selective neurons and that of the mae direction - selective neurons constitutes a plausible explanation for the observed mae - like behavior . previous studies have found mae or mae - like behaviors in a variety of organisms ( barlow and hill , 1963 , giaschi et  al . , 1993 , mather et  al . , 1998 , niu et  al . , 2006 , petersen et  al . , 1985 , srinivasan , 1993 , wohlgemuth , 1911 ) . here , we report for the first time that zebrafish perceive mae during early larval development . thus , the ability to induce mae in developing neuronal circuits supports the hypothesis that mae is generated as an unavoidable consequence of the brain s basic computational principles for visual motion detection . in contrast to humans , zebrafish larvae are capable of perceiving mae in the absence of any visual feedback ( in darkness ) , suggesting that mae reflects exclusively visual motion perception without the involvement of visual detection and that visual motion perception can emerge solely from the neuronal circuits spontaneous dynamics . this difference could emerge from mae - associated additional adaptations in cortical areas ( e.g. , v1 and middle temporal area [ mt ] ; kohn and movshon , 2003 , watamaniuk and heinen , 2007 ) . these cortical circuits could have evolved to reduce undesirable motion perception or afternystagmus following sustained visual motion . , 2014 , roeser and baier , 2003 ) , we observed that the optic tectum was not necessary for the generation of okr . however , tectal ablations prevented the behavioral habituation to the cs ( as demonstrated by the habituation of okr ) and influenced the generation of the  mae - like behavior . also , given that eye movements were not necessary for the generation of mae and that optokinetic mae - like behavior was observed within the frame of omr , we hypothesized that the generation of mae was probably linked to sensory brain regions rather than motor centers . using two - photon calcium imaging of gcamp3 larvae , we observed that mae - like behavior was associated with the habituation of tectal neurons sensitive to the direction of the cs , a habituation that was not relayed from the retina . thus , we suggest that the optic tectum is not necessary for the generation of the okr but is indispensable for the initial strong novelty response and its subsequent habituation . tectal modulation of okr could be achieved via recurrent projections between the optic tectum and the pretectum ( vanegas et  al . , 1984 ) . the latter has been shown to be necessary and sufficient for the generation  of okr ( kubo et  al . , 2014 ) . furthermore , by simultaneously monitoring eye movements and the optic tectum neuronal dynamics in awake intact larvae , we observed a specific sub - group  of mae direction - selective neurons whose synchronous rhythmic activities were associated with optokinetic mae - like behavior . we created an empirical mathematical model in which habituation of the tectal direction - selective neurons generates an imbalance between the spontaneous activity of the mae direction - selective and that of the cs direction - selective neuronal circuits . this imbalance is then computed by a tectal circuit comparator , which generates the directional eye and tail motor commands . the model was capable of reproducing both behavioral and neuronal - circuit - dynamic aspects of mae , as well as spontaneous eye - movement kinematics . this model proposes a simple functional neuronal circuit capable of generating perception of visual motion in zebrafish . more specifically , we suggest that motion perception , at least within the context of mae , emerges from the ability of the direction - selective tectal neurons to drive a tectal comparator circuit . finally , neuronal sustained activity has been traditionally associated with working memory processes lasting for tens of seconds ( quintana and fuster , 1999 , romo et  al . , 1999 , , we observed that visually induced sustained rhythmic activities could also underlie perceptual neuronal processes , such as visual motion perception lasting for an unprecedented extent ( hundreds of seconds ) . our empirical model sheds light on a potential circuit mechanism for the generation of these sustained activities underlying the perception of mae . zebrafish embryos were collected and raised at 28.5c in 0.5 e3 embryo medium ( e3 in mm : 5 nacl , 0.17 kcl , 0.33 cacl2 , 0.33 mgcl2 ph 7.2 ; westerfield , 1995 ) . larvae were kept under 14/10 hours on / off light cycles and fed starting at 6 dpf . all experiments were approved by le comit dthique pour lexprimentation animale charles darwin ( 03839.03 ) . the visual stimulus consisted of a square - wave moving grating ( conditioning stimulus [ cs ] ) covering the entire stimulation field ( 90  90 , azimuth  height , of the larva s field of view ) . in order to minimize projection distortions due to the curvature of the screen visual stimulation was generated with psychophysics toolbox extensions ( brainard , 1997 , pelli , 1997 ) for matlab ( the mathworks ) . the setup was based on a mom system ( sutter ) with a 25 na 1.05 olympus objective and a mai - tai deepsee ti : sapphire laser tuned at 920  nm . the filters consisted of an ff705 dichroic filter ( objective dichroic ) , an aff01 - 680 short - path filter ( ir blocker ) , and an ff01 520/70 band - pass filter , all from semrock . the photomultiplier ( pmt ) was an h1070 ( gallium arsenide phosphide [ gaasp ] ) from hamamatsu . the emission signal was pre - amplified with an sr-570 ( stanford research systems ) and acquired using scanimage ( pologruto et  al . , 2003 ) at 3.91  hz , with 256   256 pixels resolution . in order to infer the ca - related fluorescence events associated with neuronal activity , we calculated the statistical significance of single - neuron calcium dynamics in an adaptive and unsupervised manner . we considered that any event in the fluorescence time series data belonged to either a neuronal activity process , a , or an underlying noisy baseline , b. in order to discriminate , with a desired degree of confidence , between these two sources , we built a data - driven model of b. moreover , we took into account the biophysical constraints of the fluorescent calcium indicator ( gcamp3 fluorescence decay time constant ) . non - significant portions of the df / f traces were then set equal to 0 in all subsequent analysis ( for more details , see romano et  al . , 2015 ) . v.p .- s . carried out the behavior and imaging experiments and analyzed the data . s.a.r . participated in discussions about the data , developed imaging analysis , wrote software , and built the setup . conceived the experiments and the model , built the setup , and wrote the manuscript .
summaryfollowing moving visual stimuli ( conditioning stimuli , cs ) , many organisms perceive , in the absence of physical stimuli , illusory motion in the opposite direction . 
 this phenomenon is known as the motion aftereffect ( mae ) . here 
 , we use mae as a tool to study the neuronal basis of visual motion perception in zebrafish larvae . using zebrafish eye movements as an indicator of visual motion perception , we find that larvae perceive mae . 
 blocking eye movements using optogenetics during cs presentation did not affect mae , but tectal ablation significantly weakened it . using two - photon calcium imaging of behaving gcamp3 larvae , we find post - stimulation sustained rhythmic activity among direction - selective tectal neurons associated with the perception of mae . 
 in addition , tectal neurons tuned to the cs direction habituated , but neurons in the retina did not . finally , a model based on competition between direction - selective neurons reproduced mae , suggesting a neuronal circuit capable of generating perception of visual motion .