The Three-Dimensional Signal Collection Field for Fiber Photometry in Brain Tissue

Fiber photometry is used to monitor signals from fluorescent indicators in genetically-defined neural populations in behaving animals. Recently, fiber photometry has rapidly expanded and it now provides researchers with increasingly powerful means to record neural dynamics and neuromodulatory action. However, it is not clear how to select the optimal fiber optic given the constraints and goals of a particular experiment. Here, using combined confocal/2-photon microscope, we quantitatively characterize the fluorescence collection properties of various optical fibers in brain tissue. We show that the fiber size plays a major role in defining the volume of the optically sampled brain region, whereas numerical aperture impacts the total amount of collected signal and, marginally, the shape and size of the collection volume. We show that ~80% of the effective signal arises from 105 to 106 μm3 volume extending ~200 μm from the fiber facet for 200 μm core optical fibers. Together with analytical and ray tracing collection maps, our results reveal the light collection properties of different optical fibers in brain tissue, allowing for an accurate selection of the fibers for photometry and helping for a more precise interpretation of measurements in terms of sampled volume.

While the influence of optical fibers' constitutive parameters on emission properties and light delivery geometries in the brain are well-known (Aravanis et al., 2007;Yizhar et al., 2011;Schmid et al., 2016), similar information for fluorimetry performances is not yet available. Even though analytical models to estimate light collection field of optical fibers in quasi-transparent medium has been derived (Engelbrecht et al., 2009), the use of Monte Carlo simulations (Pfefer et al., 2001(Pfefer et al., , 2002Bargo et al., 2002Bargo et al., , 2003a or direct experimental measurements (Tai et al., 2007;Ryu et al., 2015) are required to properly assess spatial dependence of fluorimetry performances with high spatial resolution. Such information is necessary in order to select the optimal optical fibers to collect light from the brain region of interest as well as to interpret photometry measurements.
Here we evaluate the fluorescence collection properties of optical fibers typically employed in fiber photometry. We characterize the extension and shape of the probed volume and collected signal, evaluating the effects of fibers' constitutive parameters. Through a combined confocal/2-photon laserscanning microscope we measured the light collection and emission fields in brain tissue whose combination determines the photometry efficiency field ρ(x,y,z) (Zhu and Yappert, 1992;Tai et al., 2007). These provide a quantitative estimation of collection volumes as a function of fiber numerical aperture (NA) and core diameter (a), together with an assessment of signal decay as a function of the position with respect to the fiber facet. Comparing data between different fibers, we found that NA has a secondary effect on photometry properties and that fiber core size is the chief parameter in defining the collection volume. Together with analytical and ray tracing collection maps, our data highlight aspects of light collection from brain tissue often overlooked in biological fiber photometry applications, with optical fibers having different NAs that have not been quantitatively compared yet.

