(1) Overview

Introduction

Optical Coherence Tomography (OCT) is a non-invasive imaging methodology which attains fine resolutions [] of several microns similar to microscopy, with a common limitation of penetration depths of a few millimetres. Since its introduction in Ophthalmology in the early 1990s, OCT has cycled through several generations [] – Time-Domain or TD-OCT and Fourier-Domain or FD-OCT, with its two variants Spectral-Domain or SD-OCT, and Swept-Source or SS-OCT. FD-OCT has an SNR advantage [] over the earlier TD-OCT. Most commercial OCT systems are shipped with bundled software which does the data processing necessary for FD-OCT. A large number of open-sourced packages exist, many of them implemented in MATLAB™, which take in the data from the commercial OCT systems and do post-processing such as segmentation []. Some groups have also open-sourced GPU-based [] OCT pipelines. Our research effort is to produce low-cost OCT [] implementations, along with the software required for data acquisition and processing.

Our focus on lowering cost precludes SS-OCT due to relatively high costs of swept-sources. From our initial [] TD-OCT implementation, we moved on to FD-OCT to shorten acquisition times as is needed for in-vivo biological samples. We found parallel SD-OCT [] to be an architecture which could support a low-cost implementation. The software reported here implements data acquisition and processing without the need for expensive components like GPU-accelerated high-throughput data-acquisition cards. Simplicity and ease of use were our main considerations.

The cost of OCT devices represents a significant barrier to entry into the field, preventing the adoption of OCT for a wider range of applications. Commonly available commercial OCT devices cost more than five figures in US dollars till recently []. This software would be useful for optics researchers who wish to assemble lab-built camera-based parallel SD-OCT devices for one-tenth the cost of commercial devices. The detailed descriptions of our device designs, published separately [], along with this software, help in the democratization of OCT. Such low-cost OCT devices are not just useful for clinical use; they also encourage the use of OCT devices in University laboratories, enabling inter-disciplinary work with Material Science, Chemistry or Biology departments. Compared to electron microscopy, OCT tomograms are less expensive and have additional advantages of ease of sample preparation and of being non-destructive. Tomographic imaging of crystal imperfections, biofilms, measurements of refractive index and dispersion of samples, volume renderings of micro-machined or laser etched parts and many more applications can result from inter-departmental collaborations using OCT. Many more innovative investigations could result from lowering the cost barrier to entry for OCT imaging.

Researchers in OCT commonly use the terms A-scan and B-scan. A-scan refers to the one-dimensional reflectivity plot at one point on the sample, along its depth. B-scan refers to a 2-D plot of sample reflectivity, with the lateral extent along the sample shown on the horizontal axis, and the depth axis going into the sample being depicted as the downward vertical axis. This is illustrated in Figure 1. We refer to B-scans repeatedly in our discussion.

Figure 1 

Illustration of A-scans and B-scans in OCT. The intensity plot of the sample reflectance from various depths along the arrows are A-scans, while the collection of A-scans in the shaded area is a B-scan. The downward z-axis is into the sample. The x-axis shows the lateral extent of the sample.

Implementation and architecture

ABC-OCT, Affordable B-scan Camera-based Optical Coherence Tomography, is implemented in C++ using the OpenCV [] framework. It is compatible with the platforms supported by OpenCV, and has been tested on Windows 8.1, Windows 10 and Linux (Mint 18.1, kernel 4.4.0). We use a version including the camera SDK from QHYCCD [] of our camera (QHY5L-II M) compiled from BscanFFT.cpp for our research. In case a camera from another manufacturer is being used, if an SDK is supplied, our code can easily be modified to use that SDK. To demonstrate this, we have included a version of our software which will work with any available webcam, which can be compiled from BscanFFTwebcam.cpp.

The block diagram presented in Figure 2 shows the processing steps being carried out. A screenshot our of software in action is presented in Figure 3, with the various windows labelled.

Figure 2 

Flowchart of operations performed by our ABC-OCT software.

Figure 3 

Screenshot of ABC-OCT in action. The labelled windows are – 1. Terminal window, where some status messages and error messages appear; 2. Display window, showing the camera view; 3. The computed B-scan in false colour; 4. Status window with information about capture parameters.

Quality control

