Microbial biofilms form complex architectures at interphases and develop into highly scale-dependent spatial patterns. Here, we introduce an experimental system (hard- and software) for the automated acquisition of 3D optical coherence tomography (OCT) datasets. This toolset allows the non-invasive and multi-scale characterization of biofilm morphogenesis in space and time.
Biofilms are a most successful microbial lifestyle and prevail in a multitude of environmental and engineered settings. Understanding biofilm morphogenesis, that is the structural diversification of biofilms during community assembly, represents a remarkable challenge across spatial and temporal scales. Here, we present an automated biofilm imaging system based on optical coherence tomography (OCT). OCT is an emerging imaging technique in biofilm research. However, the amount of data that currently can be acquired and processed hampers the statistical inference of large scale patterns in biofilm morphology. The automated OCT imaging system allows covering large spatial and extended temporal scales of biofilm growth. It combines a commercially available OCT system with a robotic positioning platform and a suite of software solutions to control the positioning of the OCT scanning probe, as well as the acquisition and processing of 3D biofilm imaging datasets. This setup allows the in situ and non-invasive automated monitoring of biofilm development and may be further developed to couple OCT imaging with macrophotography and microsensor profiling.
Biofilms are a highly successful microbial lifestyle adaptation and these interphase-associated and matrix-enclosed communities of microorganisms dominate microbial life in natural and industrial settings1,2. There, biofilms form complex architectures, such as elongated streamers3, ripples4 or mushroom-like caps5 with important consequences for biofilm growth, structural stability and resistance to stress6. While much about biofilm structural differentiation has been learned from work on mono-species cultures grown in miniature flow chambers, most biofilms are highly complex communities often including members of all domains of life6. Appreciating these complex biofilms as microbial landscapes7 and understanding how biofilm structure and function interact in complex communities is thus at the forefront of biofilm research.
A mechanistic understanding of the morphogenesis of complex biofilms in response to environmental cues requires carefully designed experiments in conjunction with spatially and temporally resolved observations of biofilm physical structure across relevant scales8. However, the non-destructive observation of biofilm growth in experimental systems has been severely limited by logistic constraints such as the need to move samples (e.g., to a microscope) often damaging the delicate biofilm structure.
The protocol presented here introduces a fully automated system based on optical coherence tomography (OCT), which allows the in situ, non-invasive monitoring of biofilm morphogenesis at the mesoscale (mm range). OCT is an emerging imaging technique in biofilm research with applications in water treatment and biofouling research, medicine9 and stream ecology10. In OCT, a low coherence light source is split into a sample and reference arm; the interference of the light reflected and scattered by the biofilm (sample arm) and the light of the reference arm is analyzed. A series of axial intensity profiles (A-scans) which contains depth-resolved structural information is acquired and merged into a B-scan (a cross section). A series of adjacent B-scans composes the final 3D volume scan10. OCT provides a lateral optical resolution in the range of approximately 10 µm and is therefore well suited to study mesoscopic structural differentiation of biofilms10,12. For a more detailed description of OCT, refer to Drexler and Fujimoto13and Fercher and colleagues14. Although the field-of-view of a single OCT xy-scan reaches up to hundreds of square micrometers, larger-scale patterns cannot be quantified by means of OCT in a single scan. With respect to biofilms in natural habitats such as streams and rivers, this currently limits our ability to assess biofilm morphogenesis at scales matching the physical and hydraulic template of the habitat.
In order to surpass these spatial limits and to acquire OCT scans automatically, a spectral-domain OCT imaging probe was mounted on a 3-axis positioning system. The installation permits the acquisition of several OCT scans in an overlapping mosaic pattern (tile scan), effectively achieving the tomographic imaging of surface areas up to 100 cm2. Furthermore, the high positioning precision of this system enables to reliably monitor the growth and development of biofilm features in specific sites during long-term experiments. The system is modular and individual components (i.e., positioning device and OCT) of the installation can be used as standalone solutions or flexibly combined. Figure 1 provides an overview of the hard- and software components of the installation.
The system was tested with a commercially available GRBL-controlled CNC positioning device (Table of Materials). The operating distances of this specific positioning platform are 600×840×140 mm, with a manufacturer-indicated accuracy of +/- 0.05 mm and a programmable resolution of 0.005 mm. GRBL is an open-source (GPLv3 License), high-performance motion control for CNC devices. Therefore, every GRBL-based (version > 1.1) positioning device should be compatible with the guidelines and software packages presented here. Moreover, the software could be adapted to other stepmotor controllers with STEP-DIR input type with few modifications.
The OCT device used to assess the performance of the system (Table of Materials) features a low coherence light source with a center wavelength of 930 nm (bandwidth = 160 nm) and adjustable reference arm length and intensity. In the example presented here, an immersion adapter for dipping the OCT probe into flowing water was also used (Table of Materials). The software package developed here for automated OCT scan acquisition critically depends on the SDK provided together with the specific OCT system, however, OCT systems from the same manufacturer with different scan lenses and central wavelengths should be readily compatible.
The GRBL device is controlled by a web server installed on a single-board computer (Figure 1). This grants remote control of the device from any computer with local network or internet access. The OCT device is controlled by a separate computer, allowing the operation of the OCT system aside the automated experimental setup. Finally, the software packages include libraries to synchronize OCT probe positioning and OCT scan acquisition (i.e., to automatically acquire 3D imaging datasets in a mosaic pattern or in a set of defined positions). Defining the position of the OCT probe in 3D effectively allows to adjust the focal plane specifically for (regional) sets of scans. Specifically, on uneven surfaces, different focal planes (i.e., different positions in z direction) can be specified for each OCT scan.
A set of software packages was developed to process raw OCT scans (Table 1). Navigation of the positioning device, OCT scan acquisition and dataset processing are performed with Python-coded Jupyter notebooks, which allow remarkable flexibility in the development and optimization of the software. Two worked and annotated examples of such notebooks (for image acquisition and processing, respectively) are available from https://gitlab.com/FlumeAutomation/automated-oct-scans-acquisition.git They are intended as starting points for customization of the method. A Jupyter notebook is a web browser based application which contain cells with annotated Python code. Each step is contained in a cell of the notebook, which can be executed separately. Due to the different length of the light path through the scan lens (spherical aberration)15, the raw OCT scans appear distorted (Figure 2A). We developed an algorithm to automatically correct for this distortion in acquired OCT scans (contained in ImageProcessing.ipynb, Supplementary File 1). Furthermore, biofilm morphology can be visualized as a 2D elevation map, as was previously used in membrane systems16, and we illustrate how elevation maps obtained from scans taken in a tiling array can be stitched.
Finally, the functionality of the described laboratory installation is illustrated using a flume experiment in which phototrophic stream biofilm is exposed to a gradient of flow velocity.
1. Setup of the Positioning Device
2. OCT Setup
3. Image Acquisition
4. Image Correction and Display
We demonstrate the functionality of the automated OCT imaging system using a flume experiment designed to study the spatio-temporal morphogenesis of phototrophic stream biofilms. A gradually narrowing geometry of the flumes induced gradients in flow velocity along the center of the flume (see reference17). The temporal development and structural differentiation of biofilm was monitored over 18 days with the aim to better understand the effects of hydrodynamic conditions on biofilm morphogenesis. Figure 4 demonstrates the growth of a biofilm microcolony followed over 18 days of growth. Surface morphology of the biofilm was quantified using the toolset described above (Figure 4A). Biovolume was calculated (see worked example ImageProcessing.ipynb, Supplementary File 1) for a square moving window with 3.6 mm edge length (Figure 4B) for each position along the flow velocity gradient (Figure 4C). Biofilm accumulation significantly decreased with increasing flow velocity (indicated as the distance from the widest part of the flume; Figure 4). Importantly, this experimental setup allows a continuous measurement of structural parameters (e.g., biovolume, thickness, roughness) along large spatial gradients. Hence, this new tool provides the means to gain insights into relationships between biofilm structure and environmental cues.
Software component | Description |
stepcraft.py | A Python library to control the positioning device. It contains definitions for navigating and homing the device. |
OctControl.cpp | C++ code derived from the Software Development Kit (SDK) distributed with the OCT system. This has to be compiled using VisualStudio 2017, PythonC/API and the SDK. |
ImagesAcquisition.py | A Python library containing the commands for taking OCT scans in selected positions and defining the scan tiling pattern. |
ImagesAcquisition.ipynb | Jupyter notebook used to navigate the positioning device, acquire OCT scans and for automated image acquisition. |
OctCorrection.py | A Python library defining the functions used for the correction of the raw OCT images and background subtraction. |
OctProcessing.py | A Python library containing the functions to calculate and stitch elevation maps. |
OctProcessing.ipynb | Jupyter notebook to visualize, correct and process OCT scans. This also contains an example of biovolume calculation. |
Table 1. Software components.
Parameter | Value | Description |
Ganymede | 1, 2, 3 | Choice of OCT system and version |
Probe | 1, 2 | Choice of scan lens |
nAscans | 32-900 | Number of A-scans per B-scan |
nBscans | 1-900 | Number of B-scans |
nCscans | 128-1024 | Number of depth pixels |
X | 0.1-10 | Size of image in x-direction (mm) |
Y | 0.1-10 | Size of image in y direction (mm) |
refr | 1-1.6 | Refractive index (1 for air, 1.33 for water) |
avg_Ascans | 3 | Number of A-scan averaging |
scanspeed | 1,2,3 | A-scan Rate (5.5, 15 and 36 kHz) |
path | “../ %Y-%m-%d_%H_%M_%S” | Destination folder for the acquired OCT scans, uses time stamp as naming confention |
colorBoundaries | [0.0-256.0,0.0-256.0] | Color boundaries of the acquired scans |
Table 2. OCT parameter settings.
Figure 1. Overview of hard- and software components. The stepmotors of a GRBL-controlled positioning device are wired to a microcontroller, connected via USB to a single-board computer. The GRBL server is installed on the latter, and motion of the positioning device can be controlled from any web browser via TCP/IP connection. Alternatively, navigation of the positioning device can be performed from a Python-encoded Jupyter notebook (ImagesAcquisition.ipynb, Supplementary File 2) using the GRBLServer.py library. The OCT system is connected to a separate computer from which automated OCT scan acquisition can be performed via a Python script. Please click here to view a larger version of this figure.
Figure 2. OCT scan correction workflow. Panel A shows a non-processed B-scan of biofilm growing on a flat plexiglass surface. The image is distorted (bend) because of differences in path length of the low coherence light through the lens. OCT image distortion can be corrected by identifying a strongly reflecting, flat reference surface in the image. First, 20×20 reference points are evenly distributed across the entire stack of images. In each of these points, the image signal is averaged across a circular area (in x-y direction) for each depth (z plane), obtaining an averaged depth profile of signal intensity. Then, a modified Gaussian filter is applied to of each of the 400 reference profiles. Panel B provides an example of the original signal along the depth profile indicated by the vertical red line in Panel A, the averaged depth profile, and the same profile after the modified Gaussian filter has been applied. The modified Gaussian filter allows the identification of local maxima in signal intensity, thus identifying the location of the strongly reflecting reference surface. Correctly identified reference points are then selected based on the coordinates of their neighbors in three dimensions. In the example in panel C, the yellow points were kept for subsequent image correction whereas purple ones were discarded. A 2nd order polynomial surface is then fit to the correctly placed reference points and used to correct the distortion in the original OCT image by shifting pixels in z direction. Average background intensity is estimated from an empty area of the image and subtracted from the corrected images. Panel D shows the same B-scan after correction and background subtraction. Please click here to view a larger version of this figure.
Figure 3. Elevation maps. Biofilm topology can be visualized as 2D elevation maps in which thickness of the biomass is color coded. For this, a 3D OCT image is thresholded and biofilm thickness calculated as the distance of the uppermost signal to the substrate. Panel A shows the binary mask of a B-scan obtained after thresholding. The blue line indicates the uppermost signal while the red line shows the reference surface. Panel B shows an example of the obtained elevation map, scaled according to the axial resolution of the OCT probe. The red line indicates the position of the B-scan in Panel A.
Figure 4. Representative results showing the effect of flow velocity on biofilm growth. We studied phototrophic stream biofilm morphogenesis along a gradient in flow velocity using flume experiments. Flow velocity increased with distance from the inlet of the flume. After 10 days of growth, biofilm morphology was characterized by automated OCT at different resolution and covering different spatial scales. Elevation maps (A, B and C) demonstrate the morphology of biofilm grown under low, medium and high flow velocity, respectively. These elevation maps are calculated from OCT scans with voxels size in x, y direction of 4 μm. The scan surface area is a square of 3.6 mm edge length. Panels D, E and F show elevation maps (low, medium and high flow velocity, respectively) obtained by stitching 3×3 OCT scans with a voxel size in xy-direction of 11 μm, scan area of 10 mm2 and an overlap between neighboring scans of 30%. Panel G shows an elevation map of biofilm growing along the entire velocity gradient achieved in this flume experiment. It was obtained by stitching 3×51 OCT scans with a voxel size in xy-direction of 40 μm, scan area of 10 mm2 and an overlap between neighboring scans of 30%. The total scan area achieved is 24×353 mm. Panel H reports biovolume in a square moving window of 3.6 mm edge. Average biovolume significantly decreased as a function of distance from the inlet (I). Please click here to view a larger version of this figure.
Figure 5. Precision test for the positioning device. The precision of the positioning device was assessed by mounting a 20.2 Megapixels camera equipped with a 35 mm macro lens on the positioning device, focused on a colored mark. The positioning device was moved in a random direction away from the mark and then positioned back for a total of 80 cycles. The position of the mark was then compared. The figure shows the shift in x and y direction with respect to the first picture. Note that the maximum shift is approximately 16 µm in y-direction and even less in x-direction. Please click here to view a larger version of this figure.
Supplementary File 1. ImageProcessing.ipynb. Please click here to download this file.
Supplementary File 2. ImagesAcquisition.ipynb. Please click here to download this file.
OCT imaging is well suited to resolve structures in the micrometer range with a FOV of several square millimeters. It is thus a powerful tool for biofilm research10,18. However, OCT is currently limited to a maximum scan area of 100 – 256 mm2, while biofilm structural patterns often exceed this spatial scale19, especially when morphological differentiation is driven by large scale environmental gradients20. The automated OCT imaging system described in this protocol extends the surface area characterized by OCT to several square centimeters, effectively enabling to monitor biofilm morphological differentiation over a relevant range of spatial scales (from few millimeters to several centimeters). The high positioning accuracy (within 16 µm; Figure 5) allows to accurately monitor the structural development of biofilms over extended periods of time (Figure 4), effectively boosting the opportunities for obtaining a mechanistic understanding of the drivers of biofilms morphological differentiation. At the same time, this in situ biofilm characterization technique is non-invasive and minimizes the interference with biofilm growth. The image processing solutions presented here build on previously employed analyses of biofilm OCT datasets16, yet the automation provides tools for unprecedented time- and space resolved OCT dataset analyses.
This system was conceived and benchmarked with a specific OCT device, as described in the protocol. Critical steps in the protocol mainly concern the setting of OCT resolution and focusing, which are both critical for high image quality. A limitation of the correction of spherical aberrations routine is that it depends on the presence of a highly reflective flat surface. Alternatively, a standard correction surface could be measured, and then used to correct OCT scans. Furthermore, the stitching of OCT scans depends on sufficient structural features to align neighboring scans. In case of uniform biofilm distribution or low biofilm coverage, stitching may be achieved relying solely on the precision of the positioning device. Finally, as in any other image processing pipeline, when setting up these tools, it is critical to carefully assess the performance of the processing algorithm on a set of representative scans before handling batches of images.
Both hard- and software were designed to provide full modularity of the individual parts. More specifically, this system can be easily adapted to work with other tools for biofilms characterization such as macro-photography imaging using hyperspectral cameras or microsensor profiling. The coupling of structural information with localized gradients in resources around and within biofilms will provide novel and pivotal insights into the way how biofilms are adapted to optimize resource allocation. The flexibility is also implemented through the use of Jupyter notebooks, an open-access, fast and versatile software developing tool.
A critical limitation of OCT imaging in general remains the disability to resolve rapidly moving objects. For instance, streamers elongating into and moving with the flow are not accurately depicted. The applicability of this tool is thus limited to relatively fixed, non-moving biofilm structures. The system is optimized to work autonomously, however, initial settings and if necessary, the manual adjustment of focus and illumination, are still required. This represents a significant limitation if samples differ significantly in density and reflective properties. Full automation, including software-guided focusing and adjustment of illumination may however be achieved using similar principles (e.g., stepper motors and software- hardware feedbacks).
The authors have nothing to disclose.
We thank Mauricio Aguirre Morales for his contribution to the development of this system. Financial support came from the Swiss National Science Foundation to T.J.B.
OCT Probe | Thorlabs | GAN210C1 | OCT imaging device |
OCT scan lens | Thorlabs | OCT-LK3-BB | |
Immersion adapter | Thorlabs | OCT-IMM3-SP1 | |
Stepcraft 840 CK | STEPCRAFT | NA | positioning device |
microcontroller | Arduino Uno R3 | NA | |
Single-board computer | Raspberry PI | NA | |
camera | Canon EOS 7D Mark II | NA | |
camera lens | Canon MACRO EFS 35 mm | NA |