{'fraction_non_alphanumeric': 0.02661338962605549, 'fraction_numerical': 0.006860675512665862, 'mean_word_length': 5.084862385321101, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Correction of refractive and scattered image distortions in optical coherence tomography based on scalpel

We describe a distortion correction algorithm for OCT images based on the scalpel. In this algorithm, the distorted OCT images are segmented into three parts depending on the seven customized fiducials. Image translation and image stitching are used to eliminate the majority of the distortions. After performing experiments with porcine eyes, we basically correct the optical distortions caused by the reflection and interlayer scattering effects. The correction error is less than 2%. Our algorithm could bring many potential applications in ophthalmic procedures.


Introduction
Optical coherence tomography (OCT) is a non-invasive imaging technique, which has high resolution and high sensitivity. Due to its real-time, cross-sectional, and micrometer-scale imaging capabilities, OCT has been widely used in ophthalmology [1]. In ophthalmic imaging, OCT allowed for not only the analysis of anterior segment structures like cornea and iris, but also the visualization of details like trabecular meshwork and Schlemm's canal. Clinically, real-time OCT images help surgeons to evaluate the lesion and plan surgical paths. With the development of swept-source optical coherence tomography (SS-OCT), the axial scanning speed has reached multi-MHz. The detection sensitivity and imaging depth have been improved. These advantages have led to OCT becoming increasingly prevalent in research and clinical applications [2][3][4]. In 2015, the use of SS-OCT during human ophthalmic surgery was first reported by Pasricha et al. [5]. OCT images effectively help guide insertion and manipulate endothelial graft during Descemet's stripping automated endothelial keratoplasty (DSAEK) procedures. Nevertheless, there remain a range of problems for the clinical application of SS-OCT. Among them, image distortions bring great challenges to surgeons. Rich surgical experience and excellent space perception are required to compensate for distortions during surgery. These requirements increase surgical difficulties and prolong procedure time. Thus, the correction of OCT image distortions should be explored.
OCT relies on the principle of low coherence interferometry. The structural information is extracted from the interference signals, which are generated between lights backscattered from layers of tissues and a reference beam of the interferometer. However, non-invasive imaging also leads to significant image distortions. Reflection and interlayer scattering effects are produced by different anatomical structures and tissues during imaging. The scanning rays are bent due to the different index of refraction. The distortion of light generates a significant loss of geometrical features of different layers. The optical distortions usually appear at tissue boundaries like air-anterior cornea interface, posterior cornea-aqueous humor interface, aqueous humor-anterior lens interface, and posterior lens-vitreous humor interface. Some methods were proposed to model the optical tissue properties and reduce the influence caused by the reflection and interlayer scattering effects. Westphal et al. described a refraction correction method based on Fermat's principle [6]. After custom boundaries' definition, Fermat's principle algorithm was used to correct distortions layer-by-layer. The optical distortions of temporal anterior chamber images are reduced from several hundred micrometers to 10-20 micrometers. Ortiz et al. used the ray-tracing algorithm to correct optical distortion from artificial eyes and porcine eyes [7]. Compared with the conventional optical path modification method, the ray-tracing algorithm increases the accuracy of radius estimation. The errors are less than 1%. Ramasubramanian et al. described a distortion correction algorithm based on refractive index calculation and circle fitting [8]. The algorithm was used to correct the distortion of the corneal radius of curvature and thickness. The intraclass correlation coefficients of each corneal parameter are over 0.88. However, the above methods were limited to the preoperative and postoperative images. During surgery, surgical instruments lead to more distortions and occlusions, which severely affect the operation of lesions' location and tissues' observation.
In this paper, we present a scalpel-based correction method to eliminate OCT optical distortions. Scalpel is one of the most common surgical instruments during surgery. The frequent use in surgeries makes the scalpel a perfect comparator in OCT images. In addition, the scalpel has many features that are easy to detect, like corners, boundaries, and tip. Through the relative position between scalpel and tissues, appropriate fiducials were defined to segment the distorted OCT images. The optical distortions caused by reflection and interlayer scattering effects were corrected segmentally. Compared with the methods mentioned above, our approach is more applicable for clinical use. The simple algorithm satisfies the requirement of real-time imaging at the same time. Moreover, our algorithm has a smaller statistical error and better robustness.

Methodology
Before distortion correction, the scalpel had to be customized. Stainless steel is the most common material for scalpels in the operating room. However, stainless-steel scalpel brings severe effects to OCT images. The biggest of these effects is the large-area occluder and severe distortion caused by optical opacity. The missing image below the scalpel and the severe distortion at the scalpel-tissue boundary cause significant difficulties in distortion correction. Therefore, the artificial sapphire was chosen as the material of the scalpel considering light transmission and refractive index. During OCT imaging, the tissue below the scalpel is visible, and the distortions at the scalpel-tissue boundary become smaller. Figure 1 shows the artificial sapphire scalpel and its OCT image. The rigidity and detectable features of artificial sapphire scalpel simplify the distortion correction process. The whole correction procedure is illustrated as the flow chart in figure 2. The distorted OCT image was divided into three segments based on the relative position between the scalpel and tissues. The first part started from the scalpel's point and ended at the scalpel-tissue boundary, which was named the intra-tissue distortion part. The second part included a small region surrounding the scalpel-tissue boundary, which was named the boundary distortion part. The third part started from the scalpel-tissue boundary and ended at the scalpel handle, which was named the extra-tissue distortion part. To obtain the accurate segmentation of distorted images, we defined seven fiducials to distinguish different parts. As is shown in figure 3, one fiducial near the scalpel tip (p1) and two fiducials near the scalpel-tissue boundary (p2, p3) aided in identifying the intra-tissue distortion part. Four fiducials near the scalpel-tissue boundary (p2, p3, p4, p5) assisted in identifying the boundary distortion part. Two fiducials near the scalpel-tissue boundary (p4, p5) and two fiducials near the scalpel handle (p6, p7) aided in identifying the extra-tissue distortion part. Before segmentation, the OCT images were denoised and binarized.  For the intra-tissue distortion part, image translation was used to correct the distortions. First, p1 was localized. To minimize the disturbance in the images, we performed connected component analysis. The connected component with the maximum area was retained. It contained most of the corneal and the complete lower edge of the scalpel. Then, by searching the center of gravity of the image, we approached the area adjacent to p1. An ROI of 100 x 100 pixels centered at the center of gravity was set. Shi-Tomasi corner detection was used in the ROI to extract p1. After p1's localization, the rightmost pixel was identified by pixel traversal. At this point, canny edge detection was used to get the lower edge of the scalpel. The lower edge of the scalpel was determined by the edge between p1 and the rightmost pixel. Next, through calculating the gradients between neighboring pixels, p3 was localized as the first negative gradient's start point. With the help of p3, p2 was localized by upward pixel traversal. The first white pixel during traversal is p2. Once the localization of the three fiducials was completed, the fiducials and the lower edge of the image were used to identify the intra-tissue distortion part. As is shown in figure 3, the upper edge is defined by the scalpel's upper edge between p1 and p2, and the lower edge is defined by the lower edge of the whole image. For this part, the vertical shift was used to correct the distortions. Distortions were limited in the vertical direction by For the boundary distortion part, image stitching was used to correct the distortions. After the lower edge of the scalpel was identified, Hough Line Transform was used to localize p5. Parameters like rho, theta, threshold, and minLineLength were adjusted to detect the scalpel's blade. The leftmost pixel of the blade was p5. Afterward, upward pixel traversal was used to localize p4 again. The first white pixel during traversal is p4. So far, four fiducials (p2, p3, p4, p5), which were used to identify the boundary distortion part, were localized. As is shown in figure 3, the upper edge is defined by the scalpel's upper edge between p2 and p4, and the lower edge is defined by the lower edge of the whole image. For this part, the distortions were complicated but had little effect on the surgery. Thus, it was covered by the same part of the normal OCT image, which doesn't include the scalpel. In order to ensure the continuity of images, the area surrounded by p2, p3, p4, and p5 were filled with black. Two sets of endpoints (p2 and p4, p3 and p5) were connected by white lines.
For the extra-tissue distortion part, no distortion exists. This part was used for comparisons and tests as normal images.

Result & Discussion
The correction algorithm mentioned above was tested by imaging porcine eyes both in vitro and in vivo. An extensive set of porcine anterior chamber OCT images were collected to validate the algorithm. In addition, it is essencial to note that the optimization of refractive indices was performed during image acquisition. The performance of correction is illustrated in figure 4 and figure 5.   Figure 4(a) presents the OCT image before correction. Figure 4(b) indicates the OCT image after correction. As is shown in Figure 4(b), the optical distortions caused by the reflection and interlayer scattering effects are largely eliminated. The continuity of the blade is strong. The length and the width of the scalpel were measured in OCT images after correction. As is shown in table 1, the average measured length of scalpels was 4.48mm, which was slightly shorter than the standard length (4.5mm). The average measured width of scalpels was 0.25mm, which was consistent with the standard width (0.25mm). Furthermore, the boundaries of other tissues also show strong continuity.   In this paper, we propose a distortion correction method based on the scalpel. By utilizing the rigidity and detectable features of the artificial sapphire scalpel, we defined seven fiducials based on the relative position between the scalpel and tissues. The distorted image was segmented into three parts, each of which was corrected according to its characteristics. During the imaging experiment in vitro and in vivo, we verified that the optical distortions caused by the reflection and interlayer scattering effects are largely eliminated. Besides, our algorithm has smaller statistical errors and better robustness. The scalpel parameter error is less than 2%. However, our correction algorithm does not consider the image above the upper boundary of the scalpel. If the image translation method is applied to the image above the upper boundary of the scalpel, significant image discontinuity will appear. This will lead to image deformation and observation difficulties. In our future work, we will improve the algorithm to resolve this issue. Meanwhile, the combination of our algorithm and the ray-tracing algorithm is under our consideration.

Conclusion
To summarize, we have demonstrated a distortion correction method based on the artificial sapphire scalpel. By defining seven fiducials, we segmented the distorted image into three parts and corrected them respectively. The intra-tissue distortion part was corrected by image translation. The image stitching was used to correct the boundary distortion part. The extra-tissue distortion part was considered as the reference image. Porcine eyes' in vitro images and in vivo images were used to verify the algorithm. Instead of focusing on the preoperative and postoperative OCT images, our method has more concern about intraoperative imaging. The optical distortions caused by the reflection and interlayer scattering effects during surgery are largely eliminated. The correction error was less than 2%. Subsequent research will focus on the image above the upper boundary of the scalpel.