Numerical Estimation of Optical Fibers Collection Field
As schematically represented in Figure 1A, the light generated from an isotropic fluorescent source is collected by an optical fiber with a certain efficiency that depends on the optical fiber's properties (numerical aperture and diameter) and on the properties of the medium between the source and the fiber (refractive index, absorption and scattering). For a given fiber with core diameter a and numerical aperture NA, immersed in a homogeneous medium with refractive index n, the analytical approach provided by Engelbrecht et al. (2009) estimates the 2D map of collection efficiency ψ (NA, n, a, x, z) as the fraction of the power collected by the fiber core from an isotropic point source located in the (x, z) plane (see Figure 1A for axis definition). To numerically estimate the collection field of optical fibers typically employed for in vivo fiber photometry (i.e., considering tissue absorption and scattering) we combined the approach in Engelbrecht et al. (2009) with a ray tracing model. In the following, we first extend the method proposed by Engelbrecht et al. (2009) to take into account the light entering the waveguide from the cladding front face; we then use the results to validate a ray tracing model that numerically estimates the fiber collection field in scattering brain tissue (see section Materials and Methods).
The collection efficiency η for a fiber with core diameter a, cladding diameter b, core refractive index n core , and cladding refractive index n clad can be written as η NA, n core , n,a,b,x,z = ψ (NA, n,a,x,z) +ψ NA eq , n,b,x,z − ψ NA eq , n,a,x,z , where NA eq = n 2 clad − n 2 = n 2 core − NA 2 − n 2 is the equivalent numerical aperture of the cladding/external medium interface (Snyder and Love, 1983), with the term ψ NA eq , n, b, x, z − ψ NA eq , n, a, x, z accounting for light collected by the cladding. Taking advantage of the axial symmetry of the system, values of η throughout the whole space filled by the external medium can be obtained. Meridional slices (y = 0) of such volumes are shown in Figure 1B for optical fibers with three different configurations of NA/core diameter commonly used for fiber photometry experiments (0.22/50 µm, 0.39/200 µm, and 0.50/200 µm, respectively), for a homogeneous medium with n = 1.335. These maps show the presence of a region with constant collection efficiency next to the fiber core, roughly described by a cone with base coincident with the fiber facet surface and vertex lying on the waveguide axis at z 0 (Engelbrecht et al., 2009) Interestingly, for 0.39/200 µm fiber the maximum collection efficiency region lies along the lateral surface of the cone, due to the fact that NA eq > NA, whereas this does not happen in the case of the 0.50/200 µm fiber for which NA eq < NA. This difference between 0.39/200 µm and 0.50/200 µm fibers is clearly visible also in the axial collection profiles (blue lines in Figure 1E). In the case of the 0.39/200 µm fiber, as a result of cladding collection, a peak in the collection efficiency is observed at the boundary of the constant region close to the fiber (red arrow in Figure 1E, middle panel). In contrast, for the 0.50/200 µm fiber cladding collection leads only to a small plateau indicated by the red arrow in the bottom panel of Figure 1E. The influence of cladding on collected signal for different parameters is summarized in Supplementary Figure 1, showing the comparison between the volumes enclosed by isosurfaces at several values of η for fibers with NA = 0.22, 0.39, 0.50, 0.66, and core cladding/diameters a/b = 200 µm/225 µm, 400 µm/425 µm. Cladding contribution leads to a general increase of the collection volume, more pronounced for fibers where NA eq > NA: for the 0.39 NA fiber considered in this work, the cladding generates ∼57% and ∼27% volume increase for 200 and 400 µm core, respectively. Performances of fibers with higher a/b ratio or with NA eq < NA are less affected by the cladding collection. Ray-tracing simulations were performed by scanning an isotropic point source at λ = 520 nm across the xz plane (the ray tracing setup is shown in Supplementary Figure 2). Modeled light rays entering the fiber within NA eq were propagated through a short length of patch fiber (10 mm) and registered if they reached a hypothetical detector at the distal end of the fiber. Results for core/cladding fibers are displayed in Figure 1C. This configuration simulated the potential leakage of light rays outside NA eq that propagate in the cladding. A comparison in terms of axial collection profiles ( Figure 1E) shows a very good agreement with the analytical model for both the geometrical behavior and the absolute collection efficiency values. In particular, the maximum collection efficiency η for the 0.39/200 µm fiber was found to be ∼ 0.03 whereas in the case 0.50/200 µm it was estimated to be ∼0.04. The model matches well also with the analytical approach of Engelbrecht et al. (2009) when cladding collection is neglected (inset of Supplementary Figure 2).
Since the ray-tracing approach and the analytical method gave consistent results, we extended the numerical simulations to model turbid media, such as scattering brain tissue. We modeled the medium around the fiber with a Henyey-Greenstein scattering function to simulate absorption and scattering properties of brain tissue (Zinter and Levene, 2011;Yona et al., 2016) (refractive index n = 1.360, mean free path l = 48.95 µm, anisotropy parameter g = 0.9254, transmission coefficient T = 0.9989). The resulting maps of collection efficiency for 0.22/50 µm, 0.39/200 µm, and 0.50/200 µm fibers are shown in Figure 1D. As a comparison, the axial profiles of analytical and numerical estimation of η for both transparent and turbid media are reported in Figure 1E for all the investigated fibers. When absorption and scattering of the medium are considered, the constant region in collection efficiency almost disappears, and η starts decreasing immediately after the fiber facet. The maximum η value remains ∼ 65% higher for the 0.50/200 µm fiber with respect to 0.39/200 µm. However, the collection efficiency decrease is slightly steeper for the 0.50/200 µm fiber, reaching 50% of the maximum at 250 µm from the fiber facet, compared to 300 µm observed for the 0.39/200 µm fiber.

