The Flexiscope: a Low Cost, Flexible, Convertible, and Modular Microscope with Automated Scanning and Micromanipulation

With technologies rapidly evolving, many research institutions are now opting to invest in costly, high-quality, specialised microscopes which are shared by many researchers. As a consequence, the user does not have the ability to adapt a microscope to their specific needs and limitations in experimental design are introduced. A flexible work-horse microscopy system is a valuable tool in any laboratory to meet the diverse needs of a research team and promote innovation in experimental design. We have developed the Flexiscope; a multi-functional, adaptable, efficient and high performance microscopy/electrophysiology system for everyday applications in a neurobiology laboratory. The core optical components are relatively constant in the three configurations described here; an upright configuration, an inverted configuration and an upright/electrophysiology configuration. We have provided a comprehensive description of the Flexiscope. We show that this method is capable of oblique infrared illumination imaging, multi-channel fluorescent imaging, and automated 3D scanning of larger specimens. Image quality is conserved across the three configurations of the microscope, and conversion between configurations is possible quickly and easily, while the motion control system can be repurposed to allow sub-micron computer-controlled micromanipulation. The Flexiscope provides similar performance and usability to commercially available systems. However, as it can be easily reconfigured for multiple roles, it can remove the need to purchase multiple microscopes, giving significant cost savings. The modular re-configurable nature allows the user to customise the system to their specific needs and adapt/upgrade the system as challenges arise.


Introduction
Microscopy is widely regarded as a centrally important technique in all areas of biological research. The ability to resolve structures which would have otherwise been invisible to our eyes has contributed to the advancement of many fields. Specifically, the fundamental components of the brain, neurons, were identified by Golgi and Cajal using this technique. Neuroscience today has been propelled by the advancement of microscopes to perform functional measurements and connectomic studies (Jorgenson et al., 2015).
With technologies rapidly evolving, many research institutions are now opting to invest in high-cost, high-quality, specialised microscopes which are shared by many researchers. As a consequence, an individual user does not have the ability to adapt a microscope to their specific needs and limitations in experimental design are introduced from the outset. Each experimental design has an optimal opto-mechanical configuration, and the possible variations are diverse. For example, electrophysiology experiments frequently require a fixed specimen stage and motion control of the microscope. In contrast, fluorescent or differential interference contrast (DIC) microscopy usually requires motion control of the specimen stage and a fixed microscope. Depending on the sample, an upright or inverted objective orientation may be optimal. Many experiments also involve coupling a microscope with other equipment such as a micromanipulator or incubator. Multiple microscopes would be required for each application despite the fact that many elements would be duplicated across the configurations. An adaptable work-horse microscopy system is a crucial and invaluable tool in any laboratory to meet the diverse needs of a research team and promote innovation in experimental design.
With flexibility and funding limitations in mind, many researchers have devised excellent cost-saving strategies which include 3D printed microscopes and XYZ translators (Sharkey et al., 2016), (Baden et al., 2015) (Maia Chagas et al., 2017), (Stewart and Giannini, 2016), a $0.58 origami microscope (Cybulski et al., 2014), and modifications to old microscopes (Peidle et al., 2009), (Hernández Vera et al., 2016), (Stewart and Giannini, 2016). These types of systems are advantageous in the field or within incubators but their low cost often equates to a compromise in image quality and a lack of long term stability. In addition, many labs do not have access to these salvaged components or 3D printers and therefore reproducibility can be challenging.
The components used to construct a flexible microscopy system must be readily available to research groups around the world, the system must cost considerably less than a commercial system while also maintaining a comparable image quality.
We have designed, constructed and extensively tested a high quality, transformable microscopy system assembled from optical and mechanical components. The core optical components remain constant while alterations are made for specialised experimental set-ups, including objective orientation and which components are fixed or translating. The use of commercially available opto-mechanical elements offers many advantages including ease of use, reliable alignment and reproducibility (both within and between laboratories) due to the availability and compatibility of the parts.
The modular, re-configurable nature allows the user to customise the system to their specific needs and adapt the system to the everyday diverse challenges faced when attempting to answer complex neurobiological questions. This system can also be expanded to cope with new experimental challenges and upgraded as technologies rapidly evolve, a considerable advantage over static commercial systems. The flexibility of our modular microscopy system allowed us to also implement automated stage scanning and image acquisition. A commercial microscope would often require expensive and manufacturer-specific control software. Further cost savings are achieved as many components can be designated for multiple applications, such as the actuators used to control the automated specimen stage which can be easily reconfigured as a micromanipulator.
We have provided a comprehensive description of a multi-functional, custom-built, adaptable, efficient and high-performance microscopy/electrophysiology system for both standard and unconventional applications in a neurobiology laboratory. This system encompasses the capabilities of multiple microscopes with considerable cost and space savings. Our system can be directly replicated or adapted to suit the needs any research group. Key characteristics of 'The Flexiscope' include: ease of use; upright and inverted configurations allowing multi-angle imaging; fluorescent microscopy; automated stage scanning; visualisation of unstained tissue; sub-micron computer-controlled micromanipulation. Implementation of this system does not require any specialised skills or knowledge.

