Open access peer-reviewed chapter

Low Cost Open-Source OCT Using Undergraduate Lab Components

By Hari Nandakumar and Shailesh Srivastava

Submitted: January 29th 2019Reviewed: June 13th 2019Published: May 27th 2020

DOI: 10.5772/intechopen.88031

Downloaded: 293


Instrument cost is one of the factors limiting the adoption of optical coherence tomography (OCT) from a wider range of applications. We present a couple of OCT devices using optical components which are commonly found in undergraduate-level optics laboratories. These low-cost devices have lower signal-to-noise ratios (SNR) than top-of-the-line commercial offerings, yet can serve most of the needs of academic laboratories. A time-domain full-field (TD-FF-) OCT device has been assembled with Arduino control, which yields sub-4-μm axial and lateral resolutions. This device is useful where quick sample acquisition is not critical, but high resolution is paramount, for example with samples from material-science, or ex-vivo stabilized biological samples. Next, we discuss a spectral-domain (SD-) OCT device which delivers real-time video rate B-scans. This device is useful where real-time signal acquisition is desirable, for example with in-vivo biological samples. Cross-platform open-source software control for both these devices is also made available.


  • full-field optical coherence tomography
  • spectral-domain OCT
  • low-cost
  • open-source
  • CMOS camera

1. Introduction

Non-clinical uses of optical coherence tomography (OCT) has mainly been in industrial scale non-destructive materials testing, and for the study of invaluable historical artifacts [1]. Purchase costs of commonly available commercial OCT devices remained above five figures in US dollars till recently [2]. The lowest priced OCT device available for purchase is, as of 2019, the OQ Labscope from Lumedica, at US$9995 [3, 4]. The cost of the instrument makes it inaccessible to undergraduate students, especially in developing countries. In this chapter, we present a couple of schemes developed in our lab, utilizing commonly available optics lab components to construct capable OCT instruments—in time-domain (TD-OCT) and spectral-domain (SD-OCT) configurations. Such instruments could then be used to study a wide variety of biological and inorganic samples, by choosing an illumination wavelength in which the sample is relatively transparent or translucent.


2. Full-field TD-OCT

2.1 Motivation

Full-field optical coherence tomography (FF-OCT) or optical coherence microscopy (OCM) is commonly constructed in a Linnik or Michelson interferometer configuration—that is, with or without microscope objectives—as shown in Figure 1. FF-OCT employs a 2-D image sensor like a CCD or CMOS camera as the detector, and en-face images of the sample are acquired at different depths by coherence gating. High axial and lateral resolutions are possible with FF-OCT. High-speed cameras also allow FF-OCT to be employed with swept-sources. But FF-OCT can also be implemented [5] using existing lab components with a minimum of parts being purchased. This approach assumes static samples, since the acquisition time for an OCT volume can take a few minutes.

Figure 1.

(a) Schematic of an FF-OCT system with microscope objectives and (b) image of our set-up without microscope objectives. Labeled components are: 1, LED; 2, sample; 3, lens; 4, aperture; 5, cube beam splitter; 6, front surface of a prism as reference mirror; 7, lens; 8, translation stage actuated by stepper motor; 9, camera.

The use of FF-OCT in the time-domain configuration avoids specialized and potentially expensive components such as galvanometer or MEMS micromirror scanners, swept-sources and even superluminescent diode (SLED) or halogen or supercontinuum sources. Simple LEDs provide sufficient illumination for sub-10-μm imaging. Such a system has the potential to create high resolution 3D tomograms at very low cost. The system schematic and an illustrative photograph are shown in Figure 1.

2.2 Choosing the right components

2.2.1 Source and detector

The axial resolution of the FF-OCT device directly depends on the choice of light source used, since axial resolution [1] is given by


where λis the center wavelength of the source and Δλis the full width at half maximum (FWHM) bandwidth of the source spectrum. Additionally, the detector or camera sensor should also have adequate sensitivity over the source spectrum. If the source spectrum is broader than the camera’s sensitive region, only the part of the source spectrum convolved with the camera’s spectral sensitivity would be the relevant source bandwidth in the Eq. 1 for axial resolution. Thus, if a standard RGB CMOS or CCD camera is used, only the individual red, green or blue sensor bandwidth would be relevant. Hence, it is advisable to use a monochrome camera if sub-micron axial resolutions are desired. Additionally, consumer-grade cameras almost invariably have IR filters attached to their sensors. These filters will severely limit the use of such cameras with near-IR sources.