Empirical Model for Collection Volumes
Collection fields returned from both analytical model and raytracing simulations were used to obtain an empirical model of the probed volume as a function of fiber NA and size, assuming axially symmetric distribution, in quasi-transparent medium and brain tissue. Volumetric data for different values of η for fibers with NA = 0.22, 0.39, 0.50, 0.66, and a/b = 200 µm/225 µm, 400 µm/425 µm are reported in Figures 2A,B for the analytical and the ray tracing models, respectively. These plots highlight that core size plays an important role in defining the volume from which light is gathered, with increased NA impacting for a lower amount in the volume increase.
On the base of the good match between the empirical and ray-tracing models, this latter is used to estimate the collection volumes also in turbid medium, as shown in Figure 2C. The overall behavior is the same observed in quasi-transparent medium, with collection volumes in turbid medium being ∼2 times smaller than volumes in transparent medium. Even though Figure 2C covers common NAs and core/cladding sizes, a rough estimation of the collected volumes from fibers with parameters in between the data points can be interpolated from the plots.

Direct Measurement of Collection Field in Quasi-Transparent Fluorescent Media
A two-photon (2P) laser scanning system has been designed and built to directly measure the light collection field of optical fibers, in a configuration similar to Tai et al. (2007). A block diagram of the optical path is illustrated in Figure 3A: the optical fiber was submerged in a fluorescent PBS:fluorescein solution (30 µM) and a fs-pulsed near-infrared laser (λ ex = 920 nm) was used to generate a fluorescent voxel that was scanned in three dimensions close to the fiber facet. Scan in the xz plane was obtained by a two-axis galvanometric scanhead on a ∼1.4 × 1.4 mm 2 field of view (FOV), with the microscope objective (Olympus XLFluor 4x/340 NA 0.28) mounted on a y-axis piezo focuser to obtain a volumetric scan. The voxel emission was collected by the same objective and detected by a non-descanned photomultiplier tube ("µscope PMT"). This gave a measurement of the total fluorescence generated and, if needed, can be used to compensate for changes in excitation efficiency of the scanning point source. Simultaneously, the fraction of the voxel's fluorescence that was collected by the optical fiber and guided to a second PMT ("fiber PMT") was measured. The point spread function (PSF) of the two-photon epifluorescence system was measured to be 3 µm laterally and 32 µm axially (see Supplementary Figure 3 and section Materials and Methods for details).
During volumetric raster scanning of the 2P spot, Scanimage software (Vidrio Technologies) was used to reconstruct images from both the µscope PMT and the fiber PMT signals, allowing for a point-by-point mapping of the light intensity collected from the optical fiber within the scanned volume. Figure 3B Figure 5). In addition, the gain G of the system was estimated by noise analysis at each measurement session and used to convert the PMTs signals into numbers of photons (see Materials and Methods for details). A direct measurement of η as ratio between the collected photons (the signal read by the fiber PMT) and the photons emitted by the fluorescent source (the signal read by the µscope PMT corrected by the solid angle of collection of the microscope objective) can also be obtained. For a direct comparison, analytical collection maps were also computed convolving η and a three-dimensional function modeling the experimental PSF ( Figure 3C) (details on this calculation are reported in Materials and Methods). The related axial profiles, shown normalized to the to the average of the points within the firsts 80 µm in Figure 3D, indicate good agreement between numerical predictions and the experimental data. Both analytical and experimental results show a difference between 0.39/200 µm and 0.50/200 µm fibers (Figures 3B-D). For 0.39/200 µm fibers, the region of maximum collection does not lie on the optical axis, but in two lobes near the boundary of the core: this can be ascribed to the fact that light is efficiently guided not only by the core-cladding interface, but also by the waveguide formed by the cladding and the external medium (i.e., the PBS:fluorescein solution).
By assembling the data collected from adjacent xz-planes in the sampled volume, the full three-dimensional collection fields can be reconstructed and used to illustrate the iso-intensity surfaces at 10%, 20%, 40%, 60%, and 80% of the maximum number of collected photons ( Figure 4A). The volumes enclosed by these surfaces reflect those from which a given fraction of the   . Isolines at 10%, 20%, 40%, 60%, and 80% of the maximum number of photons are shown (in black, blue, green, yellow, and red, respectively). (C) Analytical calculations of collection efficiency diagrams for the three fibers in (B) immersed in a transparent homogeneous medium (n = 1.335) assuming a gaussian source with lateral FWHM r x,z = 3 µm, axial FWHM r y = 32 µm. Isolines at 10%, 20%, 40%, 60%, and 80% of the maximum number of photons are shown (in black, blue, green, yellow, and red, respectively). (D) Comparison of normalized experimentally-measured (blue curve) and analytically-calculated (orange curve) axial collection efficiency profiles (x = 0, y = 0) for the same fibers in (B). Normalization is done with respect to the average of the data points within the firsts 80 µm. The horizontal dashed lines represent z 0 . The width of the blue curves for the 0.39 NA/200 µm and 0.50 NA/200 µm fibers represents mean ∓ standard deviation over four different fibers. certain volume, these parameters have been extracted from the volumetric collection fields. The absolute cumulative number of collected photons as a function of collection depth is shown in Figure 4C, left, while the photons flux emerging from a specific volume (defined within iso-intensity surfaces at fixed value of η) is displayed in Figure 4C (right). These data highlight that in quasi-transparent media these two figures of merit behave very similarly for 0.39NA/200 µm and 0.50NA/200 µm fibers (the ratio of the average number of photons collected throughout the range z = 0 µm−900 µm is ∼1, as shown in Supplementary Figure 6A), while 0.22NA/50 µm fiber collects less photons from smaller volumes.

