Real-time co-localized OCT surveillance of laser therapy using motion corrected speckle decorrelation

: We present a system capable of real-time delivery and monitoring of laser therapy by imaging with optical coherence tomography (OCT) through a double-clad ﬁber (DCF). A double-clad ﬁber coupler is used to inject and collect OCT light into the core of a DCF and inject the therapy light into its larger inner cladding, allowing for both imaging and therapy to be perfectly coregistered. Monitoring of treatment depth is achieved by calculating the speckle intensity decorrelation occurring during tissue coagulation. Furthermore, an analytical noise correction was used on the correlation to extend the maximum monitoring depth. We also present a method for correcting motion-induced decorrelation using a lookup table. Using the value of the noise- and motion-corrected correlation coeﬃcient in a novel approach, our system is capable of identifying the depth of thermal coagulation in real time and automatically shut the therapy laser oﬀ when the targeted depth is reached. The process is demonstrated ex vivo in rat tongue and abdominal muscles for depths ranging from 500 µm to 1000 µm with induced motion in real time. scatterers. We simulated a Gaussian point spread


Introduction
Laser therapy allows for targeted removal or thermal coagulation of tissues through light absorption by various absorbers in the tissue, such as water, hemoglobin and other macromolecules [1][2][3]. It is used in the treatment of epithelial cancerous and pre-cancerous lesions such as Barrett's esophagus [4][5][6], in eye diseases such as diabetic retinopathy [7][8][9][10] and retinal vein occlusion [11,12] and in respiratory papillomatosis, a viral-induced disease in the upper airway [13,14]. However, accurate monitoring is essential to avoid over-or under-treatment. Under-treatment requires repeat visits with the associated cost, while overtreatment generally causes complications requiring surgical treatment [15][16][17]. Such precise monitoring requires real-time imaging techniques capable of resolving the thin epithelial layers (generally a few hundred microns) under treatment. Furthermore, when the target zone is small and presents mostly subsurface features for guidance, properly targeting the therapy can prove challenging unless treatment is guided by cross-sectional imaging.
Current monitoring methods for laser therapy are limited. Ultrasound imaging has been used to monitor photothermal therapy in cancer treatment, but lacks sufficient resolution to accurately assess treatment depth in the epithelial layers of tissue [18]. Photoacoustic thermography [19] also has limited resolution, requires the injection of nanoparticles, and only provides an indirect measurement of the tissue coagulation. Thermal magnetic resonance imaging has been demonstrated for treatment monitoring, but this approach is costly and presents challenges such as motion artifacts and complex procedures for choosing the optimal monitoring parameters [20][21][22].
Alternatively, optical coherence tomography (OCT) is a cross-sectional imaging technique with a penetration depth of 1-2 mm and a depth resolution of 1-15 µm [23]. It has been used in identifying pathologies in the epithelium layer of different tissues, including some treatable with laser therapy, such as Barrett's esophagus [24][25][26]. Tissue coagulation produces changes in the acquired OCT tomograms which enable the use of OCT to monitor the progression of the coagulation process and determine treatment depth [27][28][29][30][31][32][33].
Several methods have been proposed to guide treatment with OCT. Vasculature observed by OCT was used to determine the effect of treatment, but is used to study long-term effects and not real-time monitoring [34]. Changes in tissues scattering properties have been exploited, but it tends to underestimate the therapy depth. The increase in scattering in the superficial layers due protein denaturation causes enhanced attenuation of the light once it reaches deeper layers -casting a "shadow"-which results in an overall decrease in the signal deeper into tissue, inhibiting accurate assessment of the coagulation state of deeper layers [28,29]. Polarizationsensitive OCT can assess the thermal damage directly, but its contrast is limited to birefringent tissues at baseline -tissues that are naturally birefringent-, such as muscles, skin and tendons [35][36][37][38]. Doppler OCT combined with analysis of the complex correlation coefficient has also been investigated as a way to measure tissue displacement during coagulation [27,39], however no determination of the level of coagulation of tissue was attempted. An OCT angiography technique known as complex differential variance (CDV) [40] has been employed with success to differentiate coagulated tissues in laser and radio-frequency therapy [29,30]. CDV makes use of the complex-amplitude OCT signal, which adds significant complexity to a real-time implementation of the signal processing. Indeed, many clinical systems lack phase stability: the presence of patient motion or the use of endoscopic probes with scanning inaccuracies such as non-uniform rotation distortion make it necessary to implement several steps of phase jitter correction and motion and distortion correction difficult to achieve in real time [30]. To the best of our knowledge, OCT real-time monitoring capable of dynamically controlling the therapy laser when the target treatment depth has been achieved has not been demonstrated.
In this work, we present a system capable of real-time monitoring of the coagulation depth in epithelial tissue compatible with catheter imaging. A double-clad fiber coupler (DCFC) is used to combine both the OCT and therapy laser in a single double-clad fiber (DCF) for co-registered imaging and therapy [41][42][43][44]. Such couplers have been employed with success in combining OCT imaging with other modalities [45][46][47][48]. They allow for multimodal single-fiber catheter. This represents an improvement from Ref. [29], where the two lasers were combined using a dichroic mirror, a configuration appropriate for benchtop validation but impractical for clinical use and incompatible with endoscopic systems. We achieve monitoring using the intensity correlation of the speckle, which lowers the signal processing complexity significantly compared to the complex-amplitude speckle processing required with CDV. Furthermore, novel noise-and motion-correction methods are added to simultaneously extend the maximum monitoring depth and improve system robustness to bulk tissue motion. We implemented these signal processing methods in both post-processing and real time. We demonstrate the use of the developed system in a benchtop configuration for real-time coagulation depth monitoring and targeting, where the system stops the therapy laser automatically when the desired treatment depth has been reached, despite the presence of bulk tissue motion. We validated our approach in ex vivo rat tongue and abdominal muscle tissue, with histology confirmation. Our approach opens the possibility for future real-time image-guided laser therapy with high spatial and temporal resolution through a single fiber endoscope.

