A modular, open-source, slide-scanning microscope for diagnostic applications in resource-constrained settings

In this paper we report the development of a cost-effective, modular, open source, and fully automated slide-scanning microscope, composed entirely of easily available off-the-shelf parts, and capable of bright field and fluorescence modes. The automated X-Y stage is composed of two low-cost micrometer stages coupled to stepper motors operated in open-loop mode. The microscope is composed of a low-cost CMOS sensor and low-cost board lenses placed in a 4f configuration. The system has approximately 1 micron resolution, limited by the f/# of available board lenses. The microscope is compact, measuring just 25×25×30 cm, and has an absolute positioning accuracy of ±1 μm in the X and Y directions. A Z-stage enables autofocusing and imaging over large fields of view even on non-planar samples, and custom software enables automatic determination of sample boundaries and image mosaicking. We demonstrate the utility of our device through imaging of fluorescent- and transmission-dye stained blood and fecal smears containing human and animal parasites, as well as several prepared tissue samples. These results demonstrate image quality comparable to high-end commercial microscopes at a cost of less than US$400 for a bright-field system, with an extra US$100 needed for the fluorescence module.

A complete and comprehensive list of components used in the construction of the low-cost automated microscopy system is supplied in S1 Table, above. The list provides a description, part number, and a link to the supplier. As the majority of these supplies are standard opt mechanics or electronics, for those in parts of the world where listed suppliers are not available, equivalent products can be easily substituted. As all purchases were made using RMB, the current exchange rate of 6.7868 RMB per dollar was used when calculating the dollar cost.

2.
Stepwise illustration of the building procedure S1 Fig. The picture above shows nearly all the components that will be used to build the low-cost and open-source microscope. This work will be divided into 6 steps, as shown in the following 6 figures. Each component has a given number in S1 Table, and this number will be shown next to the component's position in the following figures. Brief explanations below each figure present additional information and tips for construction. S1 Table. Component list including supplier and source (hyperlink). For those who can't access linked sources online, local equivalents can be easily substituted.  Table) fit in the four countersinks in the corners of the X-Y stage and screw into 4 nuts to fix them to the baseplate (shown in (E)). '21' (H=15mm) brings the stage to a suitable height for motor attachment. In Figure (G) and (H), the mounting plate ('19') connects with the motor by two sets of short screws and square nuts ('31') to adjust the motor's height. Tape applied to the lower surface of mounting plate (as shown in (H)) helps the motor to move more smoothly on the baseplate. The support is erected in the center of the X-Y stage's upper surface through the M4 screw. In (E) and (F), the bearing fits within the CCTV lens's housing, and the board lens fits into the bearing's housing. When fluorescent images are taken, one emission filter will be needed to be placed between the CCTV lens and board lens. In this case, the order of construction in (E) and (F) should be: camera, tube lens, filter, and objective. (I) A 90-degree USB cable may help to reduce cable strain and allow the camera to be placed closer to the table surface.   The computer control of the motors is mediated by an Arduino microcontroller. To provide instructions to the microcontroller, it is necessary to load the Arduino sketch "motor-control" (located inside the folder "Arduino program") using the Arduino IDE, available at http://www.arduino.org/downloads.

Program link and brief manual
The control software consists of three LabVIEW VIs, "Microscope," "Microscope-fluorescence," and "Square scanning," which we provide so that they can be freely edited by users. For those without access to LabVIEW, these VIs have each also been wrapped into standalone executables, which can be installed by running the "setup" file in the folder "Microscope programs."

Acquiring images and microscope operation.
The first executable file is 'Microscope.exe' which is the main program used for bright field given to the motors between images in the scanning mode. In our system, given the gear ratio of the stages, 5.89 pulses moves the system by 1 micron.

S9 Fig. Control Panel of main program in bright field
'Adding images exe path' should be directed to the 'Add_images1.exe' program. This is a MATLAB standalone executable that automatically converts the auto-pathfinding images into a square grid by adding "dummy" images, as described in the main text. It is contained in the "4.Add images exe" folder. Within this folder, the user must click on "Installer" to install the necessary runtime environment for the executable. Once the runtime environment has been installed, set the "Adding images exe path" in the control panel to the exe itself (i.e. do not only provide the folder). 'Focus images path' is used to store temporary images used in the autofocusing, while 'Result images path' should be directed to the folder where you want to save the final scanning images.
In the second portion of the GUI are the buttons to operate the program. In the top portion, four buttons allow the user to move the sample in X and Y in a stepwise fashion, moving a distance equal to the number inputted into the "Distance" box. In the middle portion of this section, the 'Focus' button will auto-focus the image and also automatically start the autopathfinding program. When scanning is completed, the bottom portion of this section will display the total image acquisition time, along with Grid size (x and y) and first file index (x and y). The grid size parameters indicate the column and row size of the full image matrix, while the latter two parameters represent smallest numbers of x and y in the naming system. These four parameters should be noted, as they will be used when running the image mosaic program.
We note here that the second executable file, "Microscope-fluorescence.exe," which is used for fluorescence imaging, is largely similar to this program. However, the "Adding images exe path" should be set to "Add_images2.exe.

Grid scanning
While our auto-pathfinding algorithm works for most situations, in some cases users may want to simply scan a grid-sized region of a predefined size. In this case, the user can open the third program, "Square scanning.exe," whose control panel is shown in S10 Fig

Image mosaic by Fiji
Fiji is a free distribution of ImageJ containing several extra packages compared to the "vanilla" ImageJ distribution, and is available at: http://fiji.sc/#download To mosaic images acquired by the system, navigate to Plugins->Stitching. In "Stitching," choose "Grid/Collection stitching" option. S11 Fig lays out the important options to select during this process. Part A describes the case where the auto-pathfinding algorithm has been utilized. In the "Type" option, we choose "Filename defined position." All the options arrows with red arrows must be filled using the values Grid size x, Grid size y, First file index x, and First file index y from the output of the "Microscope" GUI. The "Directory" option should be set to the location of the image files. "File name for tiles" should be input as shown (-{x}-{y}.bmp).
Finally, click the "Ok" button to run the program and the fused image will be shown after several seconds.
If the user collected data using the "Square scanning" GUI, Part B is used for the mosaic process. In the "Type" option, we choose "Grid: snake by rows" and in the lower "Order" In the next dialog box, "Grid size x" and "Grid size y" are the values of "X times" and "Y times" from the "Square scanning" software. "First file index i" option should be set to "0", "Directory" should be the location of the images, and the "File name for tiles" should be set as shown ({i}.bmp).

Software for USB camera
The exposure settings of the USB camera are controlled using a separate software ("Mind Vision 演 示 程 序 ") that can be freely downloaded: http://www.mindvision.com.cn/rjxz/list_12.aspx?lcid=63. Although the language of this software is Chinese, translations of the critical settings are shown below in S12 Fig. In the 'Camera setting', only two panels of 'exposure control' (S12 Fig left) and 'color adjustment' (S12 Fig right) are important. The settings that are labeled in red circles should be chosen. For bright field operation, Gain of 1.25 and Exposure time of 5.0 ms are suitable. For fluorescence images, depending on the sample, Gains of 5-10 and Exposure times of 400 ms or so are required, due to the much weaker emission. In order to reduce noise in the fluorescence images, red and blue gains should be set to zero.