Direct Measurement of Collection Field in Brain Slices
The system depicted in Figure 3A was also used to measure the light collection field of 0.39/200 µm and 0.50/200 µm optical fibers in 300 µm thick brain slices stained with fluorescein. This was done to estimate the influence of tissue absorption and scattering on the geometrical features of light collection. Figure 5A shows the results of these measurements for the two investigated fibers on the plane y = 0, with overlay of the isolines at 10%, 20%, 40%, 60%, and 80% of the maximum signal detected from the fiber PMT. A clear difference compared to the measurement in PBS:fluorescein solutions is that the flat collection efficiency region was disrupted by tissue scattering so that it was not possible to define the characteristic point at z 0 for either fibers. This was also seen in the axial collection profiles reported normalized to the average of the points within the firsts 80 µm in Figure 5B, which show a steep decrease of the collection curve starting at the fiber face. These findings were confirmed by comparing the results to those obtained using the ray-tracing model discussed above for both axial collection profiles (orange lines in Figure 5B) and their derivatives (Supplementary Figure 7A). It is also important to mention that, although collection diagrams in quasi-transparent media are fully symmetric (Supplementary Figure 8), the data in tissue present a certain degree of asymmetry due to the tissue conformation, which could also induce slightly uneven staining.
The y = 0, x < 0 half-planes of the measurements in Figure 5A were used to reconstruct the collection volume. The collection volume was reconstructed by 360 • rotation after applying a 11 × 11 pixel moving average filter (details on the procedure are given in Materials and Methods). Iso-intensity surfaces of the reconstructed 3D collection field at 10%, 20%, 40%, 60%, and 80% of the maximum PMT counts value were calculated (Figure 5C), and collection volumes at the same relative threshold and for fixed value of η were determined (Figure 5D, left and right, panel, respectively). As expected, the collection volumes in tissue are smaller with respect to the volumes in fluorescent solution due to light absorption and scattering. In addition, the 0.50/200 µm fiber increased the average collection volume by a factor ∼1.6 compared to the average volume collected by the 0.39/200 µm fiber (see Supplementary Figure 7B for a detailed plot of volumes ratio between 0.50 and 0.39 fibers for each η iso-intensity curve). The absolute value of collected photons as a function of collection depth and as a function of volume within iso-efficiency collection surfaces at fixed value of η are displayed in Figure 5E. 0.50NA/200 µm fiber collect slightly more photons than the 0.39NA/200 µm fiber (the ratio of the average number of photons collected throughout the range z = 0 µm−900 µm is ∼1.24, matching with a 3% tolerance the ratio of 1.28 between the NAs, as shown in Supplementary Figure 6B).