Speckle decorrelation during coagulation
Speckle results from the interference of the coherent light reflected or back-scattered off the scatterers present within a turbid sample. In OCT, a given sub-resolution spatial distribution of scatterers with its associated scatterer size and refractive index yields a specific speckle pattern provided there are no intrinsic -such as diffusion-or extrinsic -such as bulk tissue motion-mechanisms affecting their configuration state [49]. However, as tissue undergoes photocoagulation, proteins denaturate, producing a change in the refractive index distribution and, therefore, a change in the coherent sum of individual back-scattered contributions resulting in a temporal evolution of the speckle pattern seen in the tomogram [31,32,39,50]. Lo et al. observed that these variations slow down once the tissue has fully coagulated [29]. By monitoring the speckle pattern dynamics as it transitions from static (before coagulation), to dynamic (during active coagulation) and back to static (after coagulation), it becomes possible to determine the state of each part of the tissue during therapy [29]. The present section will explain our theoretical model. For a direct application, Fig. 2, at the end of this section, shows a flow chart of the formulas used in our approach.
The quantitative analysis of the speckle fluctuations can be performed by determining the temporal correlation of the OCT signal. When relying on the intensity of the signal, the second-order autocorrelation function g (2) is generally used to quantify the correlation. In what follows, we describe how g (2) can be used to create a map of the OCT signal correlation across the field of view. We define a discrete coordinate system (z, x, y) defining the axes in depth, in-plane lateral location, and out-of-plane lateral location, respectively. In the following, we do not consider the out-of-plane dependency, unless otherwise specified.
The second-order autocorrelation function g (2) is defined as the time-delayed correlation of the intensity of an ensemble at a time difference τ. Considering that an OCT system determines the intensity of backscattered light as a function of depth z (first index), lateral position x (second index) and time t (third index), the inter-B-scan autocorrelation function can be written as [51,52] g (2) where ∆T is the time lapse (measured in number of B-scans) used to calculate the correlation, is the Hadamard product, and · · · kl represents an ensemble average of I(k, l, t) in the k and l indices centered at (z, x). The OCT system is assumed configured to acquire B-scans as a function of time at the same out-of-plane location; given that Eq. (1) is an inter-B-scan metric, time t is equivalent to the B-scan index. A precise definition of the ensemble will be given in Eq. (3). This is a direct translation of the estimation of the autocorrelation function for a stationary process. However, as explained above, during tissue coagulation the tissue transitions through different states and, therefore, the acquired signal corresponds to a dynamic process. In a dynamic process, g (2) depends not only on τ, but also on t. In order to adapt Eq. (1) for a dynamic process to detect the state of coagulation, we limit the temporal extent of the summation to allow us to calculate a time-dependent correlation -assuming the sample is in the same state inside a limited time interval. If we define ∆t as the number of B-scans used for the instantaneous, estimation of the autocorrelation at time t, Eq. (1) becomes Notice that we use m − τ for our second ensemble since, for the calculation of the correlation in real time, we only have access to the B-scans preceding t. To simplify the notation in what follows, we drop the explicit summation and change the definition of ensemble to where I(k, l, m) is the intensity of the pixel at depth k, lateral position l and time m; and {· · · } denotes the concatenation of the argument into an ensemble. The ensemble I ens (z, x, t) encompasses all pixels at depths z to z + ∆z, lateral positions x to x + ∆x and times t to t − ∆t.
Our time-dependent autocorrelation function becomes where the bracket · · · denotes an ensemble average implemented as klm . Decorrelated speckle patterns will have g (2) → 1 while correlated patterns will have g (2) → 2 for speckle with unity contrast, as is the case of OCT [52]. These theoretical values for g (2) are reached for infinitely large ensembles. Since the ensembles considered here are small, we define a normalized second-order autocorrelation function g (2) n that accounts for non-unity contrast as The zero-delay autocorrelation used for normalization g (2) 0 takes into account the contrast of the speckle in all the samples used in the calculation of the time-dependent autocorrelation function and is thus a function of τ and t given by The term {I ens (z, x, t − τ), I ens (z, x, t)} is a concatenation of the two ensembles I ens (z, x, t − τ) and I ens (z, x, t). We ignore any dependency of the calculated value of the autocorrelation function with the ensemble size as we do not compare results among different ensemble sizes [52]. During therapy, we calculate g (2) n for all positions in the OCT tomogram. Figure 1 shows an example for a given value of τ and t. We elaborate on the choice of τ in Sec. 4.2. As for ∆z, ∆x and ∆t, a larger ensemble provides a better estimation of the correlation at the cost of resolution in z, x and t.

Noise correction
Noise, being dynamic in time, will lower the correlation coefficient calculated [53]. This effect becomes significant during coagulation when the increased scattering causes stronger attenuation of the signal coming from deeper tissue layers, decreasing SNR. This limits the maximum possible monitoring depth of the therapy [28,29]. As such, it is crucial to implement noise correction methods that account for these effects. We use a novel analytic correction for the noise-induced decorrelation, as proposed by Uribe-Patarroyo et al. [52], which does not suffer from the loss in temporal resolution of previous corrections [53]. Briefly, the shot noise component in the OCT tomogram can be modeled as an additive white-noise contribution to the complex-valued tomogram [54]. The noisy complex-valued signal G is defined as G = S + N where S is the noiseless signal and N is the noise. The noisy signal intensity I is therefore I = |S + N | 2 . We also define a noiseless signal intensity T = |S| 2 . Temporarily replacing the indices (z, x, t − τ) and  (2) calculation. Each pixel of the g (2) image (right) is calculated from two ensembles of intensity data points, each ensemble comprising several pixels in z, x and among ∆t B-scans in time. The two ensembles are delayed in time by τ.
(z, x, t) with 1 and 2 , respectively, it is possible to write the second-order autocorrelation function of the noisy signal as where g (2) c (z, x, t, τ) = is the second-order autocorrelation function in the absence of noise, and g (2) c,0 is defined in a similar fashion. The parameter G is given by the average SNR of the ensembles, written as R: where and R 12 denotes the SNR of the two ensembles {I 1 , I 2 }. It is straightforward to express g (2) c [g (2) c,0 ] as a function of g (2) [g (2) 0 ] and obtain noise-corrected versions of Eq.4. The normalized and SNR-corrected autocorrelation function becomes g (2) nc (z, x, t, τ) = 2 The DCF is known to have some level of cross-talk between the single-mode core and inner cladding, which results in ghost images and/or increased noise floor. For this reason, we decided not to rely on the noise floor determined by blocking the sample arm [41]. We thus developed a calibration procedure to accurately determine the noise level, using a tomogram acquired prior to the start of the coagulation process. An additional advantage of this method is the possibility of estimating the SNR for data for which the noise floor is unknown. First, we assumed that the SNRs of both ensembles are identical, R 1 = R 2 , which proved to be an excellent approximation. This also implied that G = G 0 . We also assumed that the noise intensity remains constant for the remainder of the coagulation, and that the SNR will, therefore, only change due to variations in the signal intensity where I ens (z, x, t) is the I ensemble located at z, x and t, and it is made explicit that N is independent of z, x and t. In order to confirm the linear relationship between the R and I ens , R was estimated for varying I ens values. More precisely, we estimated the average SNR of the j-th ensemble, R j , as a function of its average signal intensity, I j , for all the ensembles in the field of view. This calibration was found by solving the optimization problem outlined in Eq. (13). For a static sample with no ongoing treatment, the only source of decorrelation will be the noise. We can therefore expect g (2) nc (τ>0) = 2 and write arg min m being the total number of ensembles. Since the estimation ofR j as a function of I j for a single ensemble tends to be inaccurate, ensembles were grouped in M bins: ensembles with similar average intensity were grouped in the j-th bin with average intensity I j . Considering the full dynamic range of the signal, we equally distributed all ensembles into M = 100 bins [thus j = 1 . . . 100 in Eq. (13)], and and the optimization problem was solved for each bin. We selected the number of bins by finding a good compromise between an accurate estimation of the SNR and a good resolution on theR j vs. I j curve and the time it took to solve all of the optimizations. The optimization problem itself was solved using a similar approach to the golden-section search method [55]. The function is evaluated at three points, x 1 , x 2 , and x 3 separated by intervals of ∆x.
Step one consists of finding the minimum value between the function evaluated at these three points. In step two, we created a new interval of three points separated by ∆x/2 centered around the minimum calculated in step one. The process is iterated until the interval separating the three points is considered small enough. In our case, this value was 1% of I j . This method was chosen because it was found to converge rapidly with our data; however, in principle, any optimization method can be used as the search space seems to have a single global minimum. The curve is used as a lookup table to calculate g (2) nc (z, x, t, τ) using the proper SNR value, searched for making use of only the current ensemble intensity at each t.