Now for some real-world numbers relating to center wavelengths, spectral bandwidths and achievable axial resolutions. The source spectrum of a white LED is shown in Figure 2. Though this spectrum is far from the Gaussian spectral shape assumed in Eq. 1, we can assume a spectrum of 200 nm bandwidth centered at 540 nm based on the full-width at half-maximum (FWHM) from the weighted center of the spectrum. With such a source, Eq. 1 would let us have a best-case axial resolution of 0.64 μm if a monochrome camera is used. A digital SLR camera, Canon 1100D, used as the detector for a white LED source resulted [5] in sub-4 μm axial resolutions, due to the convolution of the source spectrum with the RGB sensors’ sensitivity discussed above. In this case, the R data alone was used, thus filtering out the G and B parts of the spectrum and reducing the available source bandwidth. Dispersion compensation is also critically important when broad spectrum sources are used. We discuss dispersion compensation in more detail in Section 2.3. The spectrum of a red LED is shown in Figure 2. Using its FWHM of 20 nm and center wavelength of 670 nm, Eq. 1 yields an axial resolution of 9.90 μm. This is quite adequate for many purposes. A camera without an IR filter, like the monochrome CMOS planetary imager (QHY5L-II M) shown in Figure 3, enables the use of near-IR sources. Longer wavelengths like near-IR have greater penetration depths in biological samples which exhibit strong Rayleigh scattering. IR LEDs are commonly available with center wavelengths of 850 nm and FWHM of 25 nm, which can give us an axial resolution of 12.8 μm.

Figure 2.

Source spectra of LEDs obtained using an Ocean Optics USB 4000 spectrometer: white LED in blue, red LED in red.

Figure 3.

An example of a low-cost monochrome CMOS camera: QHY5L-II M.

2.2.2 Optical components

Uncoated components can be used in the experimental setup for lowering cost. Optical losses due to component reflections would need to be compensated by increasing exposure time at the camera. A cube beam splitter is used in order to avoid dispersion mismatch between the interferometer arms. In case a plate beam splitter is used, dispersion compensation should be done by the insertion of a glass plate of similar thickness in the shorter arm as explained in Section 2.3. The lateral resolution of the system directly depends on the quality of the lenses used. The expression for the lateral resolution of an OCT system [1] is similar to that of a microscope,


where fand Dare the focal length and aperture size of the objective lens. Commonly available microscope objective lenses are listed in terms of magnification available for a standard length microscope, like 10×. A typical 10× objective like the Newport M-10× [6] has a focal length of 16.5 mm and a clear aperture of 7.5 mm. Theoretically, this should yield an axial resolution of 1.56 μm. Experimentally, imaging with uncoated lab lenses uncorrected for aberrations, resolution below 4 μm [5] was obtained.

2.2.3 Automated signal acquisition and processing

Standard single axis translation stages like the TS-35 from Holmarc can be converted to micro-stepping operation using 3D-printed stepper motor coupling shafts which are commonly available online. Driving stepper motors with microstepping drivers like the Bholanath BH MSD 2A enable sub-micron translations. The microstepping driver just needs a TTL signal to initiate the microstep. This can be automated using microcontroller platforms like Arduino. TTL outputs can also be generated by PCs using serial or parallel ports. The sample is attached to the translation stage and moved axially through the microscope objective’s focus which should coincide with the zero-path-difference point. Simple automation scripts can then be written to acquire images and translate the sample in the axial direction. We have open-sourced Arduino and OpenCV-based code [7] to acquire and process FF-OCT volumes using the camera SDK from QHYCCD. This code can be easily modified to work with SDKs and cameras from other manufacturers, or even with simple webcams. A screenshot of this software is shown in Figure 4.

Figure 4.

Screenshot of open-source software for acquiring FF-OCT images.

2.3 Experimental method

The first hurdle in assembling a low-coherence interferometer is accurate estimation of the zero-path-difference point in the two interferometer arms. Our method to do this was as follows. We first verify interferometer alignment by observing coarse interference fringes using visible laser illumination, making sure the fringes remain similar in shape when the moving arm is translated. Next, we translate the moving arm 10 μm at a time under narrow-spectrum LED illumination, monitoring the camera output continuously until interference fringes are visible. Once the zero-path-difference point is identified, the illumination can be changed to wide-spectrum white LEDs or halogen if desired. If the sample is being imaged through a medium, for example if the sample is being used with an oil-immersion objective lens, high axial resolutions with broad-spectrum sources are possible only with dispersion correction. This can be done experimentally by introducing glass plates or cover slips of varying thickness to minimize the axial displacement over which fringes appear for a particular reflective layer.