Photometry Efficiency in Brain Tissue
We described the approach used to estimate the collection efficiency of an optical fiber by scanning a point like source in the proximity of the fiber facet. However, in fiber photometry experiments fluorescence is generated by delivering excitation light (typically at 473 nm or 488 nm) and collecting the generated fluorescence (usually in the range 500 nm−550 nm) through the same fiber. Therefore, light intensity obtained from a specific position depends not only on how photons are collected from that point, but also on the efficiency at which fluorescence is excited at that point. A photometry efficiency parameter ρ can therefore be defined as: where η is the collection efficiency and β is the normalized light emission diagram of the same optical fiber used to collect light (Zhu and Yappert, 1992;Tai et al., 2007). In brain tissue, η can be estimated with the 2P scanning method detailed in paragraph Direct Measurement of Collection Field In Quasi-Transparent Fluorescent Media. To estimate β in the same location where η is measured, a pinhole detection system was implemented in a de-scanned collection path ( Figure 6A). The scanning pinhole allows light to reach the detector only if it arises from a conjugate location in the tissue; thus, its intensity is determined by the efficiency at which light reaches the point from the fiber. In this way fiber emission diagram is measured in brain slices uniformly stained with fluorescein. A block diagram of the experimental setup is shown in Figure 6A. A 473 nm CW laser source was coupled to the fiber distal end and provided the excitation light. The fluorescence light excited in the brain slice by the optical fiber was imaged on the galvanometric mirrors and scanned through a pinhole aperture that conveyed it on a pinhole PMT. This detector was used to reconstruct the fluorescence intensity map within the same FOV (same magnification and position) of the 2P scan used to estimate η (Figures 6B,C, respectively). A comparison of η and β in terms of axial decay is shown in Supplementary Figure 9. Upon normalization, β maps give an estimation of the light emission diagram and can be used in conjunction with the collection fields to estimate ρ (pixel by pixel product of η and β). The resulting maps ( Figure 6D, with overlay of the isolines at 10%, 20%, 40%, 60%, and 80% of the maximum photometry efficiency) contain in each pixel a value proportional to (i) the amount of fluorescence light excited by the fiber in that pixel and (ii) to the amount of light collected from that pixel. These values describe the relative contribution of signal arising from each voxel and thus determine the spatial distribution of the sources of signal collected during a fiber photometry recording. This analysis reveals that, as expected from the effect of tissue scattering, the axial profile of ρ falls off faster with distance from the fiber face than the collection only diagram (Figure 6E, profiles are normalized to the to the average of the points within the firsts 80 µm) for both the 0.39/200 µm and 0.50/200 µm fibers. Transversal profile of ρ along x at z = 0 µm, 100 µm, 200 µm, 300 µm for both fibers are shown in Figure 6F.
Similarly, volumetric analysis analogous to the ones described in section Direct Measurement of Collection Field in Quasi-Transparent Fluorescent Media can be extended to photometry efficiency ( Figure 7A) to determine the volumes enclosed by the iso-intensity surfaces at 10%, 20%, 40%, 60%, and 80% of the maximum photometry efficiency and at fixed values of ρ ( Figure 7B left and right panel, respectively). The higher numerical aperture 0.50/200 µm fiber results in a collection volume ∼2.2 times higher than the 0.39/200 µm fiber (on average: the plot of the ratio between the two datasets for the different ρ iso-intensity surfaces is reported in Supplementary Figure 10).

DISCUSSION AND CONCLUSION
Although fiber photometry is regularly employed to investigate the relationship between neural activity and behavior as well as connectivity in neural circuits (Lütcke et al., 2010;Grienberger et al., 2012;Cui et al., 2013Cui et al., , 2014Stroh et al., 2013;Adelsberger et al., 2014;Gunaydin et al., 2014;Chen et al., 2015;Fuhrmann et al., 2015;Kim et al., 2016;Matthews et al., 2016;Nieh et al., 2016;Lovett-Barron et al., 2017;Muir et al., 2017;Schwalm et al., 2017;Selimbeyoglu et al., 2017;He et al., 2018;Luo et al., 2018;Meng et al., 2018;Simone et al., 2018), the fluorimetry properties of optical fibers inserted into the brain have not been well-characterized yet. In this work we evaluated the illumination and collection fields for widely-used multimode optical fibers in brain tissue, quantitatively estimating signal collection efficiency as well as size and shape of collection volumes. This was achieved by implementing a combined confocal/twophoton laser-scanning microscope to measure both the collection and emission diagrams from the same fiber in the same region (Figures 3, 6) (Tai et al., 2007). The 2P path was used to estimate collection volumes in both quasi-transparent media and brain slices (Figures 4, 5, respectively), showing that collection volumes for 0.39 NA and 0.50 NA fibers with 200 µm core are almost the same in fluorescein and only slightly higher for 0.50 NA fibers in brain slices. The geometric distribution of the collection volume consistently agrees with analytical and numerical estimations based on theory and ray tracing models. The latter can therefore be confidently used to estimate the spatial dependence of light collection intensity once the scattering and absorption parameters in the Henyey-Greenstein model are known in terms of mean free path, anisotropy parameter, and transmission coefficient (all scripts are provided in Supplementary Material).
The observations on collection fields measured for 0.39 NA and 0.50 NA hold true also for the photometry efficiency fields ρ(x,y,z). According to our data, 0.39/200 µm and 0.50/200 µm fibers behave very similarly in terms of on-axis spatial decay of ρ ( Figure 6E). The 0.50/200 µm fiber, however, interface with a volume approximatively two times bigger with respect to the 0.39/200 µm fiber (Figures 5D, 7B), mainly due to outof-axis contributions. Our results suggest that the influence of the numerical aperture in defining the axial extension of the brain volume under investigation is marginal with respect to the effect of the fiber diameter. Optical fibers with smaller core, such as the 0.22/50 µm one, can be utilized to collect functional fluorescence signals from a restricted tissue volume, when localized information is needed.
From a practical perspective, our data can serve as a resource for researchers in choosing the optical fiber to use in a specific experiment: (i) increase the core size rather than the NA to enlarge the collection volume; (ii) if on-axis contribution is preferred (e.g., cortical columns), a lower NA should be used; (iii) if a low count rate is expected, high NA fibers can help by detecting additional out-of-axis fluorescence.