Motion correction
It is well established that tissue bulk motion will affect the value of g (2) as well, thereby leading to inaccurate measurements of the coagulation-induced decorrelation. To address this impact a second correction, based on a lookup table, is applied after the noise correction. The twodimensional table gives the g (2) nc value caused by motion-induced decorrelation on the horizontal axis and by coagulation-induced decorrelation on the vertical axis. Points lying in between the two axes correspond to decorrelation caused by a combination of both coagulation and motion.
The method works as follows. A look-up table g (2) nc (k, l) is created, in which the row index, k, corresponds to the degree of coagulation-induced decorrelation, and the column index, l, corresponds to the motion-induced decorrelation. The first row g (2) nc (k = 0, l) corresponds to the expected value of g (2) nc for untreated tissue and all possible degrees of tissue motion (given by l). For a given experiment, motion is quantified by dynamically calculating g (2) nc in an untreated section of the tissue, which we denote the reference autocorrelation,g (2) nc . The value ofg (2) nc will be searched for in the first row of the table. The associated column index, l R , will define the motion-induced decorrelation for all ensembles in the current frame. This is represented as step 1 in Fig. 3. In step 2, to correct a given g (2) nc (x), the index k m having the closest match in the column given by g (2) nc (k, l R ) is found, such that g (2) nc (x) ≈ g (2) nc (k m , l R ). In step 3, the noise-and motion-corrected g (2) nc&mc (x) is found as g (2) nc&mc (x) = g (2) nc (k m , l = 0), since the values in the first column corresponds to the decorrelation induced by coagulation only.
Since the method uses the correlation to quantify the motion in real time during the therapy, it can also correct for out-of-plane motion. The lookup table in Fig. 3 was created by simulating a noiseless OCT signal exhibiting speckle obtained by randomly moving scatterers -mimicking the coagulation process-along the l index, and uniformly moving scatterers -mimicking bulk motion-along the k index, based on the model of a static sample described by Zaitsev et al. Lookup table used for motion correction created from the simulation of coagulationand motion-induced decorrelation. The vertical axis represents coagulation-induced decorrelation while the horizontal axis represents motion-induced decorrelation. The correction method is as follows:g (2) nc is calculated in an untreated region of the tissue to quantify motion. In step 1. we search forg (2) nc in the first row of the table to determine the motion column index. In step 2. we find the g (2) nc (x) to be corrected for motion in that column and finding its row index. In step 3. we find the g (2) nc&mc (x) that corresponds to the first value in that row. [56]. The method is detailed in Sec. 7. The advantage of simulated speckle is that the motion can be accurately modeled and a considerable quantity of speckle patterns can be simulated, allowing for larger ensembles and thus a more accurate calculation of the correlation.

Experimental setup
We used a commercial OCT system based on a MEMS-VCSEL wavelength-swept laser at 1310 nm (Thorlabs SL1310V1, Newton, USA) with its imaging module (Thorlabs OCS1310V1, Newton, USA) using a single detector (no polarization-diverse detection) for imaging. We used an Alazar digitizer model ATS9350 to acquire the electronic signal from the imaging module. The laser, with a wavelength range of >100 nm (at -20 dB), has a 16 µm theoretical axial resolution -we determined a 20 µm axial resolution in air experimentally-with an A-line rate of 100 kHz. A CW 532 nm laser (Verdi 10W, Santa Clara, USA) was used as the therapy laser source. A DCFC (Castor Optics DC1300LQ1, Montreal, Canada) was used to couple the therapy laser into the OCT sample arm, which used a single 2.18 m-long DCF. The DCFC enables the delivery of both imaging and therapy through a single fiber, guaranteeing co-registration and greatly simplifying the implementation of our technique in endoscopic probes. The DCF core diameter, cladding diameter, and effective refractive index are all chosen as to match the guided mode waist in SMF-28 fiber and allowed the two fibers to be directly spliced with minimum loss. As shown in Fig. 4, OCT illumination and collection are both carried out through the single-mode (SM) core of the DCF. Meanwhile, the therapy laser is injected into the multimode (MM) end of the DCFC. The use of a single fiber greatly simplifies a future implementation in endoscopy and guarantees co-registration of the two modalities. Furthermore, an extra 1 m of SMF-28 fiber was spliced between the OCT system and the DCFC in order to reduce the ghost artifact described by Beaudette et al. [41] induced by the DCF. For the imaging head, in order to avoid damage due to the high power of the therapy laser and to maintain an achromatic behavior across the therapy and imaging lasers wavelength range, a 7 mm focal length reflective collimator (Thorlabs RC02APC-F01) was used with an UV-enhanced aluminum mirror. The collimated beam had a diameter of 2 mm before being reflected by the galvanometer (galvo) silver-coated mirror (Thorlabs GVS001) and going through the 20 mm focal length uncoated imaging lens resulting in a theoretical beam waist of 20.8 µm and a working distance of 1.06 mm in air. The therapy laser wavelength was selected because it corresponds with a peak in the absorption spectrum of hemoglobin and because it has been validated extensively in clinical applications [6,14]. Note that there is no limitation on the wavelength used for the therapy except for the DCFC, which supports wavelengths up to 1750 nm. A longer wavelength infrared laser is a more generally attractive therapy laser which would target water absorption rather than hemoglobin for a wide variety of applications. During therapy guidance, the targeted pathology will generally occupy only a portion of the OCT lateral field of view in order to provide a reference for the boundary between diseased and healthy tissue. In order to be able to selectively treat a portion of the imaging field with the therapy laser, we designed a shutter system. This was achieved by synchronizing a second galvo -the therapy galvo-to alternate between injecting the therapy laser in and out of the DCFC, as illustrated in Fig. 4. When the OCT imaging galvo was over the targeted area, the therapy galvo injected the therapy laser into the DCFC. Once the imaging galvo was no longer over the targeted area, the therapy laser was decoupled from the DCFC and sent into a beam dump by the therapy galvo. This effectively created long pulses of 10 mJ and 3 ms at 100 Hz repetition rate which corresponds to 30% of the lateral field of view. Because this setup for targeting is on the proximal end of the DCFC, it is fully compatible with endoscopic probes. A shutter was used to stop the therapy laser once the targeted therapy duration or coagulation depth was achieved. This shutter was used, instead of the therapy galvo, because the two galvos were synchronized in our setup and could not be driven independently.
In order to test our motion correction, we implemented a setup to emulate patient motion for validation. An electric motor with an unbalanced weight on its rotation axis was used to produce vibrations (see Fig. 5). A plastic airbag was used to transfer those vibrations to the sample placed on it. The airbag was wide enough to accommodate 25 cm by 15 cm samples. The frequency of the vibration could be adjusted by changing the motor frequency, and the amplitude by changing the mass of the attached weight. The vibrations reached an amplitude of around 0.3 mm at a rate able to fully decorrelate the speckle at g (2) (τ = 10 ms).