The software has been tested for both algorithmic correctness as well as for cross-platform operation by running on multiple platforms, as listed in the availability section. The test images included in the source repository were used to verify correctness of the code, by comparing the results of the included Matlab-compatible GNU Octave code and our C++ code. The BscanFFTsim.cpp file, when compiled, creates a test version of our software which can directly read test image files. To quickly test the webcam version of our software, the user just needs to run it and display the included test images in front of the webcam, which can be done using a mobile phone, for example.

A possible test procedure for the webcam version is:

  1. Copy the images included in our code repository to a smartphone – imgi.png and backg.png which are located in the Matlab files directory of our source repository.
  2. Display backg.png full-screen on the phone using the Gallery app or equivalent.
  3. Start the webcam version of our software – of which binaries are included in the Release.
  4. Hold up the phone to the webcam until the displayed screen shows that the mobile phone screen covers the entire field of view of the webcam, and it is in focus.
  5. Press b to capture the background. (The software needs to have focus for this, not the commandline window.) This would make the B-scan screen change colour from being uniformly blue to a varying display, indicating that the background has been captured. The mobile phone can now be removed from its position in front of the webcam.
  6. Display imgi.png on the mobile phone and hold it up to the webcam, just as in step 4.
  7. You would now see a display of the B-scan corresponding to the interferogram in imgi.png. This can be saved by pressing s.
  8. The file is saved in a sub-directory of the present working directory, named with a date-timestamp followed by a descriptive string as set in the ini file.

(2) Availability

Operating system

The software has been tested by compiling and running on Microsoft®Windows 8.1, Microsoft®Windows 10 and Linux Mint 18.1. Software using the same QHYCCD SDK has been successfully run on Windows XP. Hence, it is likely that compiling with suitable architecture flags (32-bit or 64-bit) would enable this software to run on the wide range of OS families supported by the OpenCV framework and the QHYCCD SDK. The included Windows binaries have been tested and found to be running on Windows 8.1 and Windows 10. The included AppImage Linux binaries have been tested and found to be running on Linux Mint 18.1, Ubuntu 16.04 LTS and Fedora 24. Newer distros are likely to have problems with the AppImage due to libc incompatibilities, and hence compiling from source is recommended.

Programming language

The software is written in C++, and has been tested by compiling with GCC version 5.4.0 and Microsoft®Visual Studio Community version 15.9. It is likely that the software will compile and run on the wide range of architectures supported by the OpenCV framework and the QHYCCD SDK.

Additional system requirements

Installed size of the ABC-OCT software is only a few MB, but a modern PC with at least 4GB of RAM is recommended. The default settings make the software use slightly more than 1 GB of RAM, in order to optimize performance. The raw data dumps saved also use up disk space; typically 1 GB for 50 frames of capture data with saving of intermediate frames enabled. The full functionality of the software, with exposure control and arbitrary capture frame size needs a QHYCCD (brand name) camera and its SDK to be installed. The webcam version needs a functioning webcam installed on the system. Keyboard inputs are used to control the software.

Dependencies

The ABC-OCT software requires the OpenCV framework. opencv-3.3.1 and opencv-3.4.0 have been tested, higher versions should also work. Realtime display requires a camera SDK from QHYCCD, or any installed webcam.

List of contributors

Hari Nandakumar did the software development and is its current maintainer. Shailesh Srivastava supervised the development process.

Software location

Archive

Name: Zenodo

Persistent identifier: https://doi.org/10.5281/zenodo.3403735

Licence: MIT license

Publisher: Hari Nandakumar

Version published: 1.12b

Date published: 25/03/19

Code repository GitHub

Name: ABC-OCT

Persistent identifier: https://github.com/hn-88/FDOCT

Licence: MIT license

Date published: 25/03/19

Language

English (UK).

(3) Reuse potential

Our ABC-OCT software enables anyone with access to an undergraduate level optics lab to assemble and use a parallel Fourier-Domain Optical Coherence Tomography (FD-OCT) instrument. Even the webcam demo version enables qualitative tomographic imaging. The software has been made freely available to the community to further encourage the use of OCT imaging in student laboratories and elsewhere.

Support

The MIT License has been selected to ensure that the code is available with minimum restrictions. Support for modifying and using the software is available through GitHub issues page, or by contacting the corresponding author.