High resolution, wide field optical imaging of macaque visual cortex with a curved detector

Objective. Cortical activity can be recorded using a variety of tools, ranging in scale from the single neuron (microscopic) to the whole brain (macroscopic). There is usually a trade-off between scale and resolution; optical imaging techniques, with their high spatio-temporal resolution and wide field of view, are best suited to study brain activity at the mesoscale. Optical imaging of cortical areas is however in practice limited by the curvature of the brain, which causes the image quality to deteriorate significantly away from the center of the image. Approach. To address this issue and harness the full potential of optical cortical imaging techniques, we developed a new wide-field optical imaging system adapted to the macaque brain. Our system is composed of a curved detector, an aspherical lens and a ring composed of light emitting diodes providing uniform illumination at wavelengths relevant for the different optical imaging methods, including intrinsic and fluorescence imaging. Main results. The system was characterized and compared with the standard macroscope used for cortical imaging, and a three-fold increase of the area in focus was measured as well as a four-fold increase in the evenness of the optical quality in vivo. Significance. This new instrument, which is to the best of our knowledge the first use of a curved detector for cortical imaging, should facilitate the observation of wide mesoscale phenomena such as dynamic propagating waves within and between cortical maps, which are otherwise difficult to observe due to technical limitations of the currently available recording tools.


Introduction
Optical systems are ubiquitous in the modern world, ranging from laptop webcams to high tech satellite imaging systems. Simplifying the design and minimizing the size of these instruments while maintaining or even improving the imaging quality is an ongoing undertaking that involves a multitude of players in different fields. One such technological development is curved detectors: while they are widespread in the biological world, in the form of the eye's retina [15], curved numerical sensors are a relatively new innovation [14]. Their use can lead to a reduced number of optical elements and lower aberrations in a given optical system [26,31], with applications ranging from telescopes [12], satellites [22] and cell phone cameras [25], where space is at a premium, to ultraviolet imaging [13], where a significant fraction of incoming light is absorbed by optical elements. In addition to simplifying some optical systems, curved detectors can also be used to properly image a curved objects. This could be highly relevant for some specialized purposes, such as optical cortical imaging.
Optical cortical imaging is one of several imaging tools available to study the cortical activity of the brain. These tools vary in their scale and spatial and temporal resolutions: they include methods ranging from wide-field, low resolution magnetic resonance imaging (MRI) to small-scale, high resolution single-cell intracellular recordings. Among all available recording tools, the one approaching most closely the ideal combination of high spatio-temporal resolution and large scale accessibility are optical imaging methods [6], which include intrinsic optical imaging (IOIS) and voltage-sensitive dye imaging (VSDI). Intrinsic imaging relies on the fact that oxygenated and deoxygenated hemoglobin in the blood have different absorption levels, enabling the identification of areas of the brain consuming more oxygen and, therefore, indirectly indicating the most active areas. VSDI involves the use of a special dye emitting fluorescence at levels that linearly depend on the neuron transmembrane's voltage, making it possible to directly image neuronal activity. VSDI is a technique slightly more complex to use than intrinsic imaging, but it has the advantage of achieving the highest functional temporal resolution. Indeed, while IOIS is based on the hemodynamic slow response, VSDI directly measures the neuronal fast response, making it the only technique so far to record a large portion of the brain (range cm) at both high spatial (range 10 µm) and temporal (range 10 ms) scales.
One of optical imaging's advantages is that it enables the study of mesoscale phenomena, that is, an event happening within and potentially between several cortical areas. One example of such a phenomenon is cortical travelling waves, an event through which cortical activity propagates as a wave within (scale of 5-10 mm) and between (scale of several centimeters) cortical areas. It is thought to influence the way that the brain processes different information. To better understand the role of these waves requires more observation of the phenomenon itself, a task made somewhat arduous by the fact that the selected recording tool must offer both a high spatio-temporal resolution (otherwise the wave features of the effect are washed out [19]) and must cover a large enough area (ideally several cortical areas, in order to see a significant fraction of the wave). Typically, the current exploitable field of view of VSDI is on the order of 5-10 mm of diameter, covering a single wave extent within one area. To observe in parallel multiple propagations within or between areas would necessitate to double the field of view.
Despite these challenges, travelling waves have been observed through various methods. For example, electrode arrays have been instrumental in demonstrating the existence of these waves: they have been used successfully to observe propagating waves in macaque visual cortex [33], primary motor cortex (M1) and premotor cortex (PMd) [28] as well as in marmoset middle temporal visual area [8]. Electrode arrays are however fundamentally limited in that they can only measure discrete points on the cortex, leading to a discontinuous signal subject to sampling problems. They furthermore have a limited extent which is not quite large enough to observe all travelling waves.
Optical imaging, with its continuous recording, avoids some of the drawbacks presented by electrode arrays and indeed VSDI has been used to observe travelling waves in anaesthetized animals (turtle, cat, mouse, rat, monkey cortices) and awake macaque [19,20,23,29]. In all theses cases however, an extensive analysis of the data at the single trial level had to be implemented in order to isolate the weak signal from the noise, and the waves were detectable only for very good trials and over a limit of 8-10 mm diameter.
These constraints are not inherent to optical imaging: while in practice the area that can be properly imaged is limited to the central in-focus area and depends on the optical instrument used, in theory it could extend to all the area optically accessible, with the appropriate instrument. Our goal is to build such an instrument capable of imaging a macaque cortex over a wide field of view (15-20 mm) without deterioration of the signal quality by designing an optical system accounting for the curvature of the brain with a curved detector, in combination with optical elements.