Software
A custom LabVIEW (National Instruments) application was developed to control both the commercial OCT system, the imaging galvo, the therapy laser galvo synchronization, and the laser shutter. The software permits three distinct modes summarized in Table 1 and described below.
In order to study the impact of coagulation, noise, and motion on g (2) , as well as to validate our model for motion correction, the correlation for very small values of τ was calculated. This was accomplished with the first mode called Fast mode. The imaging galvo was set to run at a 1 kHz frequency and a small scanning range while the therapy laser was left to fire continuously. The ensemble size used for calculating g (2) were ∆z = 10, ∆x = 16, ∆t = 100 in pixels or ∆z = 77.9 µm, ∆x = 237 µm, ∆t = 100 ms in physical units.
In order to find the appropriate parameters for real-time monitoring and to study the validity of our approach, a second mode, called the Retrospective Diagnostic mode, was developed. It was used to develop our algorithms by recording raw data, allowing us to test our approach with different g (2) parameters. The Retrospective Diagnostic mode showcases how the g (2) can be used to add visual feedback from the therapy by providing real-time structural imaging and recording of the data for retrospective processing with the added control over the therapy laser. A shutter system allowed us to control the therapy laser exposure on the sample. Post-processing calculation of g (2) was performed with an ensemble size of (∆z = 3, ∆x = 10, ∆t = 100) in pixels or (∆z = 32.5 µm, ∆x = 46.9 µm, ∆t = 100 ms) in physical units.
The last mode, called Depth Targeting mode, consisted in the real-time monitoring of the therapy. A region of the tissue not affected by the therapy laser is manually selected to serve as a reference to quantify the bulk motion of the tissue and apply motion correction. An ensemble of pixels is manually selected at the targeted depth and used to check if the depth has been reached in that region. By calculating g (2) in selected regions, computation in real time becomes possible. For a field of view of 2.34 mm (300 pixels) in depth and of 25 mm (800 pixels) laterally, the ensemble size used was (∆z = 3, ∆x = 50, ∆t = 10) in pixels or (∆z = 32.5 µm, ∆x = 234.4 µm, ∆t = 100 ms) in physical units in air. The ensemble size was chosen to have a high resolution in z and t while keeping a good estimation of g (2) in order to have more accurate automatic coagulation depth determination. It was observed that this larger ensemble size allowed for a more accurate motion correction. Since our goal was coagulation depth with no need to control the lateral extent of the coagulation, a larger size in x was used to allow us to have a finer resolution in z.
To perform real-time motion correction, two reference ensembles on both sides of the treated area were used to calculate g (2) nc , using the method described in Sec. 2.3. The two ensembles are concatenated into one to calculate a g (2) nc ref value over a larger ensemble, and improve the accuracy of the motion estimation. The ensemble size were ∆z = 150, ∆x = 100, ∆t = 10. We established whether the targeted coagulation depth was reached by testing for two conditions: nc&mc (t)<ξ 1 for anyt<t. C 2 : if g (2) nc&mc (t)>ξ 2 and ifC 1 is satisfied, where t is the current time index at which the conditions are checked,t is any time index before the current one and ξ 1 and ξ 2 are two threshold values. C 1 consists of checking if the selected region has started to coagulate. As the tissue begins to coagulate, g (2) drops. We can therefore set a certain threshold (C 1 ) indicative of the start of the process. As coagulation nears completion, g (2) will then return to 2 as the tissue becomes static/stable again. C 2 is set as the threshold indicating the completion of the coagulation process. The values of ξ 1 and ξ 2 were both determined experimentally, as explained in Sec. 4.2. The system was capable of verifying both conditions at a faster rate than the B-scan frequency. The data process in summarized in Fig. 6. The SNR was estimated using the R versus signal intensity curve shown in Fig. 7. Wheng (2) nc <1.3 (that is, motion produced a strong decorrelation of the signal), the conditions {C 1 , C 2 } are not computed untilg (2) nc ≥ 1.3. This allowed us to perform coagulation depth tracking despite sudden large motion.

Histology
The rat tongue and abdominal muscle samples were taken from a rat a few hours post mortem. The samples were enveloped in a hydrated gauze with Hank's Balanced Salt Solution (HBSS) during transport and kept on an hydrated gauze during the experiment, as shown by the Fig. 5. We didn't soak the sample in HBSS in order to avoid the blood in the tissue to diffuse in the solution. Since we are targeting hemoglobin absorption, it is essential to preserve the blood content of the sample.
Once the experiment was finished, the optimum cutting temperature compound was used for frozen section histological processing. The sample was then stored on dry ice until being brought for processing. Hematoxylin and eosin (HE) histology with nitroblue tetrazolium chloride (NBTC) stains for the activity of nicotinamide adenine dinucleotide diaphorase (NADH-diaphorase) were used on slices 10 µm thick in a fashion similar to [29,57].

