Acceleration of OCT Signal Processing with Lookup Table Method for Logarithmic Transformation

Real-time Fourier domain optical coherence tomography (FDOCT) has been widely used in clinical applications. In order to accelerate the imaging processing and display of FDOCT, an alternative lookup table-based strategy for logarithmic transformation was presented. In this paper, real-time and high-quality FDOCT imaging display of biological tissues at an A-line rate of 62 kHz was demonstrated by optimizing the logarithmic calculation.


Introduction
Optical coherence tomography (OCT) is a noninvasive, high-resolution optical imaging technique that can provide a cross-sectional and three-dimensional structure of biological tissues in micrometer scale [1].There are two kinds of OCT technologies including time domain OCT (TDOCT) and Fourier domain OCT (FDOCT).TDOCT acquires interference signal based on mechanical scanning of reference arm, hence the scanning rate is limited by the hardware.FDOCT that obtains the structural information by evaluation of the interference spectrum is capable of a much higher scan rate since no scanning of the reference arm is needed.It has been reported that a multi-MHz scan rate can be achieved in a swept source OCT (SSOCT) system by using an ultra-high-speed Fourier domain mode-locked laser [2].
Despite the achievement of scan rate, the bottleneck of imaging display is the mass data processing.The signal processing of OCT includes data transfer, background subtraction, data resampling, Fourier transformation, and logarithmic transformation in which logarithmic-scaling takes a high proportion of total processing time.Due to strong absorption of light in biological tissues, the intensity of OCT signal from superficial and deep layers of tissue varies by several orders of magnitude.By mapping logarithmically transformed raw data to a series of fixed gray values to adapt the psychological properties of the human eyes, weak backscattered signals can be visualized more clearly with a compressed dynamic range [3].For this reason, logarithmic transformation has become a standard procedure for OCT signal processing.
In FDOCT, the use of a logarithmic amplifier after the photodetector to save logarithmic calculation time as in TDOCT [4] is inappropriate since Fourier transformation of the signal in log scale would distort imaging and degrade resolution [5].Alternative methods of compressing the dynamic range to accelerate processing in OCT have been demonstrated.For example, a truncation logarithm method was adopted to achieve a predetermined dynamic range by selecting an appropriate threshold in logarithmic calculation, however at a cost of degraded imaging quality [6].Parallel computing accelerated algorithms based on graphics processing units (GPU) can be used for real-time OCT data processing and imaging display [7,8].However, high-performance GPUs are limited in the market and costly.Therefore, a low cost and less complex technique to accelerate OCT signal processing, especially logarithmic calculation for real-time display, is attractive.In this paper, a lookup table method is proposed to improve the processing speed of logarithmic transformation in FDOCT.

OCT System
A swept source OCT system shown in Figure 1 was built to demonstrate the capacity of the proposed technique.Output light from a 1310 nm swept source laser (87 nm bandwidth, 20 mW average power, 100 kHz A-scan rate, Santec Corporation, Japan) was split by a coupler with 90% of the light into the sample arm and 10% into the reference arm, respectively.Two circulators were used to redirect the back-reflected light to a 2 × 2 fiber coupler for balanced detection.In the detection arm, the signal detected by the photodetectors was recorded by an analog to digital converter (ATS9360, Alazar).The entire OCT was controlled and processed on a personal computer (CPU: Intel i7-6700K@4GHz, RAM: 32GB, operating system: Window 7, 64 bit).
limited in the market and costly.Therefore, a low cost and less complex technique to accelerate OCT signal processing, especially logarithmic calculation for real-time display, is attractive.In this paper, a lookup table method is proposed to improve the processing speed of logarithmic transformation in FDOCT.

OCT System
A swept source OCT system shown in Figure 1 was built to demonstrate the capacity of the proposed technique.Output light from a 1310 nm swept source laser (87 nm bandwidth, 20 mW average power, 100 kHz A-scan rate, Santec Corporation, Japan) was split by a coupler with 90% of the light into the sample arm and 10% into the reference arm, respectively.Two circulators were used to redirect the back-reflected light to a 2 × 2 fiber coupler for balanced detection.In the detection arm, the signal detected by the photodetectors was recorded by an analog to digital converter (ATS9360, Alazar).The entire OCT was controlled and processed on a personal computer (CPU: Intel i7-6700K@4GHz, RAM: 32GB, operating system: Window 7, 64 bit).