Original setup
The starting point of this project was the optical instrument commonly used for both intrinsic imaging and VSDI [11]. The instrument consists of a macroscope, made of two 50 mm classic camera lenses mounted back-to-back that allows the formation of an image on a high speed camera with a magnification of 1.0.
The illumination is typically provided by a 100 W tungsten-halogen lamp. Several sharp band-pass filters are used in combination with a white lamp to select the wavelengths appropriate for the experiment (usually 570 nm for testing and alignment purposes, 630 nm for VSD imaging and 605 nm for intrinsic imaging). In the case of intrinsic imaging, the light is sent through two liquid light guides and their outputs are manually placed before the experiment so as to produce the most uniform illumination on the cortex. In the case of VSDI, the emitted fluorescence can be separated from the illumination light with a dichroic filter. This enables the use of epi-illumination, where the illuminating light is sent to the cortex through the last objective by reflecting from a dichroic mirror placed between the two lenses.
This instrument is well mastered by experimenters, and has lead to many discoveries over the years [3,5,7,10,17,20,27,32,34]. Nevertheless, there are some fundamental limitations inherent to the macroscope's design. The most obvious of these limitations is that the observed object, the brain, is curved, which neither the optics or detector are optimized for. This results in images that can never be fully in focus over the whole field of view. In most cases, the focus is optimized for a small (r ≈ 3-4 cm) central area while the edges of the image remain blurry. In theory, this effect could be minimized by reducing the objectives' aperture in order to increase the depth of focus, but this comes at the expense of the signal to noise ratio since it decreases the number of emitted photons reaching the detector. This trick is unsuitable for optical techniques such as VSDI due to the low level of fluorescent light that is emitted by the neurons, and is in general undesirable because increasing the light intensity can generate more photodynamic damage to the cortex. An alternative solution is to adapt the instrument to the curved shape of the object. This could be achieved entirely through the optics itself, but it would require the use of hard to manufacture and expensive aspherical lenses. A more straightforward approach is to optimize the shape of the detector to the object, which can simplify the optical elements composing the instrument. This is the approach that we have chosen.

New prototype
The motivation behind the development of a new imaging instrument is to account for the curvature of the brain under study. This endeavor is done in collaboration with CURVE-ONE, a startup that specializes in the curving of CMOS sensors. This curved detector is used in combination with custom lenses and an open source camera. The prototype and its composing elements are described below, and more details regarding the design steps are described in [4].