Noise and motion correction
In a first step, we estimated the SNR calibration curve by calculating g (2) nc in 44 B-scans acquired while imaging rat muscle tissue before the start of the therapy. The expected, relatively linear relationship between R j and I j is presented in Fig. 7. Given Eq. (10) predicts a linear proportionality between the SNR and I, a simpler calibration which simply finds N could work equally well.
The estimation fails at very low SNR values as most of the input is noise. As for other SNR levels, the difference can be explained as well. First, the limited size of ensembles, which adds some uncertainty to the calculated values. Second, the assumption that the noise floor is constant and independent of z, x or t. Third, in a hypothetical incoherent cross-sectional image -that is in the absence of speckle-the sample reflectivity will not be completely uniform inside the area corresponding to a single ensemble due to the heterogeneous tissue structure. This implies that assigning a single average intensity to an ensemble is an approximation. Finally, estimating the SNR on very bright spots is limited by saturation of the signal. Despite these limitations, the SNR estimation follows the predicted shape in Eq. (12) and allowed us to correct for noise as shown in Fig. 8.   Fig. 8. g (2) before (circle) and after (asterisk) noise correction for low SNR, R = 9.50dB, (dark blue) and high SNR, R = 15.91dB, (light blue) values. Color palette from [58]. The next step was to measure g (2) nc as a function of τ, with the Fast mode described in Sec. 3.2, to determine the optimal value for monitoring the coagulation process. Equation (11) was used with a fixed value of z, x and t. This corresponds to using the autocorrelation function to study a static process, because we will limit the analysis to time intervals in which the sample can be assumed to be in a single state (static, coagulating or after coagulation).
In order to observe the effect of the noise correction, the coagulation was performed on an excised sample of rat muscle containing enough hemoglobin to absorb light from the therapy laser. Imaging was performed at a 1 kHz B-scan rate, providing us with a resolution of 1 ms for τ -the shortest decorrelation measurable-and a resolution of 100 ms for t considering the ensemble size ∆t -the time scale over which the tissue is assumed to be in the same state-over a width of 0.35 mm, while the therapy laser was left continuously on with an average power of 1.0 W at the sample. The g (2) was calculated at two different depths (z values), for different SNR levels, R = 8.91 and R = 39.03, with a fixed t for each z during which the tissue was undergoing coagulation at that depth. Figure 8 shows how noise correction impacts the calculated g (2) for two different SNR values. As one would expect, the correction has a more significant impact for lower SNR values. The difference is also more pronounced at shorter delays τ (or higher g (2) values). Implementing noise correction will thus allow for speckle correlation measurements deeper within the tissue, as the OCT SNR dramatically diminishes with depth and coagulation state. This is important for our Depth Targeting mode to work properly. The drop of g (2) between τ = 0 and τ = 1 ms is well-known and explained by the noise pattern becoming decorrelated between B-scans, which is not the case for τ = 0, since we are correlating the same noise pattern.
In our next step, we first validated our simulation model by comparing the total correlation for a range of coagulation-induced and motion-induced decorrelation values for both simulated and experimental data. The process to create the simulated data is described in Sec. 7. For the experimental data, we measured the coagulation of rat muscle at 1 kHz with 1.0 W therapy laser power, with a τ resolution of 1 ms. Figure 9(a) corresponds to this comparison; the horizontal axis shows the value of g (2) for a range of coagulation-induced decorrelation, while the vertical axis shows the combined effect of coagulation-and motion-induced decorrelation. The dashed lines with unity slope represent simulated and experimental g (2) with no motion, which overlap in Fig. 9(a). Motion-induced decorrelation was added by digitally shifting the second correlated ensemble by 1 pixel (7.8 µm) to both the simulated and experimental data (solid lines). The g (2) value drops very similarly in both cases. This validated our approach to create the lookup table for motion correction, which was based on simulated data with digitally added motion. We note that the simulated data was noise free and that the experimental data was corrected for noise.
Next, the effect of motion correction on experimental data was evaluated. The OCT scan rate was set at 1 kHz over a small field of view and the therapy laser power was set to 1.0 W. Motion was induced with a motor, as described in Sec. 3 g (2) was computed for a fixed z and x for two fixed t corresponding to during and after coagulation with the laser still on in both instances. Coagulation was assessed visually after laser exposure.
In this fast mode, there is no untreated region of the sample that can be used for determining g (2) nc during the treatment. Instead, we assumed that the magnitude of the motion would remain approximately constant during the entire experiment. We thus estimated the motion by determiningg (2) nc before the therapy started, and used this same value for all subsequent motion correction. The motion was estimated to range from 6.4 to 6.8 µm per 10 ms. Results are shown in Fig. 9(b).
Similarly to the noise correction, motion correction makes the most difference for speckle that should be correlated without motion. Thus, the correction allows us to confirm whether a speckle pattern is stable in the presence of motion. Figure 9 also shows the correlation of the speckle pattern during and after coagulation. As expected, the g (2) (τ) value decreases much faster during coagulation than after.