Lookup Table Method
In our experiment, the structural signal after Fourier transformation varies in a range of 80 dB.Logarithmic transformation of the signal in such a large range based on the conventional calculation is time-consuming.In current system, it takes 13.3 ms to perform logarithmic transformation in a frame with 1024 × 1000 pixels, which occupies more than 60 percent of total processing time.Since an excessive precision of logarithmic calculation is not necessary in grayscale imaging, a lookup table consisting of pre-calculated logarithmic values can be used to perform logarithmic transform.
The recorded raw data Y can be expressed in scientific notation as Y = X × 10 n , in which the significand X is a decimal less than 10 and the integer n is the order of magnitude.Based on the properties of logarithmic calculation, the logarithmic value of Y = X × 10 n can be expressed as: If the logarithmic value of X and the order of magnitude n are known, the logarithmic value of Y can be calculated by simply adding them together.The calculation accuracy is determined by the number of digits of X. Considering the precision requirement of logarithmic calculation in OCT data processing is relatively low, the number of digits of X can be reduced correspondingly.Figure 2 shows the calculation process of the lookup method based on a table of 1000 components.To calculate

Lookup Table Method
In our experiment, the structural signal after Fourier transformation varies in a range of 80 dB.Logarithmic transformation of the signal in such a large range based on the conventional calculation is time-consuming.In current system, it takes 13.3 ms to perform logarithmic transformation in a frame with 1024 × 1000 pixels, which occupies more than 60 percent of total processing time.Since an excessive precision of logarithmic calculation is not necessary in grayscale imaging, a lookup table consisting of pre-calculated logarithmic values can be used to perform logarithmic transform.
The recorded raw data Y can be expressed in scientific notation as Y = X × 10 n , in which the significand X is a decimal less than 10 and the integer n is the order of magnitude.Based on the properties of logarithmic calculation, the logarithmic value of Y = X × 10 n can be expressed as: If the logarithmic value of X and the order of magnitude n are known, the logarithmic value of Y can be calculated by simply adding them together.The calculation accuracy is determined by the number of digits of X. Considering the precision requirement of logarithmic calculation in OCT data processing is relatively low, the number of digits of X can be reduced correspondingly.Figure 2 shows the calculation process of the lookup method based on a table of 1000 components.To calculate the logarithmic value of Y = X × 10 n , the order of magnitude n and significand X were determined first and then X was rounded to two decimal places.A table consisting of logarithmic values of integers from 1 to 1000 was built beforehand.Rounding of X × 100 was used as the address to look up in the pre-calculated table.The corresponding logarithmic value of Y can be obtained by adding n-2 to the lookup value.
Appl.Sci.2019, 9, x FOR PEER REVIEW 3 of 6 the logarithmic value of Y = X × 10 n , the order of magnitude n and significand X were determined first and then X was rounded to two decimal places.A table consisting of logarithmic values of integers from 1 to 1000 was built beforehand.Rounding of X × 100 was used as the address to look up in the pre-calculated table.The corresponding logarithmic value of Y can be obtained by adding n-2 to the lookup value.
Figure 2. The calculation process of the lookup table method for logarithmic transformation based on a table of 1000 components.

Results
The calculation error with the lookup table method was defined as the maximum difference between the lookup table calculation results and the actual logarithmic values.The calculation error decreased with the size of the lookup table as shown in Figure 3, however, at the cost of more memory of the computer and more lookup time.Considering a balance between processing time, memory and calculation error, a table of 1000 components was chosen to calculate the logarithmic function with the maximum error of 0.0043.The processing time of logarithmic transformation for B-scan imaging (1024 × 1000 pixels) was reduced from 13.3 ms to 9.3 ms with the lookup table method.As shown in Figure 4, the real-time processing A-rate considering the data transferring and FFT processing was improved from 50 kHz to 62 kHz corresponding to a B-scan rate of 62 frames/second.A shorter processing time results in a higher display rate that could help physicians with better diagnosis and treatment.

Results
The calculation error with the lookup table method was defined as the maximum difference between the lookup table calculation results and the actual logarithmic values.The calculation error decreased with the size of the lookup table as shown in Figure 3, however, at the cost of more memory of the computer and more lookup time.Considering a balance between processing time, memory and calculation error, a table of 1000 components was chosen to calculate the logarithmic function with the maximum error of 0.0043.the logarithmic value of Y = X × 10 n , the order of magnitude n and significand X were determined first and then X was rounded to two decimal places.A table consisting of logarithmic values of integers from 1 to 1000 was built beforehand.Rounding of X × 100 was used as the address to look up in the pre-calculated table.The corresponding logarithmic value of Y can be obtained by adding n-2 to the lookup value.
Figure 2. The calculation process of the lookup table method for logarithmic transformation based on a table of 1000 components.