Curved detector
The fundamental component of the new prototype instrument is the curved detector. The first step is to determine the target radius of curvature best approximating the curvature of the studied brain. We first develop the prototype for rhesus macaque primates, for which there is a lot of experience. MRI scans were used to estimate the curvature of the macaque visual cortex. To extract the surface of the cortex from the MRI data, we used Macapype [16], an open source pipeline that performs segmentation of the different brain tissues from primates's MRI scans. The region of interest (the area of the brain that is optically imaged) was then manually identified with BrainVISA (an open-source neuroimaging software platform). This area corresponds to the visual cortex accessible through the optical chamber surgically implanted in the primate's skull (mostly the first two visual cortical areas V1 and V2, illustrated in figure 2). Finally, the points forming the surface of interest were fitted to the best sphere.
The whole analysis was performed for eight macaques, including the one on which the instrument was primarily tested, to estimate the fluctuations of the average brain curvature observed over several individuals (see figure 1). The average brain curvature for our target macaque was found to be 29 mm, which is roughly consistent with the average value of approximately 30 mm of the other macaques' brain curvature and meaning that the instrument could be used on other individuals without altering the design.
The detector selected for curving is a large CMOS sensor (AMS CMV12000: monochromatic, 12 bit depth, 4096 × 3072 square pixels with a size of 5.5 µm). It was curved with a technique based on substrate elasticity which currently does not permit to curve a detector to our target radius of 29 mm. Instead it was curved to a radius of 160 mm, which was deemed to be the highest curvature that could be safely achieved. The rest of the curvature had to be accounted for by the optics, as discussed in section 2.3.

Lenses
The use of lenses is required to form an image and, as described in section 2.2.1, to account for the remaining brain curvature that cannot be corrected by the curved detector. The magnification of 0.89 was chosen so as to resemble the conditions of the original instrument while also optimally exploiting the available surface of the detector (22.5 mm × 16.9 mm) and of the optical chamber.
The selected optics combine a double Gauss design with a projection lens with aspherical corrector, whose shape is determined by the field of view and the residual curvature to be corrected. Figure 2 shows a cross section of the final optical design, along with the lens mount (described in more details in section 2.3.1). The optical design was done with the software Zemax Optics Studio to optimize the image quality over the entire field of view. The fnumber of the new instrument (2.14) is slightly larger than the original instrument's f-number (1.2 with the largest aperture), meaning that the depth of field (∝ f-number) is slightly longer with the new macroscope.

Mount
The optical design involves seven lenses of various thicknesses and diameters placed very close to each other. The use of these non standard lenses required the design of a custom lens mount in order to achieve reasonable alignment of the optics. It was decided for practical reasons to 3D print the prototype mount in high resolution resin (stereolithography, with a precision of ∼20 µm). The basic mount design includes three sections that can be combined with a few degrees of freedom and fits on a standard 60 mm cage system.
The first two sections contain the double Gauss lenses. They are fixed to each other with four small screws, while the tip and tilt between the two mounts can be adjusted using tilting rings. These are two identical thin rings with an uneven thickness that are  stacked between the two mounts, such that an angle can be introduced by rotating one ring with respect to each other.
The third section only contains the aspherical lens. The optical design requires this lens to be less than a one millimeter away from the sensor, so the section screws directly to the camera. A small rail between sections 2 and 3 allows to set the focus by adjusting the distance between the aspherical lens and the Double Gauss lenses, and two small screws allow the mount's position to be fixed.
The 3D printed resin met our requirements for speed and ease of use in the first phase of the project, but the light color and relative flexibility of the material make it unsuitable for optimal optical performance. A updated, machined mount accounting for known issues is currently in progress.

Camera
The camera that is used along with the CMOS curved detector is an open source camera, the apertus • AXIOM Beta Developer Kit. It gives users full access to all parts of the camera, including the sensor, so that we can easily swap the detector at will. The camera runs Arch Linux and includes Ethernet, HDMI 1080p60 and micro USB connections. Note that while the term 'camera' usually refers to both the photosensitive detector and the electronics powering it, in this project the detector and the camera (the electronics required to use the detector and record images) are two distinct and separable components and we refer to them as such.