Distinguishing coagulated from coagulating tissues
As we see with Fig. 9(b), coagulated tissue can be distinguished from tissue still undergoing coagulation. In this section, we study the variation in time of g (2) , for a different tau values. This allows the identification of the optimal tau value, for which the contrast between coagulating and fully-coagulated tissue is maximized. With this in mind, we monitored the coagulation of abdominal rat muscle exposed to 10 mJ pulses at 100 Hz -which is the nominal setting in our system for simultaneous targeted therapy and monitoring-during 3 s. With our system in Retrospective Diagnostic mode (described in Sec. 3.2), the therapy laser was put in pulsed mode as to fire only at the center of the OCT field of view with a pulse energy of 10 mJ at 100 Hz, i.e. using 1.0 W of average power.  (2) of speckle for simulated (yellow) and experimental (orange) tissue coagulation. Dashed lines represent the data without added motion, both lines are overlapping. Solid lines show g (2) with motion-induced decorrelation added to the coagulation-induced decorrelation. Motion was induced by digitally shifting one of the ensembles by 1 pixel. The figure confirms that motion-induced decorrelation affect simulated and experimental coagulation-induced decorrelation in the same way. (b) Experimental results of the motion correction procedure. g (2) during coagulation (pink curves) and after full coagulation (purple curves), with (dashed curves) and without (solid curves) motion correction. Color palette from [58]. Figure 10 shows the dynamic g (2) as a function of time t during the exposure of the sample to the therapy laser for four different values of τ. g (2) was calculated for an area at the center of the field of view, close to the surface, where the SNR is the highest and the coagulation was guaranteed to complete. In this case, a pixel size ensemble of z = 3, x = 50, and t = 10 was used for a more accurate estimation of g (2) and since high spatial resolution was not a concern. The coagulation spot was visible at the end of the therapy, confirming that tissue did indeed coagulate. From left to right, vertical dashed lines represent moments when the laser was turned on, when tissue motion due to thermal expansion stops (evaluated visually), and when coagulation is reached. For all τ values, a drop in the g (2) value is observed shortly after the laser is turned on. There is often a sudden thermal expansion of the tissue during the initial phase of the coagulation. The expansion is easily identifiable visually. We can see the end of this expansion at the second line when g (2) increases slightly for all values. Finally, at the third line, we can see an increase in g (2) for all values of τ. We estimate the tissue to have finished coagulating at this moment. These results were used in determining our choice of threshold values and τ for the real-time monitoring, which were set from inspection of Fig. 10 to τ = 10 ms, ξ 1 = 1.4 and ξ 2 = 1.9.
The use of threshold values is, however, not necessary to visualize the progression of the thermal coagulation area of the tissue. Figure 11 shows a superposition of the decorrelation map over the OCT image for the same experiment. Ensemble size was returned to (z = 3, x = 10, t = 10), since spatial resolution was necessary to know which part of the tissue was affected by coagulation. From left to right, Fig. 11 shows the OCT intensity tomogram (a), the g (2) map without (b) and with (c) noise correction and the g (2) overlay in color over the OCT tomogram (d). The difference made by noise correction can be seen by comparing the g (2) map without  (2) for τ ranging from 10 ms to 40 ms (from dark to pale blue) during laser exposure. From left to right, vertical dashed lines indicate when the laser is turned on, the end of thermal expansion, and when we estimate coagulation to be complete. Color palette from [58] (b) and with (c) noise correction. The red bars shows the depth at which the system detects undergoing coagulation, g (2) <ξ 1 , due to noise in the untreated region of the tissue. The noise correction thus extends the monitoring range by approximately 0.5 mm. The overlay preserves the structural information from OCT while highlighting the progression of the coagulation. Since Labview does not permit creating the overlay, it was performed in retrospective processing. The refractive index of rat muscle was assumed to be n = 1.39 for adjusting the scale of the z axis [59,60]. Coagulation can be seen as the transition from correlated speckle to decorrelated and back to correlated. Coagulated tissue is thus visible as a correlated area in yellow over a decorrelated arc in blue. The progression of the thermal coagulation can also be observed in Fig. 12 and Visualization 1. Coagulation overlay was not calculated with Eq. (14) since we found the threshold method to not be reliable with limited ensemble sizes.  (2) n , (c) corresponding g (2) nc , and (d) overlay of the OCT intensity (encoded in the luminance) and g (2) nc encoded in the hue of a perceptually uniform isoluminant color map [61]. The red bars in (b) and (c) indicate the depth at which the system would have incorrectly detect undergoing coagulation, g (2) <ξ 1 , due to noise in the untreated region. Scale bars are 0.5 mm.  Figure 12 shows a sequence of OCT images during the therapy of the sample at different time points. The periodic horizontal lines in the intensity are a product of birefringence of muscle at baseline -which is affected by the coagulation process-and the absence of a polarization-diverse receiver in the OCT system. Homogeneous tissue birefringence produces a regular change in the polarization state of light with depth. Given that the single reference arm polarization is fixed, interference between sample and reference arms follows periodic oscillations as a function of depth, essentially reproducing Malus's Law [62]. Dark bands correspond to depths at which tissue birefringence causes backscattered light to have perpendicular polarization with respect to that of light from the reference arm.
The final experiment in Retrospective Diagnostic mode consisted of the coagulation monitoring of a moving sample and confirming our result though histology. The parameters used were the same, 10 mJ pulses at 100 Hz, however duration was 5 seconds instead, to adjust for the different optical and thermal properties of the sample. B-scan rate was the same 100 Hz and a τ = 10 ms was used to calculate g (2) . Motion was introduced using a vibrating motor and quantified using ensembles on both sides of the targeted area as explained in Sec. 3.2. Figure 13 shows the coagulation monitoring of the tongue of a rat subjected to motion before (a) and after (b) motion correction, as well as the corresponding histology section (c). The OCT intensity image is shown in (d), which does not exhibit any clear indication of the coagulation depth. Images shown were acquired post laser exposure since we observed that the coagulation continues for a few tens of milliseconds after the laser is turned off. Despite the expected change in shape of the tissue after histological processing -particularly the fold of the tongue which became more pronounced-the coagulation depth observed in OCT matches fairly well that measured with histology. Motion correction improves the visibility of the correlated area corresponding to fully coagulated tissue. More importantly, noise-and motion-correction together are essential in the use of threshold values -described in Eq. (14)-for the real-time monitoring of the coagulation depth and automatic interruption of the therapy laser presented in the next section.

Monitoring in real-time
The previous images were all created in post-processing with the Retrospective Diagnostic mode. Although images shown in this section were created in post-processing as well, the Depth Targeting mode was used for which a desired coagulation depth is defined interactively on the initial structural image. The correlation is calculated at this targeted depth in real time to perform the coagulation-threshold values checks, outlined Eq. (14).
We were able to detect the moment the coagulation reached the desired depth and shut the laser off. The experimental parameters are detailed in Table 1. Figure 14 shows the results from two real-time experiments which were performed targeting two different depths. The overlays correspond to the state of the tissue a few tens of milliseconds after the laser was turned off since the coagulation process continues after exposure. We can see that in the case of the shallower targeted depth, we seemed to have coagulated deeper than intended. This might be due to the coagulation continuing after the therapy laser closed. In a future implementation, the increase in coagulation depth after the laser is off can be determined experimentally, and the laser can be shut off before in order to reach the targeted depth once coagulation ceases. The difference was not large for the deeper target depth since we observed that the post laser shut off coagulation slows down deeper in tissue. We performed a final experiment in the presence of induced motion using the technique described previously, with the corresponding results in Fig. 15. We targeted a specific depth and compared the real-time estimation of coagulation depth from our technique with histology. The overlays show the tissue tens of milliseconds after the laser was turned off. The OCT overlays shown correspond to only noise-corrected decorrelation and noise-and motion-corrected. The targeted depth, marked by a red line, corresponds well to the coagulation depth determined in the histology. The full video of the results of this experiment are presented in Visualization 2. We quantified the motion by obtaining the vertical displacement required to get the drop in correlation observed ing (2) nc from the lookup table. We estimate that the decorrelation induced by the motion corresponds to a 55 µm displacement in the axial direction or 108 µm in the lateral direction over 10 ms.