Results
The calculation error with the lookup table method was defined as the maximum difference between the lookup table calculation results and the actual logarithmic values.The calculation error decreased with the size of the lookup table as shown in Figure 3, however, at the cost of more memory of the computer and more lookup time.Considering a balance between processing time, memory and calculation error, a table of 1000 components was chosen to calculate the logarithmic function with the maximum error of 0.0043.The processing time of logarithmic transformation for B-scan imaging (1024 × 1000 pixels) was reduced from 13.3 ms to 9.3 ms with the lookup table method.As shown in Figure 4, the real-time processing A-rate considering the data transferring and FFT processing was improved from 50 kHz to 62 kHz corresponding to a B-scan rate of 62 frames/second.A shorter processing time results in a higher display rate that could help physicians with better diagnosis and treatment.The processing time of logarithmic transformation for B-scan imaging (1024 × 1000 pixels) was reduced from 13.3 ms to 9.3 ms with the lookup table method.As shown in Figure 4, the real-time processing A-rate considering the data transferring and FFT processing was improved from 50 kHz to 62 kHz corresponding to a B-scan rate of 62 frames/second.A shorter processing time results in a higher display rate that could help physicians with better diagnosis and treatment.To test the accuracy of the lookup table method, a mirror was used as a sample.As shown in Figure 5, the A-line signals that are respectively reconstructed from logarithmic function and lookup table calculation are identical.
Furthermore, in vivo human fingernail was imaged to demonstrate the lookup table method in real-time processed OCT imaging.Figure 6A,B illustrate OCT images reconstructed by the logarithmic function calculation and lookup table method, respectively.In order to evaluate the image quality obtained by the lookup table method, the mean square error (MSE) between two images that are reconstructed from logarithmic function and lookup table calculation was calculated.The MSE calculation is widely used in digital image processing for imaging quality evaluation and is defined as: where x(i, j) and y(i, j) represent the pixel values of the original image and the image that needs to be evaluated, respectively.Considering the pixel values of a grayscale image are from 0 to 255, an MSE of 0.019 between the two images shown in Figure 6A,B is quite small, demonstrating that our method meets the required accuracy of OCT imaging display.To test the accuracy of the lookup table method, a mirror was used as a sample.As shown in Figure 5, the A-line signals that are respectively reconstructed from logarithmic function and lookup table calculation are identical.Furthermore, in vivo human fingernail was imaged to demonstrate the lookup table method in real-time processed OCT imaging.Figure 6A,B illustrate OCT images reconstructed by the logarithmic function calculation and lookup table method, respectively.In order to evaluate the image quality obtained by the lookup table method, the mean square error (MSE) between two images that are reconstructed from logarithmic function and lookup table calculation was calculated.The MSE calculation is widely used in digital image processing for imaging quality evaluation and is defined as:

Conclusions
where x(i, j) and y(i, j) represent the pixel values of the original image and the image that needs to be evaluated, respectively.Considering the pixel values of a grayscale image are from 0 to 255, an MSE of 0.019 between the two images shown in Figure 6A,B is quite small, demonstrating that our method meets the required accuracy of OCT imaging display.

Conclusions
In this paper, a lookup table method was used to improve the processing speed of logarithmic calculation in FDOCT imaging.By replacing the logarithmic transformation with a lookup table, data processing can be accelerated without increasing the cost and complexity of the system.
The performance of lookup table method was tested in SSOCT imaging.Compared with the logarithmic function calculation method, the optimized lookup table method is able to improve the processing rate by 24% with an error of less than 0.0043.
By adjusting the relationship between the values of table components and signal intensity, the contrast of OCT image could also be optimized.Based on the lookup table method, the structural information can be presented in some alternative ways, such as false color imaging, therefore a visual improvement of OCT image can be realized.In future work, we plan to use the lookup table method for improvement of the contrast of OCT image and acceleration of signal processing, such as Fourier transformation, to achieve a high-quality real-time OCT imaging.

Figure 1 .
Figure 1.Schematic of the swept source optical coherence tomography (OCT) system, ADC: analog to digital converter, PC: polarization controller.

Figure 1 .
Figure 1.Schematic of the swept source optical coherence tomography (OCT) system, ADC: analog to digital converter, PC: polarization controller.

Figure 3 .
Figure 3. Calculation error as the function of thetable length, the error was calculated by subtracting the lookup table calculation from the actual logarithmic value.

Figure 2 .
Figure 2. The calculation process of the lookuptable method for logarithmic transformation based on a table of 1000 components.

Figure 3 .
Figure 3. Calculation error as the function of the table length, the error was calculated by subtracting the lookup table calculation from the actual logarithmic value.

Figure 3 .
Figure 3. Calculation error as the function of the table length, the error was calculated by subtracting the lookup table calculation from the actual logarithmic value.

Figure 4 .
Figure 4. Processing A-rate of calculation with lookup table (red) and logarithmic function (blue).

Figure 4 .
Figure 4. Processing A-rate of calculation with lookup table (red) and logarithmic function (blue).

6 Figure 5 .
Figure 5. A-line signals reconstructed from logarithmic function (blue) and lookup table (red) calculation.

Figure 5 .
Figure 5. A-line signals reconstructed from logarithmic function (blue) and lookup table (red) calculation.

Figure 5 .
Figure 5. A-line signals reconstructed from logarithmic function (blue) and lookup table (red) calculation.

Figure 6 .
Figure 6.OCT images of fingernail reconstructed from logarithmic function (A) and lookup table (B) calculation.