Fiber Stubs Fabrication
Fiber stubs were realized from 0.22/50 µm (Thorlabs FG050UGA), 0.39/200 µm (Thorlabs FT200UMT), and 0.50/200 µm (Thorlabs FP200URT) multimode optical with cladding diameters of 125 µm and 225 µm, for 0.22/50 µm and 0.39/200 µm−0.50/200 µm fibers, respectively. After peeling off the buffer, stubs were trimmed to size using a fiber cleaver (Fujikura CT-101) and connectorized to a stainless-steel 1.25 mm ferrule. The connectorized ends of the stubs were then manually polished. Fiber patches were realized from the same fiber types and connectorized using a stainless-steel ferrule on the proximal end and a SMA connector on the distal end, with respect to the stub. During experiments, the stubs were connected to a patch fiber of matching NA and core/cladding sizes via ferrule to ferrule butt-coupling. The patch fiber has a fully preserved core/cladding/buffer structure, that influence propagation of light collected and guided by the cladding of the fiber stub. For the 0.39/200 µm and 0.50/200 µm fibers, light entering the cladding can propagate in the patch fiber since the buffer has a refractive index n buf < n clad . For 0.22/50 µm fiber, instead, the acrylate buffer refractive index is n buf = 1.4950 at 520 nm (Polyanskiy, 2018), higher than n clad = 1.4440, thus preventing light to be guided into the cladding of the patch fiber.

Analytical Calculation of Fiber Collection Fields
Analytical 3D (1). The refractive index of the core (n core = 1.4613 at 520 nm for 0.39 NA and 0.50 NA with silica core, and n core = 1.5202 at 520 nm for 0.66 NA with borosilicate core) has been retrieved from the online database (Filmetrics, 2018), while the refractive index of the cladding (n clad ) has been calculated to provide the nominal numerical aperture. In Equation (1), ψ (NA, n, a, x, z) is the same as in Ref. Engelbrecht et al. (2009), while the term ψ NA eq , n, b, x, z − ψ NA eq , n, a, x, z takes into account light collection from the cladding facet (see Supplementary Script 1).
In particular, ψ NA eq , n, b, x, z is the collection efficiency of a fiber with diameter b that guides light by virtue of the refractive index contrast between the surrounding medium and the cladding with numerical aperture NA eq . However, the cladding has a thickness b-a with circular crown shape, and therefore the collection efficiency from the region overlapped to the core, ψ NA eq , n, a, x, z , should be subtracted. This modeling was used for obtaining the collection efficiency maps for point-like sources shown in Figure 1B. To extend these data to the case of an extended source, three dimensional maps for point-like source were obtained by rotating collection efficiency maps in the y = 0 plane around the fiber axis (see Supplementary Script 1). The obtained 3D maps were then convolved with a 3D representation of the actual focal spot generated by the microscope (see Supplementary Script 1). This latter was modeled as a Gaussian function with lateral FWHM r x,z = 3 µm, and axial FWHM r y = 32 µm, modeling the PSF of the used experimental configuration (see below for details in the PSF measurements).