Discussion
With our laser therapy and OCT system, we demonstrated how the normalized second-order autocorrelation function g (2) n of the OCT intensity signal could be used to monitor thermal coagulation depth. Noise correction on g (2) gives our system an increased monitoring depth while motion correction makes it more robust to bulk tissue motion. Furthermore, we showed that it was possible to verify whether the coagulation had reached the targeted depth in real time. Our results were confirmed on an ex-vivo sample (rat muscle) through NBTC histology. Since monitoring is based on the signal intensity correlation, it does not require the phase signal to be stable. In particular, the compute-intensive phase stabilization and complex-amplitude tomogram interpolation required to correct for non-uniform rotation distortion in endoscopic systems [30] is not required, and instead a simpler intensity-based approach would be sufficient [63]. Combined with the use of a single DCF coupled to a DCFC, the implementation of this approach into clinical catheter systems is greatly simplified and the co-registration of the therapy and imaging are guaranteed.
The coagulation progression was monitored in two ways: one aimed at visualizing the tissue region under active coagulation and letting the operator interpret the corresponding treatment depth (Retrospective Diagnostic mode); the other aimed at automatically determining the treatment depth for automatic laser shut down once the target depth is reached (Depth Targeting mode). In both cases, the depth was monitored over the span of several hundred microns corresponding to the typical thickness of the affected tissue layers in potential applications of our technique: 200-500 µm for the epithelium in the esophagus, 1 mm for respiratory papillomatosis and 0.35 mm for diabetic retinopathy.
The Retrospective Diagnostic mode was implemented in retrospective processing for our experiments, however it was designed for and is fully compatible with a real-time implementation. Visual feedback is provided by means of overlaying the hue-encoded speckle correlation value and the luminance-encoded OCT structural image, preserving the structural information while adding coagulation contrast during the treatment. The progression of the coagulation is readily seen by the transition from a decorrelated state, when tissue is being heated, to correlated, once it has reached coagulation. In this case, we did not automatically detect the coagulation as proposed in Eq. (14). The reason for this was the small ensemble size used, (z = 3, x = 10, t = 10) pixels. We found the threshold method to not to be reliable with limited ensembles. In this case, visual estimation by the operator is straightforward. A neural-network approach could potentially replace the operator making the coagulation depth monitoring more robust in this mode.
For the moment, the Retrospective Diagnostic mode was implemented in post-processing due to LabVIEW not allowing the creation of an overlayed image and its limited g (2) computing rate. We confirmed that our custom LabVIEW program using only CPU computing (no GPU) was capable of calculating g (2) on a 400x800 pixels frame using ensembles comprising 10 B-scans at a rate of 5 Hz with both noise and motion corrections. We expect that the use of faster programming language and the implementation of GPU-computing would easily allow our method to run in real-time.
The depth targeting mode was performed in real time, automatically shutting off the therapy laser when the coagulation had reached the targeted depth. We reduced the computation and display demands by calculating the correlation for a single ensemble situated at the target. To increase the reliability of the shutting off of the laser, we used a larger ensemble (z = 3, x = 50, t = 10).
Despite high success, in some rare cases a sudden thermal expansion of tissue caused a false positive in the depth detection. The thermal expansion resulted in motion of the untreated, deeper part of the tissue, causing a drop in g (2) followed by an increase -after expansion stopsand thus detected as complete coagulation at a depth not yet reached by the treatment. This phenomenon, easily identifiable visually, caused the automatic stop to trigger, ending the therapy prematurely could be automatically detected by calculating the cross-correlation of the OCT signal in depth to detect large-scale axial motion of the tissue and disable momentarily the coagulation detection. Another limitation of the depth targeting mode is that there is a minimum depth at which we can stop the coagulation, roughly 100 µm in rat muscle tissue. This is due to the laser power spread in depth which causes a coagulation front of finite depth.
In terms of the calculation of the correlation, we observed that the initial noise calibration of the system remained accurate despite changes in the tissue scattering properties, implying that the noise floor of the system is indeed constant throughout the therapy. Thanks to the noise correction, the monitoring depth was limited by the power of our therapy laser and not by the monitoring technique. With a different therapy approach able to deposit energy deeper in tissue the monitoring depth could become limited by the OCT signal attenuation.
Regarding our motion correction, we found it was essential for the depth targeting mode. An obvious limitation of the method arises when the motion causes the speckle pattern to become fully decorrelated, as there is no correction possible to recover the value of the correlation in absence of motion. To mitigate this, we limited the correction of motion-induced decorrelation to g (2) >1.3; for g (2) ≤ 1.3 we consider any measure of g (2) to be inaccurate and the checking of the coagulation conditions of Eq. (14) are not performed. This allows the mode to continue working despite sudden and large motion. Furthermore, a warning message is displayed when this occurs. For our system configuration, this corresponded to approximately 109 µm of axial displacement or 246 µm of lateral displacement between two B-scans. It is interesting to note that the dependence of speckle size on the system resolution implies that a system with poorer resolution would be capable of correcting for greater displacement, at the expense of the spatial resolution and the contrast between the coagulation front and coagulated tissue.
An important aspect of our approach was the determination of the optimal value of τ to maximize the contrast between the coagulated area and static tissue, as well as the optimal threshold values ξ 1 and ξ 2 for the automatic depth targeting. These values are expected to change depending on the absorption of therapy light, tissue thermal properties and the therapy laser power, wavelength and mode -CW or pulsed [64]. Therefore, prior testing is required to find the optimal parameters for each application.
Another important consideration is the optimal size for the ensemble used to calculate g (2) . As stated in the theory, larger ensembles have the advantage of estimating the correlation with a greater reliability, at the cost of a lower resolution in space and/or time. Furthermore, we found that motion correction necessitates larger ensembles to properly estimate and correct the motion. Our choice of ensemble size provided us with a resolution of ∼ 32.5 µm in z and 100 ms in time for the automatic coagulation depth targeting mode.
Improvements to the experimental setup include custom coating to the imaging lens to improve transmission for both the OCT and therapy laser transmission, especially in the context of endoscopic imaging. Our proof of principle relied on a chopped CW laser, which greatly limited the available power. In a next iteration, we envision using a pulsed laser in a wavelength range targeting an absorption peak of water.
Furthermore, the fact that the random movement of scatterers mimic the shape of the autocorrelation function of coagulating tissue opens an alternative avenue for correcting for motion. It is known that diffusive motion, another example of scatterer random motion, is described by an exponential decay of the autocorrelation function, in contrast to the Gaussian shape of bulk motion [65][66][67]. By calculating g (2) as a function of τ for a given t, it is possible to fit an exponential and a Gaussian function, in similarity with the approach to decouple diffusionfrom translation-induced decorrelation in dynamic light scattering, and distinguish coagulationfrom motion-induced decorrelation. Preliminary testing [68] shows great potential, but requires more computational power to calculate the autocorrelation function as a function of τ in real time.
Future work translating our technique to in-vivo experiments would require addressing some remaining challenges. Living tissue would introduce further sources of decorrelation besides coagulation and motion, such as blood flow inside blood vessels, potential bleeding and edema. However, decorrelation effects from these are expected to manifest on time scales significantly slower than coagulation-induced decorrelation. Their impact on our method would be small; optimal threshold values ξ 1 and ξ 2 might need to be optimized. Motion correction might present new challenges as well. Our correction method expects uniform bulk motion across B-scans and does not account for heterogeneous distortions. A potential solution is the use of tracking of tissue features (as opposed to speckle) using first, for instance, the speeded up robust feature (SURF) algorithm [69], followed by the Kanade-Lucas-Tomasi (KLT) feature tracking algorithm [70] across each pair of B-scans. This would produce a map of large-scale tissue deformation that would be used to suppress motion-induced decorrelation. There are real-time implementations of these algorithms [71]. Finally, further studies in vivo would require the use of endoscopic probes: an advantage of our use of DCFCs is that replacing a standard single-mode fiber with a DCF is relatively straightforward and would be enough for implementing this technique endoscopically, as long as the therapy beam spot size is of adequate size for coagulation [41].

