A novel setup for simultaneous two-photon functional imaging and precise spectral and spatial visual stimulation in Drosophila

Motion vision has been extensively characterised in Drosophila melanogaster, but substantially less is known about how flies process colour, or how spectral information affects other visual modalities. To accurately dissect the components of the early visual system responsible for processing colour, we developed a versatile visual stimulation setup to probe combined spatial, temporal and spectral response properties. Using flies expressing neural activity indicators, we tracked visual responses in the medulla, the second visual neuropil, to a projected colour stimulus. The introduction of custom bandpass optical filters enables simultaneous two-photon imaging and visual stimulation over a large range of wavelengths without compromising the temporal stimulation rate. With monochromator-produced light, any spectral bandwidth and centre wavelength from 390 to 730 nm can be selected to produce a narrow spectral hue. A specialised screen material scatters each band of light across the visible spectrum equally at all locations of the screen, thus enabling presentation of spatially structured stimuli. We show layer-specific shifts of spectral response properties in the medulla correlating with projection regions of photoreceptor terminals.


Results
A modified monochromator-projector-microscope system. A visual stimulus was presented to a fly while imaging its neural responses via a two-photon microscope. To produce a range of colours (selectable narrow bands of the spectrum), we modified a projector to use a monochromator as its light source (Fig. 1A). We introduced custom Semrock bandpass optical filters to the imaging and visual stimulation pathways (Fig. 1B). These filters allowed for the presentation of a visual stimulus with minimal contamination to the calcium signal read. One filter set, added to the monochromator, blocks the wavelengths of light within the microscope's detection range. The other set of optical filter combination is integrated into the microscope to limit the wavelengths of light entering the detectors and works to reject bleed-through of detectable light wavelengths from the visual stimulus by means of an arrangement of high optical density bandpass filters (further details of the filters in Supplementary Fig. S1). combined spectral and spatial precision. The light produced by the monochromator can be modified for two parameters, wavelength and intensity, providing ample versatility to produce stimuli across the visible spectrum and across several log units of intensity. To test for spectral response independent of brightness, all monochromatic bands of light were calibrated to produce the same radiance with minimal variation over time ( Supplementary Fig. S2). Bands spanned from 385 to 725 nm at approximately 5 nm centre wavelength intervals. Gaps in the transmitted light between 500-540 nm and 610-650 nm ( Supplementary Fig. S2) exist because of the dichroic filters integrated to the monochromator. Furthermore, we sought to ensure minimal variation of projected light across the two-dimensional plane. As the distance between the fly's eye and the screen increases towards the outer edges of the screen, the brightness diminishes accordingly ( Fig. 2A). A more problematic source of variation, however, stems from light scattering. Scattering is an inherent and necessary property of the screen to ensure light diffuses over the array of angles required to reach the fly's eye ( Fig. 2A). Scattering properties of a material, however, are coupled to the wavelength of the light. This creates the challenge of identifying a screen material that scatters light in an equivalent manner across the UV and visible spectrum. We identified a screen fitting these requirements (Da-Lite, Polacoat Flex Plex Video Vision), ensuring that calibrated isoluminant bands of light at the screen centre retain their flat isoluminant calibration across the screen from 385 to 720 nm (Fig. 2B,C). A small variation between the UV and red light occurs at the outer edges of the screen. However, by delimiting a circular ellipse (diameter: 400 pixels/38.8 degrees of visual field), with its centre realigned to correspond to maximal brightness (blue dot, Fig. 2B), the projected stimulus retains spectral constancy (Fig. 2D).
proof of concept: spectral response properties in the Drosophila medulla. General medulla responses. To probe spectral response properties in the medulla of Drosophila, we established intensity-response (A) Placement of the fly in the holder with its cuticle removed to expose the optic lobes allows simultaneous neural activity imaging and visual stimulation. (Ai) A modified projector with a monochromator light source projects over 50 different bands of the visual spectrum onto a screen. These colour bands are precisely calibrated using a spectrometer to measure the radiance value of the visual stimulus. Both the monochromator and the spectrometer are jointly controlled: automated calibration of the stimulus produces the required light intensity and spectral content via a feedback loop. A tilted holder allows (Aii) the coverage of the fly's eye by the screen to be maximised, as well as (Aiii) the spectrometer position to be adjusted for measurements of specific points of the screen. (B) Modifications of the optical pathway in the monochromator and the microscope are necessary to increase the bandwidths of stimulus wavelengths without detection by the microscope. Light from a broadband tungsten 150 W bulb (lamp) is selectively transmitted through the monochromator via an input slit (IS), several mirrors (M), a grating (Gr) and an exit slit (ES). Three custom Semrock filters are added along this pathway. Filters 1 and 2 are long-pass filters that prevent the transmission of harmonics in the UV range. Filter 1 is moveable and is only used for light above 460 nm. Filter 3 prevents the transmission of the bands of red and green light that are detected by the microscope. A custom Semrock filter (4) replaces the dichroic mirror at the start of the imaging pathway, and combined with 5 and 6, these three filters serve to block the transmission of any light beyond the narrow bands of red and green detected by the microscope. A further three filters are combined for each GaAsP detector. Filters 7 and 10 block light that falls outside the red and green band ranges. Filters 8 and 11 are long-pass filters. Finally, filters 9 and 12 selectively transmit only specific red and green band of light for GaAsP detectors 1 and 2 respectively. Unlike classic quad housing designs, there are only two detectors instead of four and 200-500 nm and 550-600 nm light along the GaAsp1 and GaAsp2 detector pathways respectively is discarded. Filters denoted with asterisks (*) are a custom addition to the commercially available version of the system. Filter spectra are reported in Supplementary Fig. S1. www.nature.com/scientificreports/ relationships and spectral response profiles by means of calcium activity indicator imaging in pan-neuronally labelled flies. Transgenic fly strains differed from each other for one or more of the following parameters: screening pigment density (red: high, orange: low), photoreceptor function (intact or Rh1-only) and calcium activity indicator (GCaMP6f: green, RGECO: red, Fig. 3A). A set of full-field light pulses of increasing intensity were applied to the fly's eye ( Supplementary Fig. S3) and sigmoid curves fitted to establish intensity-response relationships for UV, blue and green light (390, 460 and 565 nm centre wavelength respectively, Fig. 3B). We observed a left shift of the green intensity-response curve and half-maximum values in orange-eye flies by comparison with their red counterparts (Fig. 3B,C), indicative of increased sensitivity to longer wavelengths of light. Next, we applied a series of light pulses ranging from UV light through to red light set at approximately 5 nm centre wavelength intervals ( Supplementary Fig. S3) and plotted normalised spectral response curves (Fig. 3D). Our results revealed strain-specific sensitivity to colours: orange-eye flies exhibited a decreased sensitivity in the blue range and an increased sensitivity in the green range by comparison with their red eye counterparts (Figs. 3D and Supplementary Fig. S5). Coefficient values extracted from fitted intensity response curves (slope and half maximum, Supplementary Fig. S4) suggest minor response property discrepancies between flies expressing GCaMP6f and RGECO ( Supplementary Fig. S4), attributable to differences in amplitude and decay times 44 . Consequently, we did not pool data from RGECO-expressing flies with GCaMP6f data for statistical analyses. Nonetheless, this red-emitting indicator serves the valuable purpose of completing the spectral profile as the red GaAsP is used to record RGECO signals, thus allowing the GCaMPrestricted green wavelengths of the spectral sweep to be filled in (Fig. 3E).