Many inexpensive camera sensors including mobile phone cameras now allow saving of images in RAW format. Saving in RAW format allows the export of images with a gamma of 1.0, i.e., having a linear detector response to incident optical power. Software like DCRAW can then be used to convert the RAW images to linear TIFF [8, 9] or other image formats. Acquisition of RAW images is not mandatory. If a simple webcam is used as the detector, its output may not be linear with optical power, but interference fringes would still be visible. Such images also could be used to create tomograms, with the rider that the intensities of the reflectors may not be accurately portrayed. Qualitative imaging can still be done, and feature positions would not be affected by the nonlinear camera response.

Post-processing of the images involves subtracting the background DC and taking the Hilbert transform [1] of the images (perpendicular to the fringe lines). The resulting en-face tomographic images can either be volume rendered using free software like Blender [10, 11] or Octave [12], or displayed as single slices in movies and so on. Some examples of tomograms rendered with Blender and Octave are shown in Figure 5. Lateral calibration, pixels per micron, can be done by imaging known samples like USAF targets. Axial calibration directly results from the known motion of the micro-stepping translation stage. The distances we measure with OCT are optical path lengths—actual distances inside samples would be the optical path length divided by the sample refractive index.

Figure 5.

Tomograms: (a) microchannels in PDMS rendered in blender. (b) Profile of numeral 2 on a coin, plotted in octave.

3. Parallel SD-OCT

3.1 Motivation

Signal-to-noise ratio (SNR) of Fourier-domain optical coherence tomography (FD-OCT) can be higher by several orders of magnitude compared to time-domain optical coherence tomography (TD-OCT) [13]. This motivates us to devise a way to use the components we have used for FF-OCT in an FD-OCT configuration. FD-OCT can be implemented either with swept-sources (SS-OCT) or using spectrometers as spectral-domain OCT (SD-OCT). Swept-sources are expensive, so we do not attempt to assemble a Swept-Source OCT (SS-OCT) device. Instead, we explore a way to use the two-dimensional camera sensor in a parallel spectrometer design. The schematic of a parallel FD-OCT [14, 15] setup, also known as line-field OCT [16, 17] is shown in Figure 6. Such a configuration captures data for a complete B-scan in a single frame captured by the camera. Even a low-cost CMOS camera which can do 200 fps for 320 × 240 frames would then enable an FD-OCT system with a respectable 48,000 A-scans per second.

Figure 6.

(a) Schematic of a parallel FD-OCT system (b) our set-up. Labeled components are: 1, collimated SLED source; 2, steering mirror; 3, cylindrical lens; 4, cube beam splitter; 5, plane surface of NDF as sample; 6, reference mirror; 7, collimating lens; 8, steering mirror; 9, grating; 10, imaging lens; 11, camera.

3.2 Specialized components needed

The parallel OCT configuration manages to avoid scanning mirrors, but an SLED source would be needed to focus the line illumination on the sample below a thickness of 100 μm. The extended nature of common LED sources prevent them from being tightly focused in this manner. The $300 SLED (Superlum SLD-340-MP-TO56) and a short focal length aspheric lens for collimation are hence necessary purchases. Care needs to be taken to avoid back-reflections, which can cause damage to SLEDs. The collimating lens should therefore have an anti-reflection coating at the SLED’s wavelength range. A diffraction grating or other dispersive element would also be needed.

Here, we would like to point out that SLEDs need greater care in handling than LEDs. Not only are they static-sensitive, they also degrade if overheated or overdriven. Many varieties of free-space SLEDs are also highly sensitive to back-reflections, which can even cause irreversible damage when operated at high powers. Common laboratory power supplies tend to produce large spikes when they are powered on or off, and if an SLED is being driven by such a power supply, it will undergo irreversible damage, reducing its power output. Dedicated driver modules, or laser diode drivers, are the preferred sources to drive SLEDs. The minimum precautions needed would be to employ good heat-sinking, drive at only 50% of rated power, and isolate the SLEDs from power supply spikes using extra switches.

Unlike the TD-OCT case, linear detector response is important for FD-OCT. The noise-floor of the final B-scan also depends on the SNR of the camera. Hence, the camera needs to be chosen with some care, and needs to have gamma, gain and exposure-time controls at the very minimum. We have shown [18] that with simple observations, we can estimate the noise level CMOS cameras. Sensors exhibiting low-noise characteristics along with a high dynamic range are preferable, but useful work can still be done if the camera’s SNR is only 40 dB, as with 8-bit cameras which have a dynamic range of only 48 dB. Averaging helps to reduce noise, with the statistical noise reduction of Nfor Naverages.