LED ring
The last component of the prototype is the illumination source. The goal is to produce an illumination that covers the whole field of view with a uniform light intensity and that can be used for both intrinsic and VSDI. Rather than continuing to use a tungsten-halogen lamp, which produces a lot of heat and takes time to stabilize, we chose to use light emitting diodes (LEDs) because they are available in the relevant wavebands, are efficient, and produce little heat. We used four LED units (LZ4-00MA00 from LED Engine) that each contain four individual LEDs (red for VSDI, amber for IOIS, green for alignment and blue for calcium imaging, centered around 621, 590, 525 and 460 nm respectively with bandwidths between 15 and 30 nm), and placed these units uniformly on a ring at an angle of 35 • toward the optical chamber. This configuration was optimized using Optics Studio in order to ensure uniform illumination over the cortical area, taking into account the actual configuration of the recorded region. This includes the curved cortex, covered by an artificial dura [2], which is observed through an optical chamber [1] filled with agar and covered by a thin slate of transparent perspex.

Results
The resulting prototype was characterized on an optical test bench to determine its performance. The main characterization was performed by measuring the point spread function (PSF) across the field of view of a curved object; the results are presented in section 3.1. An alternative characterization effort involved imaging sample objects and analyzing the resulting images, which led to the development of an algorithm to estimate the blurring in an image. It is described in section 3.2. We carried out all of our characterization procedures on both the new and the original instruments under identical conditions, to compare them as accurately as possible.

Measurement of the PSF
Measuring how a given optical system images a point source, defined as the PSF, is a typical method used to characterize the aberrations present in the system and to quantify the image quality achievable. This measurement was done using a red laser (670 nm), close to the wavelength for which the instrument was designed. The laser was sent through a diffusing plate to prevent interference effects and then through a pinhole. We chose a pinhole that, with a size of 2 µm, was smaller than both the Airy disk and a pixel imaged on the sensor (5.5 µm × magnification) and therefore acted as a point source.
The purpose of the new instrument is to optimize the image quality over the whole field of view for a curved surface. We are thus interested in measuring the image quality over the entire curved surface. To do so, we mounted the pinhole and the laser on a micrometric platform. The platform could be moved precisely along all three axisx (horizontal, perpendicular to the optical axis),ŷ (vertical) andẑ (along the optical axis). The platform was first positioned to place the point source in focus at the center of the detector and the field of view was then sampled by moving the point source to 3D positions along the curved surface of interest. The measured PSFs for both the original and the new instruments are shown in figure 3, where each sub-image corresponds to a zoom on a 0.37 mm × 0.37 mm region centered on the peak of the PSF. The range of the scan is identical for both setups; however, since the flat detector has a smaller active area, some points on the edge of the field could not be measured and appear as blank boxes. Note that the steps along the vertical (ŷ) axis are half of those along the other axes, because of the vertical micrometer's smaller range. The PSFs measured with the flat sensor instrument are point-like in the center but appear distorted starting at about 3.5 mm away from the center. The PSFs measured with the curved sensor instrument are point-like over most of the central area and become distorted approximately 7 mm away from the center. The aberrations appear to be dominated by astigmatism.
The PSFs were fitted to a 2D Gaussian, and the full width at half maximum values along the short and long axes were extracted. An average spot size across the field of view for both instruments was thus obtained, allowing for quantitative comparisons. The results show that the curved instrument consistently yields a smaller spot size than the flat instrument, including at the center of the area of interest, despite the fact that this is the region where the flat system performs best ( figure 4(a)). The difference in performance broadens further as the PSF is measured closer to the edge of the field of view. For both instruments, the spot size is relatively circular near the center and becomes increasingly elliptical away from the center, suggesting the presence of aberrations in the system.
To further compare both setups and extrapolate over the whole field of view from these discrete measurements, a power law fit was performed on the measured spot size. The fit was done on the average spot  size as a function of the distance from the center, imposing radial symmetry ( figure 4(a), dotted line). We represented the corresponding fits for both instruments on two-dimensional maps over the whole field of view accessible through an 18 mm diameter optical chamber ( figure 4(b)). Contours were drawn for spot sizes of 15, 20, 35 and 50 µm, when possible. We calculated for each contour an area for which the average spot size is smaller than or equal to the contour value and these values are indicated in the figures' legends. The flat instrument does not have a spot size smaller than 15 µm and the corresponding area is therefore 0, whereas it is 74 mm 2 (r = 4.9 mm, a little over half the chamber diameter) for the curved prototype. The areas in which the spot size is smaller than 20 and 35 µm respectively are 112 and 173 mm 2 for the curved setup (r = 6.0 mm, r = 7.2 mm), and 8.5 and 48 mm 2 for the flat setup (r = 1.7 mm, 3.9 mm). Cortical columns, of approximately 200 µm in size, represent the functional processing units on the cortex. A resolution of at least 50 µm (i.e. with an average spot size <50 µm) is therefore considered to be a minimum for imaging purposes. The area in focus as defined by this criteria and obtained with the curved sensor instrument covers most of the field of view available (213 mm 2 , or 84% of the optical chamber area) and represents a three-fold increase over the corresponding in focus area obtained with the flat sensor instrument (70 mm 2 , or 28% of the optical chamber area).
We finally compared the experimental results obtained with the curved sensor instrument to those expected theoretically from the optical design. The simulations were done with Zemax's Optics Studio and considered the same positions across the field of view and those sampled experimentally. The expected spot sizes for the perfectly aligned setup are shown in figure 5(a), where the same analysis was performed as for the experimental data. Unsurprisingly, the simulated spots are smaller than those measured experimentally (by approximately a factor of 3 near the edge of the chamber). Small alignment issues caused by the 3D printed mount most likely contribute to the loss of performance, but the dominating limiting factor appears to be an discrepancy between the thickness of the modeled and the actual aspherical lens. As-built simulations reproducing this disparity using Optics Studio's non-sequential ray tracing feature ( figure 5(b)) reproduce the main features of the experimentally observed performance ( figure 4(b) right). Note that simulations of the edge thickness error using the standard fast Fourier transform ray tracing did not yield usable results. A new prototype addressing these issues is currently in development.