Ray Tracing Simulation of Fiber Collection Fields
Ray tracing simulations were performed using an optical model designed with commercial optical ray-tracing software Zemax-OpticStudio to simulate the behavior of light collected by the optical fibers. The implemented layout is shown in Supplementary Figure 2 (Filmetrics, 2018). One of the two fiber facets was included within an optically homogeneous cylinder volume that simulated the PBS:fluorescein droplet or the stained brain slice. A fluorescence source was modeled as a 520 nm point source emitting 500·10 3 rays for a total power of 1W. To reproduce the experimental acquisition, the source was raster scanned across the half-plane y = 0, x > 0 ( Figure 1A). To optimize simulation time, steps along z and x were set to 25 µm; for simulations concerning 0.22/50 µm fiber the region in the proximity of the fiber (600 µm along z and 500 µm along x) was simulated with a grid step of 12.5 µm, to better sample the smaller core. For each source position, the rays were collected from both core and cladding surfaces on the facet, propagated into the fiber and they were detected on a single-pixel squared detector placed at the distal end of the fiber. The detector size was matched to the cladding diameter. Refractive indexes were set as n = 1.335 for PBS:fluorescein solution and as 1.360 for brain-like scattering volume (Sun et al., 2012). Scattering in the PBS:fluorescein solution was not modeled. Scattering in brain tissue was simulated following a Henyey-Greenstein model with parameters: mean free path m = 0.04895 mm, anisotropy value g = 0.9254 and transmission T = 0.9989 (Zinter and Levene, 2011;Yona et al., 2016). From the computational point of view, the most demanding part of the simulation is rays propagation into the fiber, that experimentally is ∼1m long and requires > 24 h per simulation. To shorten simulation times, a relatively short length of the fibers was implemented (10 mm). This short length does not allow, however, to consider losses of light entering the fiber outside the maximum accepted angle. Therefore, only rays describing an angle with the fiber input facet smaller than a threshold θ th were considered in the power count, with θ th = sin −1 max NA, NA eq n .
For the 0.22 NA fibers the cladding sidewalls were modeled as an absorbing interface to take into account for the leakage of light from the cladding (n clad = 1.4440 at 520 nm) to the buffer (n buf = 1.4950 at 520 nm Polyanskiy, 2018) into the patch fiber.

Brain Slices Treatment
Brain slices ∼300 µm thick were cut with a vibratome from wildtype mice brain. Slices were then fixed in PFA and permeabilized for 30 min in 0.3% Triton X-100 (Sigma-Aldrich). Slices were then incubated with fluorescein (1mM in PBS) for 30 min.