3.3 Experimental method

3.3.1 General setup

The cylindrical lens used in the parallel FD-OCT system illuminates a line on the sample (and the reference arm). The spectrum of this line is dispersed by the grating onto the 2D camera sensor. In our implementation, the line is along the vertical axis of the sensor, and the spectrum is thus obtained along each horizontal line of pixels of the camera. Though the post-processing of the captured data is more involved, the practical setting up the FD-OCT assembly is much easier than in the TD-OCT case, since finding the zero-path-difference point is not critically important. Focused width of the line illumination can be measured by imaging the line on the camera. The grating equation points to the angle at which the imaging lens and camera assembly needs to be set up. Once the spectrum is obtained on the camera, the standard FD-OCT post-processing yields a B-scan from each frame.

3.3.2 Spectrometer calibration

In Section 3.4, we discuss the details of the data processing needed to create B-scans from the interograms obtained with the FD-OCT assembly. The required input for the data processing is the calibrated spectrogram, i.e., intensity as a function of wavelength or wavenumber. For this, we need to calibrate the spectrometer consisting of the dispersive element (grating), focusing optics and camera. Since our grating produces a spectrum which is linear in wavelength, we just need to find the bandwidth of the spectrometer for its calibration. This is because we align the camera to have the spectrum centered around the known center wavelength of the source. We used a simple iterative calibration procedure which was easy to use because our software permitted configuration via a text file of parameters. Our calibration procedure was:

  1. Enter the source’s FWHM bandwidth as an initial estimate of our spectrometer measurement bandwidth, as the min/max wavelengths in our software’s ini file.

  2. With these settings, use a single surface reflector as the sample in the FD-OCT device. By moving the reflector using a calibrated micrometer translation stage, note the number of B-scan pixels corresponding to a known distance, say 1 mm, of translation. From the known total number of pixels in the B-scan, compute the measurement depth of our OCT device.

  3. From FD-OCT theory, the measurement depth of an FD-OCT device, if not corrected for the complex conjugate, [1] is


where λ0is the source center wavelength and Δλis the full width at half maximum (FWHM) bandwidth. If the spectrometer measures a smaller bandwidth than the source bandwidth, the Δλwould become the spectrometer bandwidth. We use the known value of λfrom the source datasheet. Our measured zmax, then gives us the required Δλ. We thus calibrate our spectrometer as having a minimum wavelength λ0Δλ/2and a maximum wavelength λ0+Δλ/2and enter these parameters in our software’s parameter ini file.

3.3.3 Measurable depth and axial resolution

We note that there could be a trade-off between measurable depth and axial resolution, when the number of spectrometer pixels is limited. For example, if a sensor with resolution 1280×960is used with 2×2binning, the number of usable spectral points, without interpolation, is just 640. Eliminating the complex conjugate half of the Fourier transform, the resulting B-scan would have only 320 points. If a measurement depth of 6.4 mm is obtained with such a sensor configuration, the number of pixels would limit the axial resolution to 20 μm even if the source characteristics can provide a higher resolution using Eq. 1. We note that the spectrometer resolution can easily be varied by changing the relative powers of the collimating lens and imaging lens in the spectrometer section of the FD-OCT setup. In our setup as seen in Figure 6, we have used,

  1. cylindrical lens with f=15cm

  2. cube beamsplitter with NR coating 700-1100 nm

  3. reflection grating with 1200lines/mm(Richardson gratings 360R25x50x6 from Newport)

  4. output collimating lens with f=24cm

  5. imaging lens with f=10cm

and obtained a measurement depth of 6.6 mm with an axial resolution of 20.7 μm, with 2×2binning on 1280×960frames.

3.4 Data processing

In our parallel FD-OCT configuration, each horizontal line on the acquired image corresponds to the spectrum obtained from a single point on the sample. According to the theoretical background [19] of FD-OCT, this spectrum corresponds to an A-scan at that sample point as defined by the following relations. Representing the spectrum as a function of wavenumber k,


where Skis the source’s power spectral density, rRis the reference arm’s amplitude reflectivity, rslsis the sample arm point’s amplitude reflectivity density of a discrete reflector located at a path length lsinside the sample and nsis the sample’s refractive index. The first term in the right-hand side of Eq. 4 is the reference intensity term. Subtracting DC from the Ikgets rid of this term. The second term in Eq. 4 is the desirable one in FD-OCT, and is used to extract rslsusing the inverse Fourier transform. The third term is the self-interference or autocorrelation term. Autocorrelation causes artifacts in FD-OCT. If sample reflectivity is significantly weaker than the reference arm reflectivity, the autocorrelation term can be safely ignored. Thus, data processing for FD-OCT involves DC subtraction and an inverse Fourier transform on the spectral interferogram represented as a function of wavenumber k.