Conclusion
In this work we presented a new laser therapy monitoring technique that allowed us to monitor the progression of thermal coagulation of excised animal tissue. A 532 nm therapy laser was used with OCT imaging through a single double-clad fiber compatible with endoscopic use. The use of a single fiber allows for simultaneous and co-registered imaging and therapy and greatly facilitates its implementation in endoscopic probes. We present the use of a normalized second-order autocorrelation function to measure the decorrelation of the speckle pattern occurring during coagulation. We implement an analytical noise correction that extends the therapy monitoring depth beyond the penetration depth of the therapy laser. We also implement a numerical motion correction technique that makes our technique robust against bulk tissue motion. Using a threshold scheme, we are able to detect, in real-time, when the coagulation had reached the targeted depth and automatically turn the therapy laser off. Relying on the dynamics of speckle during coagulation addresses fundamental limitations of techniques that rely on the change of tissue birefringence -which require tissue with birefringence at baseline and a polarization-sensitive OCT system, or the attenuation of the OCT signal -which are known to underestimate the therapy depth. Finally, in contrast with alternative methods that rely on the complex-amplitude signal correlation, our monitoring scheme does not require the phase of the OCT signal, further facilitating real-time implementation in endoscopic OCT systems, thanks to the enabling of simplified correction approaches for non-uniform rotation distortion artifacts.

Appendix A -Speckle simulation
In this Appendix we present the procedure used to numerically simulate speckle patterns to study the combined effect of motion and thermal coagulation on g (2) . We randomly distributed an ensemble of scatterers and simulated light from an illumination beam being reflected off of those scatterers, producing a two-dimensional speckle pattern [56]. Coagulation was simulated by randomly moving the scatterers individually, while bulk tissue motion was added with a sub-pixel displacement. g (2) calculated from the resulting speckle patterns were assembled into the lookup table presented in Fig. 3. Simulation parameters are included in Table 2.
The first step consisted of simulating the position of randomly distributed and moving scatterers. We start by defining our simulated environment pixels z and x positions, p z0 and p x0 , as follows: p z0 (z) = (z − 1) · px for z ∈ {0, 1, 2, . . . , s z − 1}, p x0 (x) = (x − 1) · px for x ∈ {0, 1, 2, . . . , s x − 1}, (15) where z and x are the pixel indexes, s z and s x are the size of the simulated environment and px is the physical size of the pixels, assumed to be the same in z and x for simplicity. We then randomly distributed the scatterers: p zs (z, x, n, t = 0) = 1z (z, x, n) · px + p z0 (z), p xs (z, x, n, t = 0) = 1x (z, x, n) · px + p x0 (x), where p zs (z, x, n, t = 0) and p xs (z, x, n, t = 0) are the physical locations, in the z and x directions respectively, of the n-th scatterer in pixel (z, x). There is thus multiple simulated scatterers per pixel for a total number of s n scatterers per pixel. 1z and 1x are randomly generated numbers uniformly distributed from 0 to 1. Random motion is then added to simulated tissue coagulation [68] p zs (z, x, n, t) = p zs (z, x, n, t − 1) + m a · 2z (z, x, n, t), p xs (z, x, n, t) = p xs (z, x, n, t − 1) + m a · 2x (z, x, n, t), where 2z (z, x, n, t) and 2x (z, x, n, t) also are randomly generated number with a uniform distribution between 0 and 1. The amplitude of the movement is scaled by changing m a value. We then simulate how OCT light is reflected by our scatterers. We simulated a Gaussian point spread  (Z, X, N, t)), where E is the resulting complex electric field on each pixel and w is the beam waist of the PSF assuming Gaussian illumination. The simulation thus accounted for both the amplitude and phase of the backscattered light. We are, however, interested in the signal intensity: The process in Eqs. (17) and (18) is repeated to obtain a speckle pattern changing in time in response to the dynamics of the scatterers. The next step consisted of calculating g (2) . We defined the ensembles I 1 and I 2 as follows: The variable τ defines the delay. Since we also wanted to simulate bulk tissue motion, instead ot adding it in Eq. (17), we decided to shift I 2 (τ) by a subpixel amount based on previous works on subpixel registration [72][73][74]: Z = F (I 2 (τ)), where F denotes a two-dimensional discrete Fourier transform implemented through a fast Fourier transform algorithm, and F −1 is the corresponding inverse discrete Fourier transform. ∆ is the shift value in pixels ranging from 0 to ∆ max . Since we shifted I 2 (τ, ∆) towards the bottom, the top of the speckle pattern will no longer be spatially correlated. We thus cropped the wrapped regions before calculating g2. I 1 and I 2 (τ, ∆) become I 1c ≡ {I 1 (z, x)} ∀z ∈ {∆ max + 1, ∆ max + 2, . . . , s z } and ∀x and I 2c ≡ {I 2 (τ, ∆)(z, x)} ∀z ∈ {∆ max + 1, ∆ max + 2, . . . , s z } and ∀x.