Abstract
Introduction:
Currently, stone size cannot be accurately measured while performing flexible ureteroscopy (URS). We developed novel software for ureteroscopic, stone size measurement, and then evaluated its performance.
Methods:
A novel application capable of measuring stone fragment size, based on the known distance of the basket tip in the ureteroscope's visual field, was designed and calibrated in a laboratory setting. Complete URS procedures were recorded and 30 stone fragments were extracted and measured using digital calipers. The novel software program was applied to the recorded URS footage to obtain ureteroscope-derived stone size measurements. These ureteroscope-derived measurements were then compared with the actual-measured fragment size.
Results:
The median longitudinal and transversal errors were 0.14 mm (95% confidence interval [CI] 0.1, 0.18) and 0.09 mm (95% CI 0.02, 0.15), respectively. The overall software accuracy and precision were 0.17 and 0.15 mm, respectively. The longitudinal and transversal measurements obtained by the software and digital calipers were highly correlated (r = 0.97 and 0.93). Neither stone size nor stone type was correlated with error measurements.
Conclusions:
This novel method and software reliably measured stone fragment size during URS. The software ultimately has the potential to make URS safer and more efficient.
Introduction
U
The ability to measure stone fragment size is particularly important for intraoperative decision-making. An accurate size measurement determines the need for and extent of further fragmentation, likelihood of spontaneous fragment passage, and ability to safely extract fragments through a ureter or ureteral access sheath. In addition, underestimation of stone fragment size can lead to complications such as ureteral trauma or an entrapped basket. 5,6 Misjudging stone size can also result in multiple exchanges of ureteroscopic instruments and discontinuous stone fragmentation, which can increase operative time and decrease surgeon productivity.
To achieve an accurate and objective quantification of stone fragment size, we developed novel software that performs intraoperative measurement of objects during URS. The software was utilized in recorded video from URS procedures for ureteral and renal stones during basket extraction of fragments. We tested the software's accuracy and precision with stone fragments of varying sizes to determine the feasibility and performance of this technology.
Materials and Methods
The size of an object viewed through a ureteroscope depends on its distance from the end of the scope. Distance can be estimated by the length of wire advancement when touching a target object and depth can be measured from the ureteroscopic image. A geometric model, calibration procedure, and software tool were developed to implement this method.
Geometric model
Object size as viewed in an image is inversely related to its distance from the ureteroscope tip. Size determination as related to the depth of the wire measured in the actual image was calculated using mathematics described in Supplementary Figure S1 (Supplementary Data are available online at
Ureteroscopes typically include a wire channel on the side. A checkerboard calibration rig is placed in front of the scope and the distance between the side of the wire and the optical axis was determined. During insertion through the scope, the wire is not initially visible in the image. When advanced deeper, the tip of the wire exits the scope and appears on the side of the image. In the image, the wire appears to advance laterally, from the edge toward the center of the image, therefore depth is measured laterally (Supplementary Fig. S2).
Calibration
A single-use ureteroscope (Lithovue; Boston Scientific) and a guide-wire (Ø0.965 mm, Hydro-Glide; Bard) were used. The end of the ureteroscope was fixed on a testing device. A checkerboard (8 × 6 mm) was mounted to a linear sliding stage aligned with the optical axis of the scope. Ureteroscopic images were acquired with a video capture device (AV.io HD; Epiphan Systems, Canada) from the digital visual interface (DVI) output of the ureteroscope.
Endoscopic images are typically radially distorted; thus, the first step of calibration is image dewarping. Distortion correction was performed with a common technique. 7 In short, warping was measured based on checkerboard images, and a reverse transformation was applied to dewarp the image. Dewarping is then applied in real-time to the images acquired. The entire calibration was repeated with a second ureteroscope of the same kind to compare the results. Total calibration time was less than five minutes.
Measurement
The calibration coefficients were used to measure the size of objects (stones) in the image: (1) a wire or instrument was advanced to the object, and (2) the size and depth of the object in the image were calculated.
Software
Software was developed in Visual Studio 2017 (C++; Microsoft Corp.) with open source computer vision library (OpenCV). The software implemented the distortion correction and measurement methods as described above. A scale was represented on the sides of the image as shown in Figure 1b and d that changes according to the depth.

Method of stone measurement.
Study
In an IRB-approved study, URS was performed for ureteral and renal stones per standard of care in five patients older than the age of 18 years without identified genitourinary abnormality. A new single-use digital ureteroscope of the same model, used for the calibration, was used in each case. Stones were fragmented with a 200-μm laser fiber, and a 1.9F Zero Tip nitinol stone retrieval basket (Boston Scientific) was used for stone extraction. Recordings were obtained throughout the duration of each ureteroscopic case—starting with rigid cystoscope insertion and terminating with ureteral stent placement. A ureteral access sheath (Navigator HD, 11/13F; Boston Scientific) was used in one case, in which numerous renal stones were present. Immediately following extraction, fragments were numbered, and digital calipers (CD-8"CSX; Mitutoyo, Japan) were used to measure the longitudinal (Sl ) and transversal (St ) axes of the stone, as shown in Figure 1a, c. Caliper measurement provided the gold-standard measurement for comparison to the software-acquired stone measurements.
Recorded images were analyzed after the procedure. The size of the stone from the images was measured, while the stone fragment was within the endoscopic basket, as shown in Figure 1b and d, and the entire stone and basket were visible. Stone measurement can occur with any fragment that is in close proximity to a ureteroscopic instrument that has undergone previous calibrations. The workflow of the software program requires that the user select a portion of the basket in contact with the stone to measure depth and calibrate the image scale. This scale then becomes visible around the periphery of the image and can be used for future measurement reference, as seen in Figure 1b and d. Following this, measurements can either be performed using the visible scale or selection of the object sides. The longitudinal (sl ) and transversal (st ) sizes of the stone were measured for all stones. Figure 2 shows the linear regression results of the ureteroscopes. The two constant parameters are R 1 = 1.135 (mm) and r 1 = 501 (pixel) for Scope 1 and R 2 = 1.115 (mm) and r 2 = 508.2 (pixel) for Scope 2. Their respective average parameters are R = 1.125 (mm) and r = 504.6 (pixel). These values were used in the measurements. The time to measure fragments was equivalent to time to caliper placement.

Calibration results of two ureteroscopes. Red and blue asterisks indicate measurement values of the scopes. Green lines indicate linear regression results.
Measurement errors were calculated as the difference between the software- and caliper-measured sizes in mm, for both the longitudinal and transversal measurements. The accuracy and precision of measurements were calculated as the average and standard deviation of the errors over the entire dataset, as usual. In addition, confidence intervals (CIs) and Pearson's correlation coefficients were calculated for corresponding measurements. Analyses were performed using R version 3.1.2. A p-value <0.05 was considered statistically significant.
Results
URS was performed for 18 stones in five patients, which resulted in 30 measured stone fragments (Fig. 3) and 60 longitudinal and transversal measurements. Patient and stone characteristics can be seen in Table 1. The preoperative median stone size was 3.0 ± 2.0 mm, with the largest stone measuring 8.0 mm. All stone fragments saved for analysis could be measured, and no technical difficulties were encountered with this task. The longitudinal and transversal stone fragment measurements obtained by software and caliper measurement are listed in Table 2. The median longitudinal and transversal stone fragment size measurements as measured by digital calipers were 3.2 ± 0.8 and 2.2 ± 0.6 mm, respectively. The median longitudinal and transversal stone fragment size measurements determined by the software were 3.2 ± 0.8 and 2.0 ± 0.6 mm, respectively. The median longitudinal and transversal errors were 0.14 mm (95% CI 0.1, 0.18) and 0.09 mm (95% CI 0.02, 0.15), respectively. The maximum errors measured for longitudinal and transversal measurements were 0.53 and 0.59 and the minimum measured were 0.02 and 0.01 mm.

Stone fragments from
BMI = body mass index; SD, standard deviation; URS = ureteroscopy.
All measurements in mm.
The longitudinal and transversal accuracies of measurements were 0.17 and 0.17 mm, for an overall accuracy of 0.17 mm. The longitudinal and transversal precisions to measure stone fragments were 0.12 and 0.18 mm, for an overall precision of 0.15 mm. The longitudinal and transversal measurements obtained by the software and digital calipers were highly correlated (r = 0.97 and 0.93, respectively). Stone size was not correlated with longitudinal and transversal error measurements (r = 0.3 and 0.1, respectively). In addition, there were no statistically significant differences between errors measured in calcium oxalate and cystine stones (p = 0.2).
Discussion
We investigated the ability of a novel software application to measure stone fragments during URS. The software proved to be accurate and precise, with a median error less than 0.15 mm. Software measurements were highly correlated with standard measurements using digital calipers, and there was no correlation between stone fragment size and error measured. Thus, this software can be used with a high degree of reliability, accuracy, and precision during URS.
A limitation of the study was that the calibration was only performed with two scopes. Based on the accurate measurements performed with four other scopes, it appears that the calibration coefficients are relatively constant. Since calibrating the actual single-use scope before the case is not feasible, one has to rely on previously derived calibration results, and scopes should have uniform characteristics. Testing a larger number of scopes and possibly setting uniform calibration characteristic among other manufacturing controls of the scopes would be helpful. In our study, we used single-use ureteroscopes. The calibration and measurement methods, however, are readily applicable to reusable ureteroscopes and other types of scopes. In case of reusable scopes, it is possible to perform the calibration individually, if needed.
In our method and experiments, the depth of the wire was estimated based on the view of the visible part of the wire in the images. The stone dimensions are simply marked with two reference points, and a calculated size is provided. Thus, the amount of time for a urologist to calculate a particular stone size is negligible. The advantage of this approach is that it did not require additional hardware. An alternative approach is to use a wire tracking device, such as a wire roller or spool, that could measure the depth of the wire tip in real time, to adjust the scale of the images in the plane of the wire point.
The ability to determine stone size during URS is both clinically relevant and commonly useful. An application of this technology is in assisting the determination of fragmentation completeness. While we used a basket to measure stone size, this same technology could be easily applied to any ureteroscopic instrument, including lasers or wires. This is particularly true as the “dusting” technique is increasingly used in URS. Dusting relies on laser settings of a high frequency and low energy; this will fragment the stone into small pieces, or “dust,” which are then spontaneously discharged from the kidney. 7,8 However, without an accurate measure of fragment size, assumptions about stone passage may be erroneous. At other points during URS, particularly during basket extraction of fragments, stone size estimation is also required. Attempting to basket a particularly large stone can lead to stone impaction, necessitating multiple additional manipulations and significant case prolongation. 9,10 Importantly, attempting to remove a larger than anticipated stone can lead to substantial ureteral complications, including; injury, intussusceptions, and avulsion. 6 Severe ureteral injuries often require reconstructive procedures and are associated with major morbidities and changes in quality of life. 11,12 Understanding stone fragment size can also potentially decrease operative time, as extraction would commence once all fragments were small enough to be effectively removed.
While this technology is novel within the field of URS, there have been previous attempts to create accurate endoscopic measurement tools—particularly in the field of gastroenterology. 13,14 However, these studies approached the problem in different manners. Vakil and colleagues designed software capable of obtaining endoscopic measurements, but it necessitated obtaining the distance between the tip of the scope and the object which was measured using a guide wire with gradations. 13 Following calibration, the measurements in our study could be obtained without needing a new measure of distance for each stone measurement. Additional studies have also fallen short—allowing only measurement of luminal deformation, 15 or simply permit a ruler-like adjunct to an endoscope. 14
A limitation of the current study is that it was performed on URS video footage, as opposed to occurring in real-time. This was performed to determine the safety, feasibility, and accuracy of the measurement, before intraoperative measurement trials to follow. In addition, stones are often in complex shapes, and transverse and longitudinal dimensions may differ somewhat between measurements obtained with calipers and software. Although rare, some fragment measurements had greater levels of error—up to 0.5 mm of inaccuracy. This could lead to an occasional imprecise measurement, but it remains to be determined if that is clinically relevant. Future studies will attempt to determine causative or predictive factors of stone measurement error. A foreseeable cause is the relative position of touching the stone with the wire, which may require clinical training.
Our current study represents an initial report of a novel application, with further studies planned to transition this technology to intraoperative use. Once this application can be utilized concurrently with existing endoscopic video equipment, an evaluation of its broader intraoperative performance will be undertaken. While we only measured stones while basketing, measurements can also be performed using other endoscopic instruments. Future studies will investigate measurements obtained using laser fibers or other ureteroscopic instruments to confirm similar results. Additional ureteroscope types, such as the more commonly used reusable fiber-optic and digital ureteroscopes, will also be tested to confirm that accuracy and precision are maintained across ureteroscope type.
Conclusions
This study describes a novel method and software application to measure the stone fragment size during URS. To the best of our knowledge, no monovision scope medical system provides the ability to measure objects in the image. Theoretically, the measurements require stereovision for depth triangulation. However, we observed, demonstrated mathematically, and verified experimentally that the monovision measurement is possible with the help or a wire or other instrument advanced to the object, which is used as a surrogate of the missing depth information.
The accuracy and precision of the software were less than 0.19 mm, and the measurements between the software and digital calipers were highly correlated. The software's ease of use may permit its application to other types of endoscopy. Indeed, this could prove to be a useful tool for measuring not only stones but also findings during cystoscopy, colonoscopy, or laryngoscopy/bronchoscopy. Accurate and precise real-time endoscopic measurements would be of benefit to the entire medical community.
Footnotes
Author Disclosure Statement
No competing financial interests exist.
Abbreviations Used
References
Supplementary Material
Please find the following supplemental material available below.
For Open Access articles published under a Creative Commons License, all supplemental material carries the same license as the article it is associated with.
For non-Open Access articles published, all supplemental material carries a non-exclusive license, and permission requests for re-use of supplemental material or any part of supplemental material shall be sent directly to the copyright owner as specified in the copyright notice associated with the article.