Parts and Components
In order to thoroughly detail every component of the Flexiscope, each individual part has been allocated a part designation, for use throughout this description. Table 1 lists each part and its designation, in addition to the suppliers, supplier part number, and cost of each part.

The Core Optical Components
We describe three sample configurations of the Flexiscope, differing in objective orientation, mounting and motion control. Within each configuration the core optical components remain relatively constant ( Figure 1). The core optical components can be divided into three functional units: the fluorescence illumination module, the infinite space module and the camera module.

The Fluorescence Illumination Module
Fluorescent excitation is provided by three independent high intensity LEDs collimated with aspheric condenser lenses (CO6). They are combined into a single beam (

The Infinite Space Module
The Flexiscope is designed to use infinite conjugate objectives. The space between the tube lens and the objective (the infinite space module, Figure 1 F) can be modified to the user's needs with minimal impact on optical performance. Two Infinite conjugate objectives, a 4X Olympus plan achromat objective (numerical aperture (NA) = 0.10, CO19) and a 20X Olympus water immersion objective (NA = 0.5, CO20), are coupled to a lens turret (CO18). The light path then travels vertically from the specimen, through the objective, through the filter set mount emission filter to the 45° turning mirror (CO11). The mirror directs the light path horizontally towards the achromatic doublet (CO21), which acts as a tube lens.

The Camera Module
The elements found immediately after the achromatic doublet lens comprise the camera module (Figure 1, E and F). The distance between the achromatic doublet lens and the camera sensor is fixed at 150mm using adjustable length lens tubes (CO28, CO35 and CO37). Transmitted or reflected light imaging can be achieved by leaving the filter mount holding cube empty and enclosing the opening with the filter cube blank top plate (CO17). Oblique infrared illumination microscopy (OIR) uses infrared LEDs (CO26) at an angle above or below the specimen which allows the visualisation of 3D structures, resulting in images similar in appearance to DIC microscopy (Alix et al., 2003) (Beltran-Parrazal et al., 2014. All cameras used are cmount machine vision cameras from Point Grey (now owned by FLIR). A high frame rate, mono, infrared sensitive camera is used for OIR (CO22). A high sensitivity, low noise, colour camera is used for fluorescence detection (CO23). The entire system is coupled together using 1" diameter lens tubes, with c-mount adaptors (CO24) used to couple the c-mount cameras.

Motorised Motion Control and Automated Image Acquisition
Our motion control system was designed to allow precise, repeatable and controllable movement of the specimen stage. The system can be controlled using customisable Matlab scripts and linked to image acquisition to permit fully automated scanning of larger samples.

The Piezoelectric Stage
Piezoelectric actuators (  The commands used to control the specimen stage followed a logic in which the image sequence of the tissue sample is considered a two dimensional array (Figure 2 A). To acquire images of the whole tissue (or a region of interest) the stage is moved in the X-axis n-times in one direction, then moved in the Y-axis once and in the opposite direction in the X-axis n-times again. This cycle can then be repeated until the tissue has been imaged in its entirety. Each movement in X or Y dimension reveals a new 'field of view' (FOV) and a Z-stack is subsequently acquired (for code and detailed user guidelines see supplemental file 1).

The Stepper Motor Automated Scanning Stage
While the piezoelectric automated scanning stage was effective for our application (see 3.2) one major limitation became evident during extensive use; the piezoelectric actuators were slow. We therefore decided to re-configure the automated scanning stage to incorporate stepper motors (Supplementary Figure 2). This stage utilised 3D printed components to transform a manual XYZ translating stage with standard micrometers (MC4) into a motorised stage. Stepper motors are controlled using and arduino Uno running a gcode interpreter. Gcode is a standardised system for controlling XYZ position and movements commonly used in 3D printers and CNC machines. Control of the stage can then be achieved by issuing gcode commands.
The system is controlled in Matlab in a manner similar to the piezoelectric configuration and the code/user guidelines are available in supplementary file 2.

Applications Of The Flexiscope: Transforming Between Configurations
A key design principle of a transformable microscope like the Flexiscope is that a single user should be able to convert from one mode of operation to another in a relatively short space of time, and without requiring specialised skills or tools. The core optical components are relatively constant in the following three modes of operation; the upright configuration, the inverted configuration and the upright/electrophysiology configuration, but differ primarily in mounting and motion control.  Table 1.

Inverted to Upright Configuration in Under 30 Minutes
The steps required to transition from the inverted to upright configuration (

The Upright/Electrophysiology Configuration: Manual Microscope Translation with a Four-Dimension Micromanipulator Controlled by Piezoelectric Actuators
The third configuration (upright/electrophysiology configuration, Figure 4.) requires some alterations to core optical components. For ease of mounting, in this configuration the light path is aligned vertically. To achieve this, the 45° mirror in the infinite space module is replaced with a 1.5" straight lens tube (CO39). In addition, the fluorescence illumination module is rotated so that the side mounted LEDs are oriented upwards. This modification is only required to facilitate mounting to the optical breadboard (MO15). The whole microscope is mounted to this breadboard which is in turn mounted vertically to a manual XYZ translation stage (MC6). The microscope components are mounted to the jack. A fixed specimen stage is mounted directly to the optical table.
Animals were maintained in a specialised aquarium system at 12-14°C in University College Dublin, Ireland for < 24 hours.
This animal possesses a decentralised neural network known as a 'nerve net' which is distributed across their spheroidal body, directly beneath the epithelial layer (Hernandez-Nicaise, 1973, Jager et al., 2011. Whole-mount immunofluorescence labelling of tyrosylated α-tubulin enables visualisation of their nervous system. Tissue was processed in a manner similar to (Jager et al., 2011   configuration. The high quality performance was consistent for each configuration. Image G-J demonstrates the three channel fluorescent capabilities of the Flexiscope. Image G-J represents the same region of DRGs dissected from 5 day old rat pups which were cultured as explants for 6 days on flat laminin coated silicone substrates and fixed in PFA. Image G demonstrates NFH immunolabelling to visualise axonal outgrowth. Image H represents immunolabelling for S100β to visualise cytoplasm of the cell bodies of migrating Schwann cells. Image I demonstrates DAPI (nuclei marker) staining. Image J is an overlay of Image G-I. Scale bar for all images: 50µm.

Validation of Fluorescent and OIR Microscopy
The use of whole mount prepared P. pileus tissue served as an appropriate stress test for our system as the complex 3D topography of the tissue requires Z-stacking.
Fluorescence imaging in all three configurations was tested with this tissue preparation at the same position to allow direct comparison (Figure 6 A-F). No apparent difference in the quality of images produced by the system was observed between the three configurations.
The triple fluorescent labelling of the DRGs allowed us to test the performance of the manually swappable filter cubes and assess if multi-channel imaging of a sample at the same location is possible. The system was capable of three channel imaging

Validation of Automated Stage Scanning and Image Acquisition
The requirements for the automated specimen scanning stage included; relatively low cost, reasonably fast speed of motion, repeatability of motion and multi-functionality (ability to also function as a micromanipulator).

Repeatability in the Z-axis
At each new FOV the Z-axis will move a specific 'step size' a defined number of times.
This results in a Z-stack of images in which the 3D qualities of the tissue can be appreciated as a maximum intensity projection (Forster et al., 2004) (Figure 2 C). The distance travelled by the piezoelectric actuators with each 'step size' is dependent on many factors including; the resistive torque against which the actuator tip is pushing, drive voltage, step rate, active preload, variance in the frictional behaviour of assembly components and actuation direction/condition (Thorlabs, 2017b). The 'step size' values used by the APT software are arbitrary, therefore we needed to determine the distance in µm these values equated to. We also wanted to test the repeatability of each step size as it is reported that the distance may vary up to +/-20% with each step (Thorlabs, 2017a).
Videos were acquired of the stage in motion to determine the distance travelled for 'step sizes' of 1000, 500, 250, 50 and 20 (Figure 2 B). The mean distance (µm) over 15 executions of a step was calculated. The intrinsic lack of reliability upon repeating the same command was clearly observed during our testing as seen in Figure 2 B. This is not a major issue for our applications as maximum intensity projections disregard any Z-dimension information. However, repeatability in the Z-axis would enable 3D reconstructions of the Z-stacks (for example, Fiji's Z-project (Schindelin et al., 2012)) and therefore a different motor should be utilised to achieve this. In addition, the distance travelled when the stage is moving up is greater than the distance travelled when the stage is moving down, despite the same distance command being sent to the actuators.

Z-axis Error Correction
As mentioned in 3.1, imaging the structurally complex 3D topography of P. pileus tissue endows many challenges including the fact that the focal plane of the tissue will vary throughout the sample. This factor in combination with the discrepancy in distance travelled when the stage is moving up/down resulted in the need for the implementation of a Z-correction mechanism. A previously described auto-focus algorithm (Geusebroek et al., 2000) was implemented on all the images in every Zstack. This enabled a correction factor in the Z-axis to be implemented prior to the next Z-stack acquisition. Over time without the use of this Z-correction the Z-stack images would not contain any in focus regions and thus this was an effective solution to this problem.

Large Composite Image Generation
An example of a tissue scan composite is seen in Figure 2 E and demonstrates automated stage scanning capabilities. This demonstrates the nerve net in P. pileus as described in 3.1. This composite is a combination of 50 images acquired at 20X with each image comprising a maximum intensity projection from 20 images (generated using stitching algorithm ImageJ: (Preibisch et al., 2009)). This scanning capability not only enables significant time saving (as opposed to performing this manually) but it also enables an appreciation of information flow and overall context of the network which is otherwise lost with sub-sampling small regions of the nerve net.

Repeatability in the X and Y dimensions
The X and Y-actuators where tested and optimised for 20X and 4X objectives to determine the appropriate travel distance to achieve a new 'FOV' with sufficient overlap for subsequent image stitching. The X and Y axes FOV overlap at 20X was established at 25% and 30% respectively (Figure 2 D). This overlap value can be decreased or increased depending on the specific application/tissue by editing the distance command in the code. The lack of repeatability of the piezoelectric actuators was also observed in the X and Y axes, however, the overlap is large enough to overcome this inconsistency using feature matching stitching algorithms rather than a XY coordinate approach (Preibisch et al., 2009).

The Stepper Motor Stage
The stepper motor stage aimed to improve the speed and repeatability of the piezoelectric configuration. The X and Y axes had a FOV overlap at 20X of 10% and this was sufficient to enable subsequent image stitching. This system could translate to a new FOV in the X-dimension at 4X magnification in 15 seconds (as opposed to 290s in the piezoelectric assembly). This assembly costs €1666 as opposed to €4539 for the piezoelectric system. The discrepancy between actual distance travelled and the Gcode distance command was -2% and up to +18.5% (Supplementary Table   Figure 2). This was most likely due a mechanical issue (3D printed coupling components not perfectly aligned) rather than a motor or software issue. Vibration during motion was observed and indicates that this configuration wouldn't be suitable as a micromanipulator. The advantages of this system as compared to the piezoelectric system include cost and speed of imaging.

Dimensions
As described above, the same approach was taken to determine the distance (µm) travelled when commands of a specific 'step size' were sent to the piezoelectric actuators, now configured as a micromanipulator (Figure 5 A), to ensure the effect of a different load was accounted for. Precise electrode control in four directions was achieved ( Figure 5, Supplementary Video 2). Figure 5 outlines validation of the piezoelectric actuators as a micromanipulator for electrophysiological recordings.
These actuators are described as being ideal for set and hold applications as they are self-locking and no power is required to hold position (Thorlabs, 2017a). We therefore tested stability of the electrode position over time as this is crucial during intracellular electrophysiology experiments. At a resolution of 1.85µm per pixel, no drift was observed over 16 hours with the power off. The lack of repeatability is not a major issue for micromanipulation applications.

Discussion
We have provided a detailed description of the Flexiscope, a modular custom-built microscopy and electrophysiology system which is tailored to the specific needs of our research and successfully achieved substantial cost savings. This system could be replicated or adapted for the specialised needs of any researcher.

Limitations
A small number of limitations of the system were noted over many months of extensive use. Dust can be easily introduced to the system during assembly and reconfiguration; even with care this seems inevitable, although deconstruction for cleaning should actually be easier than pre-assembled commercial systems. Wear/tear and potential damage due to repeated handling of the various elements is a possibility but any damage to a specific element can be easily replaced at a relatively low cost. In contrast, replacing a specific element of a commercial microscope is expensive and often must be performed by an engineer. The most significant issue noted with our system is uneven illumination observed in our fluorescent images, however this has been described as a common problem in many commercial systems (Leong et al., 2003). In addition, during motion the piezoelectric actuators were slow and produced a high-pitched sound. We would suggest to any researchers wanting to replicate our piezoelectric automated stage scanning set up to consider purchasing a different motion control actuator. Our script could be incorporated into any XYZ motion control system by simply substituting the motion control command lines with an alternative command. This script could also be adapted for time lapse imaging of multiple regions within a sample or for automated behaviour tracking.

Replace Mechanical Coupling Components with 3D printed Components
A key motivation behind this design is to reduce costs as far as possible while still maintaining performance. The next step in cost reduction would be to replace some of the prefabricated components with 3D printed components. While obviously critical optical components (lenses, mirrors, filters) of the system cannot be 3D printed easily, we wanted to know if the structural components, such as lens tubes, could be replaced by 3D printed parts to further reduce cost. A length adjustable 1" 3D printed lens tube (3D1, 3D2) was printed in black PLA filament on an Ultimaker Original printer and incorporated into our system replacing the aluminium lens tubes in the camera module. Black PLA was used to reduce the influence of reflections within the light path.
In terms of the OIR microscopy, no difference in quality was observed (Supplementary

Comparison to Other Modular Microscopes
There are few microscopy systems which can be directly compared to our system. In terms of the ability to alter the light path to configure the objective in the upright or inverted configuration, this has been described once previously (Nguyen et al., 2016).
Other modular epi-fluorescent (Beltran-Parrazal et al., 2014), confocal (Ye and McCluskey, 2016) and scanning two-photon (Rosenegger et al., 2014) microscopy systems have also been described. However, our system advantage lies specifically in the ability to designate multiple roles to specific components and alter what aspect of the system is fixed or translating in each configuration. This allows us to achieve the capabilities of multiple microscopes at a considerably lower cost.

Conclusion
The configurations described here are only three of the many potential configurations of the Flexiscope. Our system could be directly replicated by the reader or this study could be used as inspiration for any research group to establish their own custom

Acknowledgements
This work is financially supported by School of Medicine, University College Dublin.
The authors also wish to acknowledge Dominic Courtney for his invaluable assistance in the collection of ctenophores.

Supplementary Figure 1. Replacing Opto-mechanical Elements with 3D Printed Components: Fluorescence and OIR Microscopy Comparison.
Fixed whole mount P. pileus (gelatinous marine invertebrate) were labelled with an antibody against anti-tyrosylated α-tubulin. Image A and D were acquired with the upright Flexiscope configuration with all commercial optomechanical components. Image B and E were acquired with the upright configuration and CO35 and CO37 were replaced with an adjustable 1" 3D printed lens tube. Exposure time was set at 2000ms for Image A/D and 8000ms for Image B/E. Image A/B and Image D/E were taken at the same region of tissue. This comparison was undertaken to determine if further cost savings could be achieved by replacing commercial optomechanical components with 3D printed components.
Image C and F demonstrates the ability of the upright configuration with the 3D printed component to perform OIR microscopy on the tentacle of P. pileus. Image E and F can be directly compared with Figure 4 E-G. Scale bar: 50µm.