The captured spectrum obtained by dispersion from a grating is equispaced in wavelength, that is, the raw data we obtain is Iλ. This needs to be interpolated to a function Ikequispaced in k. Basic image processing steps like binning and moving average improve the quality of the image. Further, addition of a larger number of FFT points by interpolation improves final B-scan SNR. Thus, a typical pipeline for data processing FD-OCT data would be:

  1. Acquire frames—either of source spectrum or of sample interferogram.

  2. Process the frames, optionally, with image processing steps like

    1. binning

    2. averaging

    3. moving average filter

    4. median filter

    5. increasing number of points by zero padding in Fourier domain.

  3. Save a frame with the source spectrum alone.

  4. Acquire sample interferogram.

  5. Divide the sample interferogram by the source spectrum to obtain the apodized interferogram.

  6. Optionally increase the number of points in the interferogram by performing a Fourier transform, zero-padding in the Fourier domain, and then performing an inverse Fourier transform.

  7. Resample the interferogram using interpolation to make it equispaced in krather than equispaced in λ.

  8. Perform inverse Fourier transform on the apodized interferogram to obtain the B-scan.

  9. Optionally average the B-scan, mask out the DC component, display on screen, save data to disk storage.

We have written real-time code to capture and display B-scans using such a parallel FD-OCT setup. This cross-platform open-source software [20] has been implemented in C++ using the OpenCV [21] framework. Even without using GPU processing, this software can process and display B-scans at 148 frames per second (fps) for low resolution 320 point FFTs, and at 48 fps for 1280 point FFTs, on an i7 MacBook Pro. A screenshot of this software in action is presented in Figure 7.

Figure 7.

Screenshot of our open-source software which displays B-scans in realtime.

4. Conclusions

In this chapter, we discussed the possibility of assembling capable OCT devices using common laboratory components. Such devices can be put together at low cost, or at no cost if the items are already available, in just a few hours. Such devices would encourage the use of OCT in University optics laboratories, where they could be utilized in inter-disciplinary studies along with Material Science, Chemistry or Biology departments. The microscopic tomograms produced with OCT avoid the expense and preparation required for electron microscope imaging, and also have the advantage of being non-destructive. Tomographic reconstructions of crystals which can show up micron-level imperfections, measurements of biofilm thickness, sample optical dispersion measurements, volume renderings of micro-machined or laser etched parts, or measurements of thick-film deposition are just a few of the myriad applications which can result from the ready availability of OCT in an academic setting. Lowering the cost barrier to entry for OCT imaging is likely to stimulate innovative investigations.


This work was not funded by any grant from any funding agency.


Conflict of interest

The authors declare that they have no conflict of interest to report.

Notes/thanks/other declarations

We thank Bhagawan Sri Sathya Sai Baba, the founder Chancellor of our University, for help and guidance during the low-cost OCT development work.

Appendices and Nomenclature

OCToptical coherence tomography
FF-OCTfull-field optical coherence tomography
FD-OCTFourier-domain optical coherence tomography
SD-OCTspectral-domain optical coherence tomography
TD-OCTtime-domain optical coherence tomography

© 2020 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution-NonCommercial 4.0 License, which permits use, distribution and reproduction for non-commercial purposes, provided the original is properly cited.

How to cite and reference

Link to this chapter Copy to clipboard

Cite this chapter Copy to clipboard

Hari Nandakumar and Shailesh Srivastava (May 27th 2020). Low Cost Open-Source OCT Using Undergraduate Lab Components, Optical Coherence Tomography and Its Non-medical Applications, Michael R. Wang, IntechOpen, DOI: 10.5772/intechopen.88031. Available from:

chapter statistics

293total chapter downloads

More statistics for editors and authors

Login to your personal dashboard for more detailed statistics on your publications.

Access personal reporting

Related Content

This Book

Optical Coherence Tomography and Its Non-medical Applications

Edited by Michael Wang

Next chapter

Optical Coherence Tomography for Polymer Film Evaluation

By Jianing Yao and Jannick P. Rolland

Related Book

First chapter

Direct Laser Lithography and Its Applications

By Hyug-Gyo Rhee

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.

More About Us