Acquisition and Analysis of Fiber Collection Fields
A combined confocal/two-photon laser scanning microscope was designed and built in a configuration similar to Ref. Tai et al. (2007). A full block diagram of the path used to measure collection fields is illustrated in Figure 3A. The power of a fspulsed near-infrared (NIR) laser beam (Coherent Chameleon Discovery, emission tuned at λ ex = 920 nm) is modulated by means of a Pockels cell (Conoptics 350-80-02), and a quarter wave plate (Thorlabs AQWP05M-980) has been used to obtain circularly polarized light. The laser beam is expanded by a factor 5 and xz-scanned with a galvo/galvo head (Sutter). The microscope objective (Olympus XLFluor 4x/340) is mounted on a y-axis piezo focuser (Phisik Instrument P-725.4CD), and fluorescence signal is excited into a quasi-transparent 30 µM PBS:Fluorescein solution or into a fluorescently stained brain slice. Fluorescence light is re-collected by the same objective and conveyed without descanning on the entrance window of a photomultiplier tube (PMT, Hamamatsu H10770PA-40, the "µscope PMT") through a dichroic mirror (Semrock FF665-Di02), two spherical lenses (Thorlabs LA1708-A and LA1805-A), and a bandpass filter (BPF, Semrock FF01-520/70-25). During experiments in solution, fiber stubs were submerged in a PBS:Fluorescein droplet held in the sample plane by a hydrophobic layer. After a butt-to-butt coupling with a patch fiber of matched NA and core/cladding diameter, the light back emitted from the fiber was collected through a microscope objective (Olympus Plan N 40x) and sent to the entrance window of a PMT (Hamamatsu H7422P-40, the "fiber PMT"), through two spherical lenses (Thorlabs LA1050-A and LA1805-A) and a BPF (Semrock FF03-525/50-25). A focal spot was then generated and scanned in the vicinity of the fiber facet covering a field of view of ∼1.4 × 1.4 mm 2 with 512 × 512 pixels, with the beam resting on each pixel for ∼3.2 µs. Laser power and PMTs gain were adjusted to optimize signal to noise ratio. For each measurement, a 400 µm thick stack was acquired with a 5 µm step along y, starting slightly below the fiber axis and finishing above the fiber. Each slice in the stack was averaged out of 5 frames.
The number of photons for each frame was calculated as N ph = PMT counts G , where G represents the gain of the acquisition system. G was measured as G = σ 2 counts / PMT counts , where the average number of counts PMT counts and the variance σ 2 counts were acquired by illuminating a confined and homogeneous region in the fluorescein drop. Stacks acquired through the fiber PMT were corrected slice-by-slice for unevenness in excitation, by scaling them against the normalized corresponding image collected by the µscope PMT (see Supplementary Figure 5). The frame acquired for gain measurement of the epi-fluorescence path has been used to correct for slight variability of laser power between measurements, proportionally to the pixel average value. Uncertainty σ c on the cumulative number of photons shown in Figure 4C were evaluated propagating the Poisson σ c (z) = noise on the photon count of every pixel and the error on gain determination as where the superscript fiber and µscope identify the PMT, mean and standard deviation of G are evaluated over five consecutive frames, and the sum indexes span across the whole xy plane and up to z. The value of σ c resulted to be <1% of N c at all z for all fibers. Collection efficiency η was evaluated pixel by pixel as η x, y, z = PMT fiber counts x, y, z /G fiber PMT µscope counts x, y, z / G µscope · 0.5γ 1 − cos NA obj /n , (6) where γ = 1.11 is a factor compensating for the loss in the patch fiber and the term 0.5 1 − cos NA obj /n is the fraction of solid angle accepted by the microscope objective. Data processing was done through Supplementary Script 2 and Supplementary Script 3 for images collected in quasitransparent medium and in brain slice, respectively. One 0.22NA/50 µm fiber, four 0.39NA/200 µm and four 0.50NA/200 µm fibers were characterized in quasi-transparent medium, three 0.39NA/200 µm and three 0.50NA/200 µm fibers were characterized in brain slice; data among the same nominal fiber were averaged, and twice the standard deviation was considered as error bar.

Point Spread Function Measurement
The PSF of the two-photon microscope was measured by imaging sub-resolution nanoparticles (100 nm) at 920 nm with 160 nm lateral steps and 2 µm axial steps. For the 4X/0.28NA Olympus XLFluor 4x/340 objective, this resulted in a PSF with lateral FWHM r x,z = 3 µm ± 1 µm, and axial FWHM r y = 32 µm ± 5 µm (Supplementary Figure 3). Lateral and axial profiles were fitted with a gaussian function. Two nanoparticles were considered in this measurement, values shown are mean ± standard deviation.

Acquisition of Spatially Sampled Fiber Emission Diagrams
The setup schematically shown in Figure 6A was used to measure the emission diagrams of flat-cleaved optical fibers in tissue. Fibers were inserted into a 300 µm thick fluorescently stained brain slice, 473 nm light was coupled into the fiber through an objective lens (Olympus Plan N 40x), and the primary dichroic of the 2P microscope was removed from the system. Light emission from the tissue was collected through the microscope objective, descanned by the scan-head, focused into a pinhole (Thorlabs MPH-16), and detected by a PMT (Hamamatsu H7422P-40, the "pinhole PMT"). A BPF (Thorlabs MF525/39) isolated the wavelength band of interest. The pinhole size was set to 100 µm.

Photometry Efficiency Calculation
Images acquired on the y = 0 plane by the fiber PMT and the pinhole PMT were used to determine the photometry efficiency. The image acquired through the pinhole was registered over the collection field to obtain a pixel-to-pixel spatial correspondence. The photometry efficiency maps were determined as the pixel by pixel product of normalized version of illumination and collection fields (see Supplementary Script 4). One half of the photometry efficiency maps was employed to obtain a volumetric representation of this quantity, as reported previously.

Matlab Programming
Data processing was implemented in Matlab. Scripts are reported in Supplementary Materials, with Supplementary Script 5 containing all the undefined functions called in Supplementary Scripts 1-4.

DATA AVAILABILITY
Data will be made available by authors after the publication of the paper at cbn.iit.it/openfiberphotometry and can be requested to the authors at any time.