Edge sharpness analysis
The PSF is a precise and widely understood means of characterizing the performance of an optical system, and it also facilitates the comparison between the empirical and expected performance with simulation tools such as Zemax's Optics Studio. The experimental manipulations required to properly measure the PSF across the field of view over a curved surface are however somewhat tedious and, because of technical limitations, cannot be performed on the actual optical system used at the neuroscience institute. We therefore developed an alternative tool to estimate the optical performance relying only on the images obtained through a given optical system. This tool hinges on the presence of vasculature on the cortical surface. When imaged in focus and at the appropriate wavelength, these veins create edges whose sharpness is indicative of the image focus in that area. We routinely and intuitively use this fact when adjusting the alignment and focus of the optical system; the idea behind the algorithm is merely to quantify the sharpness of the edges and to subsequently extract from this value an estimate of the image blurring, as characterized by the PSF spot size. The algorithm was developed with cortical imaging in mind but should function for any image of an object presenting a pattern with sharp edges.
The basic idea of the algorithm is relatively simple: in essence, it uses a numerical first derivative and grayscale information of the image to estimate the image's blurring, which is then expressed as a dimension that can be related to the PSF's spot size. The algorithm only requires a single image containing sharp edges. The precise steps are described in more details below, and intermediary results are illustrated in figure 6 as an example.
The starting point must be an image containing sharp edges over the whole area where the image blurring is to be estimated. We created an appropriate test object by 3D printing a sphere at the proper radius of curvature and drawing small dots (0.25 µm diameter) in black ink on its white surface, as shown in figure 6(a). The regrettable but sometimes inevitable presence of dust in the optics creates artificial sharp edges that corrupt the analysis. This can be easily avoided by identifying the position of the pieces of dust in a white image and thereafter masking theses small areas for the rest of the analysis. The hidden dust shows as white spots in figure 6(a).
A sobel operator algorithm (numerical first order derivative) is then applied to the image, highlighting the features' edges. The result is normalized such that a sobel value of 1.0 represents a 'perfect' edge, that is, an edge where the pixel value goes from 0 to the maximal bit depth in one pixel. The resulting sobel map is shown in figure 6(b). The image and sobel maps are then split into smaller cells, as shown on top of figures (a) and (b) in figure 6. The cell must be large enough to include features with a sharp edge but small enough that the focus and image quality can be assumed to be relatively uniform over that area. The maximal sobel value is extracted for each cell, as shown in figure 6(c).
At this point we introduce another parameter, the grayscale level within each cell. This is done because the sobel algorithm, as a simple numerical first derivative, merely convolves the data with a given sobel matrix. Consequently, the sobel value depends on both the blurring and the absolute pixel values (or the local grayscale level). The pixel values reflect factors such as the illumination intensity, which is not the focus point of this analysis. We therefore attempted to decouple the effect of the image blurring to that of the grayscale level: the idea is that while a given sobel value can result from many combinations of blurring and grayscale levels, if the specific grayscale level of a cell is known, then it becomes possible to extract a single blurring value for that specific cell. The relationship between these variables was investigated by manipulating the blurring and grayscale level of a simulated image and comparing the resulting sobel values [24]. The extracted blurring parameter, 'sigma' or σ, is a physical distance expressed in micrometers and is analogous to the PSF spot size. An example of the grayscale levels within each cell for the test image is shown in figure 6(d).
Knowing the relation between the maximal sobel values and grayscale levels, it is then possible to use the parameters' combined information to extract an estimate of the blurring in each cell, as shown in figure 6(e). Finally, in order to gain a finer estimate across the image, we implement a rolling cell method, in which the cell considered in the calculations is shifted at each step by a value smaller than the actual cell size, in such a way that the cells overlap each other, until the whole image has been sampled. The estimated spot size for the same example image obtained using the rolling cell method is shown in figure 6(f), which can be compared with the 2D map obtained from the PSF scan ( figure 4(b) right). Because the analysis applied to the PSF data imposes radial symmetry, whereas the sobel analysis does not, it is expected that the 2D map in figure 6(f) contains some irregularities not present in figure 4(b) right. Nevertheless, the patterns in both figures are similar, with a relatively uniform region at the center and an image quality that decays more significantly at a distance of approximately 7 mm from the center. The scale of the maps, that is, the relative size of the estimated PSF, is however shifted by approximately 30 µm in the sobel map. We believe that this reflects a real underperformance of the physical instrument rather than a bias in the analysis, as discussed below.
The edge sharpness analysis relies of several dimensions: the kernel of the sobel operator, the normalization with a perfect edge, the size of the cells and the conversion of the blurring width σ in physical units. These parameters were all defined as physical units, and were thereafter converted to pixels for each instrument accordingly. This ensured that the results obtained from both instruments could be compared to each other directly.
This algorithm is a useful tool to estimate the image quality in cases where it is not possible to perform a more accurate measurement. The results are however merely estimates. Notably, the analysis assumes a Gaussian blurring, which might not always be a valid assumption, particularly for highly aberrated systems. It further assumes that the blurred spot is symmetric, which is also rarely the case (see figures 3 and 4(a)). Experimental data suggests that some orientation information of the blurring spot could be extracted from the sobel map, but this was not pursued in the current work.