Scientific RepoRtS
Layer-specific responses. Pan neuronal labelling of the medulla reveals clearly discernible and identifiable layer structures (Fig. 4A) allowing us to delve into layer-specific responses for the intensity-response relationships and spectral response curves as above (Fig. 4B,C and Supplementary Fig. S6). Our results demonstrate that Although most layer groupings retain the higher sensitivity of orange-eye flies to green light, this difference disappears in layers M2 and layers M6-M7. The decreased sensitivity of orange-eye/Rh1-rescue flies relative to the red eye/wildtype photoreceptor flies in the UV-blue range of the spectral response curve (Fig. 3D) is only apparent in layers M6-M7 and M9-M10. Strikingly, the red eye/Rh1-rescue flies exhibit increased sensitivity to UV, blue and green light in M2, but this increased sensitivity does not occur in the orange eye/Rh1 rescue flies.
We also see this trend in layer M3, and we attribute the absence of statistical significance to the lower number of ROIs with successfully fitted intensity-response curves as response size is smaller than other layers.  Figure S4 and Supplementary  Table S1. For GCaMP-expressing flies, a gap in the spectral sweep is necessary in the green wavelengths of light corresponding to the microscope's green detection range. (E) Mean trace ± SD of the spectral response profile for RGECO-expressing flies. The spectral sweep gap for RGECO-expressing flies sits at the red end of the spectrum.

