{'fraction_non_alphanumeric': 0.028284098051539912, 'fraction_numerical': 0.018995739925972484, 'mean_word_length': 4.842513259893921, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Miniaturized integration of a fluorescence microscope

The light microscope is traditionally an instrument of substantial size and expense. Its miniaturized integration would enable many new applications based on mass-producible, tiny microscopes. Key prospective usages include brain imaging in behaving animals towards relating cellular dynamics to animal behavior. Here we introduce a miniature (1.9 g) integrated fluorescence microscope made from mass-producible parts, including semiconductor light source and sensor. This device enables high-speed cellular-level imaging across ∼0.5 mm2 areas in active mice. This capability allowed concurrent tracking of Ca2+ spiking in >200 Purkinje neurons across nine cerebellar microzones. During mouse locomotion, individual microzones exhibited large-scale, synchronized Ca2+ spiking. This is a mesoscopic neural dynamic missed by prior techniques for studying the brain at other length scales. Overall, the integrated microscope is a potentially transformative technology that permits distribution to many animals and enables diverse usages, such as portable diagnostics or microscope arrays for large-scale screens.

b. Image sequence displaying relative changes in fluorescence (ΔF/F) observed during a representative Ca 2+ transient for cell 9 in (a). The timestamps provide the temporal interval relative to the time of the maximum ΔF/F increase. Scale bar is 50 µm. All panels show the same 100 × 100 pixel sub-region from (a).
c. Traces of relative fluorescence changes for 20 neurons identified in (a), acquired while the mouse explored a square, open field arena. Scale bars are 10 s (horizontal) and 5% ΔF/F (vertical).

Analysis of microcirculatory dynamics
We determined erythrocyte flow speeds using a method based on temporal crosscorrelations 6 . We first identified vessels by computing the standard deviation image of the raw data using all frames of the video. This computation highlighted vessels, which due to blood flow exhibited greater temporal fluctuations in intensity than background pixels 6 . We then chose measurement points randomly within the identified regions of vasculature.
To compute the speed of erythrocytes passing through a specific reference pixel, we computed the cross-correlation between the intensities of the reference pixel and neighboring pixels, for relative temporal delays, τ, of -1, 0, and +1 image frames 6 . For this calculation we used 10 s segments of data. We computed the centroid of each of the three cross-correlograms, and we determined the speed of erythrocytes passing through the reference pixel as the average of the distances between the τ = -1 and the τ = +1 centroids, divided by the time between two image frames. To track how a capillary's flow speed varied over time, we performed these calculations at 2 s increments over the entire duration of the movie data. To validate the accuracy of this automated algorithm, we have compared erythrocyte speeds as manually determined from the raw movie data to the speed values determined in an automated manner 33 . The two methods yielded close agreement 33 (r = 0.99); median differences between the two were 1.5%, and there were only a small minority of points where discrepancies were > 5%.
For each determination of a vessel's erythrocyte flow speed, we made a corresponding determination of vessel diameter. We computed cross-sectional profiles of the vessel's intensity along three parallel lines spaced one pixel apart within an image that was the average of 2 s of data. The middle line passed through the reference pixel, and each of the three lines was perpendicular to the direction of flow. We then averaged the three line profiles and fit the result to a Lorentzian curve. We used the half-width at half-maximum (HWHM) of the fit as a measure of the vessel's diameter. We used Lorentzian fits, because we found empirically that Lorentzian curves provided superior approximations of vessels' profiles than Gaussians, which gave visible overestimates of vessel width.

Sample preparation
A batch of 50 zebrafish 5 days post-fertilization, comprising an unknown mix of wild type and Schwann cell-deficient erbb3 mutants, were fixed and fluorescently immunostained for Myelin Basic Protein (MBP). In brief, we fixed zebrafish in 2% Paraformaldehyde powder (PFA) plus 1% Trichloroacetic acid (TCA) freshly dissolved in Phosphate buffered saline (PBS) for 10 min at room temperature with gentle rocking.
We washed the zebrafish several times in PBS plus 0.8% Triton X-100 (PBT), followed by additional washes in distilled water, acetone, distilled water, and PBT, in that order.
Zebrafish underwent blocking with PBT plus 10% normal goat serum (NGS, Jackson Immuno Laboratories 005-000-121) for 1 h at room temperature, followed by overnight incubation with the primary antibody (anti-MBP1) in PBT plus 2% NGS, at 4°C with gentle rocking. We then performed several PBT washes of 15-30 min and incubated the zebrafish for 3 hours at room temperature with goat secondary antibody conjugated to fluorescent Alexa 488 diluted 1:2000 (AlexaFluor 488 goat anti-rabbit IgG, Invitrogen, A-11008) in PBT plus 2% NGS. We again performed several PBT washes of 15-30 min and then stored the zebrafish in PBT for 1 day before mounting, to reduce background staining.

Assay setup and imaging methods
We transferred all zebrafish from PBT onto a microscope slide and arranged the fish in consistent orientations, spaced such that multiple samples could be imaged in parallel.
We covered the samples with No. 00 cover slips sealed with 70% glycerol applied to the sides. We positioned four microscopes in a holder over the fish such that each microscope had the central portion of a zebrafish body within its field-of-view. All microscope LEDs were set to deliver ~600 µW to the specimen. Independent focusing and imaging control for each microscope permitted individual adjustments to be made as needed. We acquired images in sets of four, and for each set of images we also acquired a corresponding background image without the sample in focus, to correct for any illumination non-uniformities or background fluorescence originating from the slide.
Images of Supplementary Fig. 1b are a representative set following background subtraction.

Sample preparation
We cultured MCF7 human breast cancer cells to 90% confluency and harvested the cells

Cell counting assay and imaging methods
We placed eight 150 µL samples from each of the six cell concentrations into 48 individual wells of a 96-well plate (MatTek, P96G-0-5-F). The cells settled on the bottoms of the wells in a single layer. We imaged the 96-well plate from below, with four microscopes held in an inverted configuration. Four microscopes were mounted in a holder, which was also used for the zebrafish assay, and aligned with the well plate such that the field of view of each microscope was positioned over the center of its corresponding well. Independent focusing and control for each microscope permitted individual adjustments as needed. We acquired 3-5 non-overlapping images from each well, taken in parallel in sets of four wells for the entire 48-well assay. We also took for each well a background image without cells in focus. An image-processing algorithm (see below) determined cell counts for each well and thus cell concentration estimates for each dilution.

Algorithms for image processing and cell counting
We wrote custom software in MATLAB to count cells within raw images and estimate cell concentrations (Supplementary Fig. 1d). To correct for any background fluorescence not emitted by the cells, for each raw image we performed a background subtraction using the image of the same well of the 96-well plate but with the cells out of focus. To correct for any non-uniformities in illumination, we equalized contrast distributions across the image by applying the MATLAB function histeq(). This broke the full image into local regions (64 × 64 pixels) and equalized contrast by transforming the pixel intensities within each region so that the resulting pixel intensity histograms would be approximately uniform across the full image. We cropped the contrast-adjusted image to a central portion (400 × 400 pixels, corresponding to 460 µm × 460 µm in the specimen plane) that we used for further analysis.
We converted the cropped image to binary format by using a sliding-window approach to finding regional maxima in intensity values. First, we found the maximum pixel value within a 7 × 7 pixel window. If this maximum value was greater than a threshold level, we converted all pixels in the window with intensities within 95% of the maximum to white. We made all other pixels within the window black. We determined the threshold level by Otsu's method, which selects a threshold value that minimizes intensity variations within the black and the white pixel classes based on the grayscale image histogram 42 . We slid the 7 × 7 window across the entire field of view, converting all pixels to binary format.
We then performed an initial segmentation of the binary images into contiguous objects of white pixels, in which each white pixel was adjacent to at least one other white pixel in the object along any of the 4 cardinal or 4 diagonal directions. We removed all such objects with area < 5 pixels from the initial segmentation. These objects were too small to be cells and were generally debris or noise artifacts arising from contrast equalization.
We made an initial tally of cells within the resulting image by counting all objects of area < 150 pixels. A majority of cells were usually correctly identified as single cells and counted at this step, but a few clusters of cells generally remained. We segmented these remaining clusters with areas > 150 pixels into single cells via further processing and updated the cell count. To do this additional segmentation we used an iterative approach to morphological filtering.
In each iteration of morphological filtering, we successively applied erosion and dilation filters 43 . For erosion, we eroded a white pixel by marking it black if < 50% of all pixels in its neighborhood (window size = 7 × 7 pixels) were white. During dilation, we dilated a black pixel by marking it white if > 80% of all pixels in its neighborhood (window size = 7 × 7 pixels) were white. After these two steps, we updated the cell count to include all new objects of area < 150 pixels. In this way, we applied successive iterations of erosion and dilation to segment cell clusters into individual cells. We found empirically that 10 iterations sufficed to segment all cell clusters that remained after initial segmentation. We applied this cell counting method to each of the 3-5 images taken of each sample well. Together with the known well volume, the cell counts determined the estimates of cell concentration. To validate the accuracy of the counting algorithm, we took randomly chosen fields-of-view from wells with varying cell concentrations and compared manual scoring of cells with the values obtained from the automated algorithm. The two counts typically differed by < 5%.

Tuberculosis imaging
We prepared slides from mycobacterial cultures and labeled them with auramine-O, a fluorescent stain that binds mycolic acids in cell walls of Mycobacterium tuberculosis.
We imaged the specimens through a cover slip using an integrated microscope.

Viral vector for expression of GCaMP3
The plasmid containing the GCaMP3 sequence 34 was a gift from Dr. Loren Looger of the HHMI Janelia Farm Research Campus. GCaMP3 was cloned into an AAV backbone carrying the CaMKIIα promoter 44 . The recombinant AAV vectors were serotyped with AAV5 coat proteins and packaged by the Vector Core at the University of North Carolina. Titers were ~2·10 12 particles/mL.

Animals and hippocampal surgery
Stanford APLAC approved all animal procedures. We used male C57/BL6 mice, aged 8-12 weeks. Mice underwent two surgical procedures under isoflurane (1.5% -2%). In the first surgery, mice received stereotaxic injections of 250 nL viral vector (AAV2/5-CaMKIIα-GCaMP3) into hippocampal area CA1 (anteroposterior, -1.9 mm relative to Bregma, 1.4 mm mediolateral, -1.65 mm dorsoventral). We injected the virus using a 10 µL syringe and a 33-gauge metal needle (World Precision Instruments). In the second surgery, one week after viral transduction, we implanted a glass optical guide tube just dorsal to area CA1 as previously described 33 . This guide tube was fixed to the cranium with dental acrylic and allowed repeated insertion of micro-optical probes to the same imaging site.

Image-guided installation of the microendoscope
Approximately 4 weeks after the second surgery, we performed an image-guided installation of the microendoscope into the optical guide tube while the mice were anesthetized with isoflurane. Two-photon imaging of CA1 for guiding the installation was performed through the microendoscope itself, following our lab's standard, published procedures 33,39,45 . In brief, we inserted a microendoscope that was a singlet gradient refractive index (GRIN) relay lens (GRINtech GmbH, GT-IFRL-100, 0.44 pitch length, 0.47 NA) into the guide tube, to relay light between the specimen plane in CA1 and the microscope objective located outside the animal. After verifying uniform expression levels of GCaMP3 and a healthy appearance of the hippocampal tissue, we permanently affixed the GRIN lens in the guide tube using UV-curing optical adhesive (Norland Products, NOA 81).

Imaging CA1 hippocampus in behaving mice
We positioned and installed the integrated microscope while the mice were anesthetized with isoflurane (1.5-2%). Using a translation stage we held the integrated microscope above the GRIN relay lens that had been affixed in the guide tube. We lowered the microscope towards the GRIN lens until we saw a fluorescence image of the virally labeled brain tissue using 0.05-0.2 mW of illumination power from the microscope's LED. After locating a suitable imaging site and focal depth, we turned off the LED and attached the microscope's base plate to the cranium using Cerebond TM adhesive (myNeuroLab.com, 39465030) and dental acrylic (Henry Schein, 5478203EZ). We began imaging when the mouse recovered from anesthesia.