Extended images
Before testing the sobel algorithm on images obtained in vivo, we tested it on images obtained on an optical test bench for several test objects and several wavelengths. One such object consisted of a balloon inflated inside a 3D printed shell, more closely resembling physiological in vivo conditions. Estimated spot sizes obtained with images of this latest test object are shown in figure 7, along with the average spot size fit obtained through the PSF measurements for both setups.
The spot size estimates and the PSF measurements correspond relatively well for the flat sensor imaging system. Note that by considering the largest sobel values in each cell in the sobel analysis, we are implicitly selecting a spot size that corresponds better to the shortest axis of the PSF spot. The fact that the sobel curves follow the PSF curve near the center, where the spot sizes are relatively symmetric, and that the sobel curves undershoot the average spot size near the edge, where the PSFs become elliptical, therefore makes sense.
The sobel curves for the curved detector setup however do not perfectly match the curves obtained from the PSF measurements. This is nevertheless in agreement with our general perception from looking at the images, whose quality do not seem to match the quality that could be expected from the PSF scans. We suspect that this discrepancy is caused by stray light entering the system through a too-large aperture of the 3D printed optical mount (which will be corrected in the newer version). Despite this issue, the curvature of the object appears to be accounted for relatively well, which is suggested by the fact that the sobel curves obtained with the curved setup (as well as the PSF curves) remain flat over a larger distance than the corresponding curves obtained with the flat setup. For example, the estimated spot size obtained with the curved sensor instrument remains within 2 µm of its value at the center over a distance of 4.6 mm, whereas for the flat sensor instrument this distance is approximately 2-3 mm. Similarly, when fitting an exponential function (σ = exp(r/τ ) + B) to the sobel curves, the obtained spatial constant τ is between 1.7 and 2 times larger for the curved setup, all of which suggests that while the overall image quality is not yet quite what it could be, the curvature of the object is corrected as expected.
The new prototype was then moved to image a macaque cortex in vivo. The images were taken with both instruments (curved-sensor prototype and original macroscope) on the same macaque within about an hour of each other and the conditions were kept as similar as possible during this time. Extra chromatic factors come into play when it comes to in vivo imaging: the hemoglobin in the blood has different absorption levels that depend on the wavelength of the incoming light. In particular, the veins on the cortex that provide the sharp edges required for the sobel analysis appear the most strongly when illuminated at 570 nm. These chromatic factors must be considered in combination with the fact that the design of the curved sensor setup was optimized for red light. Images of the vascular pattern illuminated with green light are shown as insets in figure 8(a). As expected, the field of view achieved with the curved sensor instrument is significantly larger than the one obtained with the original setup. The image quality also appears relatively flat over a larger area, indicating that the curvature of the brain is correctly accounted for. Further images were captured with various illumination wavelengths and the resulting spot sizes estimated with the sobel analysis are shown in figure 8(a). The wavelength of greatest interest for optical imaging is red, and a comparison of the systems performance at this color suggests that the curved detector setup performs better than the flat detector setup. The spatial constants τ obtained from fitting the curves to an exponential function are approximately two times larger for the curved system, once again indicating a more constant performance across the field of view ( figure 8(b)). The image quality is deteriorated in both cases compared to the results obtained on the test bench, which might be caused by the non-optimal optical quality of the recording chamber.