Discussion
We developed a novel experimental setup that enables simultaneous two-photon functional brain imaging and visual stimulation across the spectrum in Drosophila. With this system, a fly can be presented with over 50 different wavelength bands of the visual spectrum, causing minimal disruption to the image quality produced by the microscope. Furthermore, our visual stimulation paradigm provides combined high spatial resolution and high spectral resolution, overcoming the customary trade-off between the two parameters. The modifications to the optical pathway in both the monochromator and the microscope overcome the major limitation for spectrally-varied stimuli with two-photon imaging. The study of motion vision in Drosophila is usually carried out using blue light for visual stimulation, which offers an adequate wavelength range for Rh1derived visual responses that sits outside of the PMT's detection range. For the use of spectrally diverse stimuli, a workaround method was developed whereby the visual stimulus delivery occurs during the two-photon scanner fly-back period 26,27 . This approach, however, is limited by the discontinuous nature of the visual stimulus, which could introduce aliasing problems with moving patterns, but also reduces the microscope photon collection time thereby reducing the imaging sensitivity (this particularly affects calcium indicators with slow temporal responses). The introduction of custom Semrock bandpass filters in our system results in an extensive range of  www.nature.com/scientificreports/ possible wavelengths for visual stimulation simultaneous to the acquisition of imaging data by the microscope. A gap in the spectrum corresponding to each PMT's detection range still exists, but is considerably narrowed, and can be overcome by switching between neural activity indicators with different emission spectra detected by alternate PMT detectors. In addition to the combination of simultaneous spectral visual stimulation and two-photon imaging, we also present a screen material that maintains near-constancy of the brightness of a wavelength band at all points of the screen from UV through to red light. To our knowledge, this surpasses all currently published screen materials in this regard, and offers a host of possibilities for characterisation of combined visual modalities such as motion and colour. The inevitable drop in radiance and spectral constancy towards the outer edges of the screen can be eliminated by restricting the stimulus to the central portion of the screen. Alternatively, if some variation of the brightness and spectral properties of the stimulus is not deemed to impact response properties, use of the extended screen area provides a greater coverage of the visual field.
Our understanding of the spectral quality of visual information transmitted by the different photoreceptive cells to downstream visual neurons is primarily based on the generation of spectral sensitivity curves for opsins or electroretinogram measurements of the surface of the eye 8,45 . A recent study, however, demonstrated that R7 and R8 terminals interact to transform the inner photoreceptor output to a biphasic sensitivity curve 26 , exemplifying the modification of spectral tuning at the early stages of visual processing. Very little is known about how outputs of different photoreceptors might be combined by colour-encoding circuits, highlighting the need for high resolution spectral stimulus capabilities. Our system uses narrow bands of monochromatic light well suited to our investigation into spectral response properties, but it is entirely possible to modify the light source to produce multispectral light using a system such as the LED-based monochromator 40 . Methods commonly employed in mammalian vision research, such as the sophisticated combination of multispectral light to effectively target only one class of photoreceptors 46 , are limited in invertebrates. Further characterisation of the effect of pre-receptoral filtering, such as eye pigment screening, as well as instability and adaptation properties of visual pigments, is required. With this information, a smaller, but carefully selected, array of colour channels can be coupled to a display technology (screen or panel) such as the modified projector system with a five-primary light engine used in mouse vision research 42 or the arbitrary-spectrum spatial visual stimulator presenting up to six chromatic channels 43 .
An ideal spectral stimulation range would extend further into the UV portion of the spectrum to match the known spectral sensitivities of Rh1, Rh3 and Rh4. Monochromators providing this range of UV light exist. However, the high-energy photons of the shorter wavelengths are lost by transmission throughout the optical pathway, with the DLP chip in the projector, in particular, drastically reducing the UV content of light. The ongoing progress in the development of UV transmitting projectors (e.g. Texas Instruments) and optics might soon provide an adequate and affordable solution and extend the capabilities of our system to include UV visual stimulation.
The experimental setup we describe here enabled us to record the responses to a range of narrow bands of light across the spectrum, over a range of intensities spanning several log units of light in the medulla. We find several modifications of spectral response properties in the summed activity of the pan-neuronally labelled neuropil between transgenic fly strains, demonstrating the precision, reliability and sensitivity of our setup. A reduction of screening pigment density results in increased sensitivity of medulla neurons to longer wavelength of light, consistent with prior electroretinogram recordings in flies and Goldsmith's recruitment hypothesis [47][48][49] . Goldsmith stipulates that absorption of light by screening pigments decrease any light contribution from neighbouring photoreceptors to the visual response of a given ommatidium. The degree of shielding from off-axis light is directly related to the density of the screening pigment. Thus, we understand the increased sensitivity of orangeeye flies to longer wavelengths of light to derive from the decrease in screening pigment density coupled to the intrinsic properties of the pigment favouring the reflectance of wavelengths in the red portion of the spectrum.
Assessment of inter-layer variability revealed a diversity of responses. Most intriguing is the increased sensitivity of layers M2 and M3 in red eye flies that have lost R7 and R8 function, suggestive of inhibitory control of postsynaptic neurons in wild type flies by the R8 cells that terminate in M3 50 . Several reasons may explain why orange eye flies lacking functional photoreceptors do not also exhibit increased sensitivity in M2 and M3. Flies homozygous for the white null allele 1118 are known to have retinal degeneration 51 and this may not be rescued with the mini-white vector expression. This effect could also be attributed to prolonged depolarisation afterpotential (PDA) 52 , more common in white-eye flies 53 , where the temporary light insensitivity of the photoreceptor requires red to shift metarhodopsin back to rhodopsin. This could also explain the decreased responsiveness to short wavelengths observed in the spectral response profile of this strain. The decreased sensitivity in the orange-eye flies to UV light in layers M6-M7 could be attributable to the lack of input from UV-sensitive R7 photoreceptors that project to this layer 50,54 . It is less clear, however, why these flies lose their increased sensitivity to green light uniquely in this layer structure. If the shift in response properties is caused by the photoreceptor terminals, green light should inhibit R7 activity 26,27 , resulting in decreased sensitivity in the red-eye flies expressing all functional opsins while maintaining unaffected high sensitivity in the orange-eye strain. Our data appears to suggest layer-specific shifts in spectral response properties in the medulla corresponding to projection regions of photoreceptor terminals. We did not detect summation of R7-R8 with R1-R6 signals proposed to drive lobular plate responses reported previously 32 as we found no difference between wild type and Rh1-only red-eye flies in most layers, however further investigation is required to establish this with certainty.
Our setup overcomes many limitations that have hindered the study of colour vision and the integration of visual modalities in Drosophila. Going forward, it will serve as a highly versatile tool to further recent breakthroughs in the field 26,27 and unravel the neural circuitry underlying spectral processing. Fly stocks were made using standard fly crossing techniques using balancer chromosomes and in the case of stock 2, recombination was used to bring two insertions onto the same chromosome. Note that P{yw [20XUAS-IVS-GCaMP6f}attP40 is abbreviated as UAS-GCaMP6f, P{yw [GMR57C10-GAL4}attP2 is abbreviated as 39171-Gal4. Stock 1 is referred to throughout as red eye/wild type photoreceptor function/GCaMP. Stock 2 is referred to throughout as red eye/wild type photoreceptor function/RGECO. Stock 3 is referred to throughout as red eye/Rh1 photoreceptors only/GCaMP. Stock 4 is referred to throughout as orange eye/Rh1 photoreceptors only/GCaMP. Females were used for stocks 1 and 2 and males for stocks 3 and 4. fly care. All flies were reared at 25-27 °C with approximately 60% humidity under a 12:12 light/dark cycle and fed a standard cornmeal and molasses diet. Flies were collected one day after eclosion using CO2 for sedation and were transferred into fresh food vials. A prior study 51 cautions against using flies aged beyond 4-5 days if they carry the w1118 mutation for reasons of retinal degeneration, recordings were carried out in 4 to 7-day old flies. Slightly older flies were used due to ease of making the imaging preparation and did not show different results across this age range. fly preparation. Following cold-anaesthesia (~ 15 min in a vial placed on ice), the fly was positioned on a sheet of aluminium foil such that the back of the head capsule protruded through a small cut-out and was tilted to form an approximate 10° angle with the foil sheet. This configuration allowed the back of the head to be exposed for imaging, while leaving the majority of the compound eye below the foil for visual stimulation. Using UV-curing adhesive, the fly was then secured to the sheet with special care to reduce brain movement by attaching the proboscis and legs to the upper thorax and immobilising the abdomen. The sheet of aluminium foil was attached with superglue to a plastic disk, which in turn was secured with 5-min epoxy to a custom aluminium holder (produced by turning on a lathe). The holder was made to fit the tip/tilt stage holder and was held in place by neodymium magnets, allowing easy install with manual rotation. The holder was 45 mm in diameter, 1 mm thick (top, sides and bottom), with an inner recess of 6 mm for the stage holder to form a well to accommodate a saline bath and an inner recess of 14 mm diameter and 10 mm hole to accommodate the replaceable plastic/ aluminium foil section. A plastic guard was wrapped around the edge and secured with superglue creating a dam to prevent saline spilling out as we tilted the holder. A saline solution (103 mM NaCl, 3 mM KCl, 20 mM BES, 10 mM trehalose, 20 mM sodium bicarbonate, 1 mM sodium phosphate monobasic, 2 mM CaCl2 and 4 mM MgCl2, balanced to pH 7.4) was added to create a bath over the back surface of the head. The cuticle and underlying trachea were then gently removed to expose the optic neuropil. The trachea extending from the rim of the eye outward over the medulla was removed using forceps to gently pull it away. A gravity/suction pump was used to circulate saline over the course of the experiment to prevent build of up of metabolites or other resulting from the dissection. Following the removal of the cuticle, an interval of 45 min, or more, was allowed to ensure stabilisation of neural activity and dark adaptation of the fly.

Visual stimuli.
A projector (DepthQ 360 DLP, WXGA resolution) coupled to a screen was modified to use an independent light source, a monochromator (Cairn Research Optoscan Monochromator). This allowed us to project selectable narrow bands of the spectrum onto a screen material (Da-Lite, Polacoat Flex Plex Video Vision) that minimised wavelength-dependent scattering properties. The native resolution we used for the projector was 800 pixels wide by 600 pixels high. Only the central portion of the screen was used, segmented by a circular ellipse of 400 pixels in diameter corresponding to 38.8 degrees of visual field. By removing the corners and edges, spectral variation resulting from light scattering is reduced (Fig. 2D). The projector was used for patterned stimuli up to 360 Hz frame rate as some fly species, such as Coenosia attenuata can see up to 300 Hz, while Drosophila melanogaster can see just beyond 120 Hz 36 . The light guide, the projector, the screen and the stage/holder were adjusted to ensure an ideal alignment of the optical pathway and visual field of the fly. A first adjustment was made to the light guide and projector mirror position to place the maximal brightness at the screen projection centre with an even drop in optical power towards the edges of the screen in all directions. Next, the holder was positioned in relation to the screen such that the holder centre is perpendicular to the projection centre and equidistant to all four corners. Furthermore, the holder and screen/projector are adjusted such that when the holder is positioned to be parallel to the screen, the spectrometer samples light directly at the centre of the screen. A motorised tip Intensity-Response Relationship. The first set of visual stimuli applied to the fly were used to establish intensityresponse relationships of medulla neurons. The stimulation protocol consisted of three repeated 1-s light flashes intercalated with 3 s of darkness. This motif was repeated for a range of twenty incremental intensities spanning four log units of light (from 10 12 to 10 15 photons/s/cm 2 ) to establish the dynamic range of the visual response. Intensity-response relationships were probed for three different bands of the spectrum defined by the following centre wavelengths: 385 nm (UV), 440 nm (blue) and 565 nm (green). These colours were chosen with the intent to match the known spectral sensitivity peaks of the fruit fly opsins within the limitations of the system, such as the lack of UV light transmission through the projector and the restriction of most green wavelengths by the filters to prevent sampling by the GaAsP detectors.
Spectral Response. Next, in order to probe spectral response properties, the fly was presented with a spectral sweep of randomised light flashes of varying centre wavelengths ranging from 390 to 720 nm, all calibrated to produce the same radiance of 2.63 × 10 13 photons/s/cm 2 . This intensity was chosen as it sits in the middle of the intensity-response range across all tested wavelengths and all tested fly genotypes. A gap in the spectral sweep was introduced spanning 490 to 656 nm and 595 to 700 for the green-emitting GCaMP and the red-emitting RGECO, respectively, to accommodate the red and green GaAsP detector sensitivities. Flashes of light were applied for 1 s with a 3-s interval between each pulse, and the entire spectral sweep was repeated five times with a different colour randomisation for each repetition. Spacing between centre wavelengths was originally set to be 5 nm increments, as specified by the voltages supplied by the monochromator software. However, an assessment of the Gaussian curve describing the band of light revealed that the peak of each curve is, in fact, not aligned with the expected centre wavelength, but shifted in either direction by a negligible amount. Nonetheless, in the interest of precision, centre wavelengths have been adjusted in graphs throughout.
Further visual stimulus considerations. Daily calibrations were carried out for all stimuli, and a post-calibration check was conducted to ensure precision of the stimuli. Each experiment consisted of all stimuli types and these were always presented in the following order: spectral sweep, green-, UV-and blue intensity-response stimuli. A ten-minute dark adaptation period preceded the five repetitions of the spectral sweep and preceded each presentation of the intensity-response stimulus.
two-photon imaging. Calcium signals in neurons of the medulla were imaged using a two-photon Bruker (Prairie Technologies) In Vivo Microscope using GFP and RFP detection channels, with a 20X water immersion objective (Zeiss, W Plan-Apochromat 20x/1.0 DIC M27; Cat # 421452-9600-000), modified with the addition of specialised optical bandpass filters ( Fig. 1B and Supplementary Fig. S1). An insight DS + laser (Newport Spectra-Physics), with 920 nm infrared excitation applied to the sample. For functional imaging of calcium responses, data was acquired at a 512 × 512-pixel resolution at a rate of approximately 30 frames per second. Visual stimuli were generated in StimGL (Howard Hughes Medical Institute) and controlled via Matlab (Mathworks, MA, USA) although the psychophysics toolbox or other software could be used here instead. The start of a visual stimulus sequence was indicated to the imaging software (PrairieView) by a trigger, which subsequently initiated the acquisition of images, but also controlled the monochromator and projector. Images were acquired using the green channel (GaAsP detector 1) for flies expressing GCaMP and the red channel (GaAsP detector 2) for flies expressing RGECO. A 200X zoom (20X on the objective and 10X on the software) was used to visualise the fly medulla. This allowed imaging of all layers of the neuropil from proximal to distal across a number of cartridges (ranging from a half a dozen to a dozen in different experiments, 0.104 to 0.115 μm/pixel with a field of view of 53 to 59 μm).

Analysis. Fluorescent signal extraction.
Analyses were conducted using custom-made scripts in Matlab (Mathworks, MA, USA). For region of interest (ROI) selection, a reference image was used corresponding to averaged frames across the response period for a blue light pulse. Circular ROIs 12 pixels in diameter were manually positioned to tile the sections of the 512 × 512-pixel image containing the medulla that are visually distinguishable from their fluorescence (both baseline and light response). The aim of this selection process was to assess responses in a given discernible layer without assuming response uniformity across the layer. Each ROI covers a sufficient number of pixels to ensure a good response could be extracted whilst limiting noise issues that may arise in larger ROIs. Each imaging sequence from a fly medulla averaged approximately 150 ROIs that were extracted for analysis. A cross-correlation analysis 56 was implemented to compensate for motion in the x-y plane resulting from physiologically driven movement of the visual neuropil (e.g. muscular displacement), vibrations resulting from equipment, or other. With this method, images across the experiment were realigned to an initial template image in order to ensure continuity of all features, and consequently continuity of ROIs from one image to another throughout the stack. A voltage recording paired to the two-photon image stack was used to segment the experiment into individual stimulus presentations. For each segment, baseline fluorescence was averaged over a pre-stimulus darkness period (5 frames prior to stimulus onset). Baseline fluorescence was averaged for each ROI over the pre-stimulus darkness period. Calcium activity was assessed by changes in fluorescence. These were calculated as the difference between average fluorescence for a given frame and the baseline fluorescence and then divided by the baseline for each ROI: Scientific RepoRtS | (2020) 10:15681 | https://doi.org/10.1038/s41598-020-72673-5 www.nature.com/scientificreports/ where ∆F is the change in fluorescence, F is the fluorescent signal and F 0 is the baseline fluorescence. Extracted responses were then averaged across stimulus repeats.
Curve fitting parameters and data selection. ∆F traces extracted for individual ROIs were averaged across repetitions of identical stimuli. In the case of data resulting from the spectral sweep, only three of the five repetitions were retained via a selection method whereby the two responses furthest from the mean of all five responses for a stimulus were removed. This methodology was introduced in an effort to reduce noise in the data. Next, a stimulus response value was calculated by integrating the response over time. The time segment for response integration was matched to the excitatory phase of the response profile observed to ensure maximal signal. In practical terms, integral values of the trace were calculated either over the one-second duration of the stimulus, over the one-second duration post stimulus or over the time course of both. Sigmoid curves were fitted to the intensity-response data using the Naka-Rushton equation classically used for electroretinogram data 57 : V is the response and Vmax the maximum amplitude of the response, I is the stimulus intensity, K is the intensity at the half-maximum response and n is the exponential slope measured at the half-maximum response. The curves were fitted in a two-step process. First, the intensity-response data was transformed for each stimulus intensity: log Vmax V − 1 . Then a linear regression was fitted to the transformed data to determine an initial approximation of K and n 58,59 . Next, the estimated K and n values were used to fit the curve with the above equation. The goodness-of-fit of the curve was evaluated by means of the mean square error value (MSE) and curves presenting MSE values superior to 0.05 were discarded. Furthermore, data was retained only if a curve could be fitted to all three intensity-response stimuli colours (UV, blue and green) within the set MSE parameter threshold.
A selection process was also applied to spectral sweep data. Spectral response curves were only retained for a given ROI if the following conditions were fulfilled: (1) all three intensity-response curves were fitted as per the above criteria and (2) the light intensity used for the spectral sweep sits at least 1/5th below the maximal value of the intensity-response curve for all three colours (to ensure saturation was not reached at any point of the spectral sweep).