Discussion
We designed and built an optical system adapted for wide-field imaging of the macaque visual cortex using a curved detector and aspherical optics. We characterized the instrument's performance and compared it with that of the standard imaging tool currently used in neuroscience. We found a three-fold increase in the cortical area that can be imaged in focus, from an area less than 10 mm in diameter to an area a more than 16 mm in diameter. We tested the new macroscope with curved test objects and static images in vivo, revealing an image quality deterioration with the curved sensor instrument, which we believe is caused by stray light contamination coming from an oversized aperture in the lens mount. The test images nevertheless confirm that the new instrument accounts for the brain curvature as intended. This was quantified by applying to the test images an algorithm developed to estimate the PSF across the field of view from a single image containing sharp edges. Our analysis revealed that the image quality remains constant over an area roughly four times larger for the curved sensor macroscope than for the original macroscope. Such measures allow quantification of the evenness of the optical quality in vivo, a related but different measure from the absolute area in focus estimated from the PSF measurements. This is of great importance for neuroscience applications because it ensures that the cortical cortical activity is imaged under the same conditions over the studied surface, such that the results obtained from different parts of the image are fully comparable.
The goal from a neuroscience perspective is to record functional data, and we have done preliminary recordings to measure orientation and retinotopic maps in the visual cortex. This however highlighted several software issues that we are in the process of correcting.
We consider this work to be a proof of concept for the use of curved detectors in optical cortical imaging. Currently, the radius of curvature is still limited by the curving technology, such that the detector only accounts for a small fraction of the overall curvature. However, as the technology evolves, allowing smaller radii of curvature, the use of a curved detector will present significant advantages. We have furthermore also investigated the use of detectors with torroidal shapes, knowing that it is now possible to curve a detector with two different radii of curvature [21]. These advantages include simplified optics and as flexibility in adapting the instrument for other animals, such as marmosets or mice, which have smaller and less spherical brains.
Marmosets, a small, non human primate, in particular have seen an increase in interest in the field over the years. Their lissencephalic small brain makes them prime candidates for use in optical imaging or multi-electrode arrays experiments because the entire cortical surface can in theory be accessed, while still containing the same organizational features of larger primates in the visual cortex [8,18]. Their smooth brain has been put to benefit to image extended cortical regions, for example by through-skull imaging, at which point the brain curvature becomes the main factor limiting the achievable field of view [30]. We therefore believe that our system could be a great asset to enable imaging of a large portion of the cortical surface at once (in vision for instance, from visual areas V1 to V5).
The new instrument has a longer depth of field than the original instrument, which means that the focus quality remains high over a larger depth. Scattering in the brain tissue however limits the resolution of signals from deeper in the cortex. The original instrument was designed to have a shallow depth of field, with the intention of focusing below the vasculature in order to limit vascular artefacts [11]. Imaging the veins out of focus however does not remove their effect on the image but rather spreads the resulting artefacts to surrounding pixels, and so we believe that a higher depth of field is preferable. This is true especially because it minimizes the effect of small fluctuations of the brain surface. Techniques using polarized light can nonetheless be implemented to filter out the light emitted from superficial depths. The idea is that polarized light travelling deeper in the cortex undergoes more scattering, eventually leading to a loss of polarization. For example, linearly polarized light and cross-polarizers were used in the throughskull experiment previously mentioned [30] to isolate the light that reached the cortex from the light that stayed in the bone. A method using elliptically polarized light, described in [9], succeeded in probing depths of at least 0.5 mm in biological tissue and could be used to select photons emitted at different depths. Note that all those techniques imply sacrificing part of the signal, and so were only used with intrinsic imaging, where a large enough number of photons is emitted. This approach might be more problematic to implement for VSDI, where excitation light needs to be kept minimal to reduce photobleaching and photodynamic damage as much as possible.
Finally, the future possibility of engineering a curved sensor with a variable radius of curvature could open the way for new opportunities. Such a detector could be adapted more precisely to different species or even to specific individual. It could also be used to account for movements of the cortex caused by physiological processes like the heartbeat and breathing.

Conclusion
This new instrument is, to best of our knowledge, the first use of a curved detector for cortical imaging. The current version of our instrument adequately accounts for the curvature of the brain and yields a three-fold increase of the area in focus, compared with the standard imaging instrument used in neuroscience optical imaging experiments.
In the short term, we first intend to use the new instrument for functional imaging. This requires fixing the camera-related software problems and to address the known issues with the current instrument, all related to the 3D printed mount. The new machined mount, sturdier than the current version, has been designed to take into account the lens thickness error and to limit stray light as much as possible. We are also developing a way to measure deformations of the cortex by projecting a small dot pattern in weak infrared light around the edge of the chamber, and using this information to correct the measured distortions in post-processing. The longer term perspective includes measuring cortical travelling waves in macaque visual cortex and further adapting the instrument to smaller animals, such as marmosets, by using a detector with a higher radius of curvature, possibly with a non-spherical shape.

Data availability statement
The data that support the findings of this study are available upon reasonable request from the authors.
Salvatore Giancani conducted many of the neuroscience experimental procedures. Xavier Degiovanni and Joel Baurberg performed the machining and electronics jobs, respectively. Manon Bourbousson was involved in the project's early stages. David Meunier, Kep Kee Loh and Olivier Coulon offered assistance with the IRM segmentation and analysis. Thibault Behaghel curved the detectors for this project, and Emmanuel Hugo and Kelly Joaquina helped with the maintenance and repairs of our detectors. Jean-François Sauvage provided ideas, help and guidance, especially at the start of the project. Finally, Herbert Poetzl from apertus assisted with the apertus • AXIOM Beta Developer Kit.
The work presented in this paper has received financial support from the CNRS through the MITI interdisciplinary programs (80 PRIME) and is part of the ATTRACT programme that has received funding from the European Union's Horizon 2020 Research and Innovation programme under Grant Agreement No. 777222.