Design and analysis of a fiber-optic sensing system for shape reconstruction of a minimally invasive surgical needle

This paper presents the performance analysis of the system for real-time reconstruction of the shape of the rigid medical needle used for minimally invasive surgeries. The system is based on four optical fibers glued along the needle at 90 degrees from each other to measure distributed strain along the needle from four different sides. The distributed measurement is achieved by the interrogator which detects the light scattered from each section of the fiber connected to it and calculates the strain exposed to the fiber from the spectral shift of that backscattered light. This working principle has a limitation of discriminating only a single fiber because of the overlap of backscattering light from several fibers. In order to use four sensing fibers, the Scattering-Level Multiplexing (SLMux) methodology is applied. SLMux is based on fibers with different scattering levels: standard single-mode fibers (SMF) and MgO-nanoparticles doped fibers with a 35–40 dB higher scattering power. Doped fibers are used as sensing fibers and SMFs are used to spatially separate one sensing fiber from another by selecting appropriate lengths of SMFs. The system with four fibers allows obtaining two pairs of opposite fibers used to reconstruct the needle shape along two perpendicular axes. The performance analysis is conducted by moving the needle tip from 0 to 1 cm by 0.1 cm to four main directions (corresponding to the locations of fibers) and to four intermediate directions (between neighboring fibers). The system accuracy for small bending (0.1–0.5 cm) is 90\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\%$$\end{document}% and for large bending (0.6–1 cm) is approximately 92\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\%$$\end{document}%.

www.nature.com/scientificreports/ which creates a 3-dimensional map based on the change of each sensors' positions 3,17 . The system gives accurate visual guidance and does not require a field of view, however, the tracking system is affected by EM distortions. Undesired EM fields, as well as interference from metal or ferromagnetic sources around the system, can result in a diminishing of measurement accuracy 3 . Another promising method for MIS guidance is shape sensing of the needle based on the fiber optic sensors. Optical fiber characteristics, like biocompatibility, small size, and low mass 18 make them suitable for integration with invasive surgical tools. Since the working principle of fibers is based on the optical signals 18 , they are not prone to EM fields and are compatible with MRI environment 19 . Moreover, fibers have real-time monitoring capability and the possibility of multiplexing of several sensors simultaneously along the same fiber 20,21 . The possibility of using fibers for shape sensing has appeared with the development of Fiber Bragg Grating (FBG). FBG is built in the way that the fiber core refractive index changes periodically that enables the selection of certain wavelength regions 22 . In other words, the narrow part of the wavelength spectrum named Bragg wavelength is rejected in transmission and transmitted in reflection. In case of physical parameter change such as temperature or strain variation, the interrogator detects Bragg wavelength shift 22 . FBG arrays, which is the incorporation of several FBGs in one fiber, allows wavelength division multiplexing. Battisti et al. propose the usage of the combination of FBG sensors and MRI for shape detection during brachytherapy 20 . Three fibers with 9 FBGs were put inside the stylet and inside the needle lumen 20 . The authors state that the accuracy of the deflection is 0.27 mm and needle position accuracy is 0.79 mm. Moreover, Battisti et al. 20 mention that in comparison with MRI guidance the rate of the update was higher by 100 ms and the latency was lower by 300 ms.
The other fiber optic-based technology enabling shape sensing is the multi-core fiber Bragg grating (MCFBG) sensor 23 . Multi-core fiber (MCF) consists of multiple cores within the same cladding. Widespread MCF configurations are triangular with a central core and three outer cores, square and hexagonal ones 24 . The shape sensing accuracy improves when the number of cores increases while core to core distance does not change 24 . Several FBGs are inscribed in MCF forming MCFBG sensor. Khan et al. used triangular MCFBGs for the detection of 3D shape sensing of the catheter and endoscope 23 . The shape for MCFBG sensors is reconstructed with the calculation of individual strain of each core, then the curvature and torsion of each core are obtained from these strains, after that the central catheter curvature and torsion are calculated from each core curvature and torsion with a help of Frenet-Serrett equation 23,25 . The authors checked the setup in various configurations and achieved a maximum absolute error of 1.05 mm 23 . Fabrication of the MCFBG is more costly than single-mode fibers (SMF) 23 and these fibers are influenced by the twisting effect that gives rise to uncertainty in bending direction parameters. Floris et al. suggested re-twisting and compensation of this twisting effect for MCFBG 26 .
FBG and MCFBG sensors, which are based on point to point sensing enabled by having multiple sensors along the fiber, have centimeter-scale spatial resolution 27,28 , which can be insufficient for small medical devices, like needles. The other sensing configuration that can have a better spatial resolution (close to millimeter-scale) is distributed sensing 29 . Distributed sensing that is configured with optical backscattering reflectometer (OBR) makes the whole fiber region sensitive to external changes, for example, strain alterations. OBR applies optical frequency domain reflectometry to demodulate spectrally reflected distributed signals. The reflection of the signals at each point happens due to Rayleigh Backscattering naturally occurring in the fiber 6 . However, even though OBR has a good spatial resolution, the interrogation with OBR is limited to only one fiber. Parent et al. have achieved multiplexing of the OBR by using the optical switch 30 . The authors have reconstructed the shape of a medical needle based on the system of three sensing fibers, which have been located 120 degrees from each other and placed inside the needle. The use of the optical switch limits the maximum acquisition rate to 0.5 Hz, and the positioning of the fibers inside the needle may create an obstacle for the flow of liquid (in case of using the needle for drug delivery) 30 .
The system discussed in this paper is also based on the OBR interrogation to exploit the high spatial resolution that it provides, but the multiplexing is achieved with Scattering Level Multiplexing (SLMux) methodology. SLMux is based on the use of two different types of fibers, such as SMFs and high-scattering MgO-nanoparticles doped fibers (NPDFs), produced by doping the cores of SMFs with MgO-based nanoparticles 31,32 . The Rayleigh backscattering level of NPDFs is 35-40 dB higher than the one of SMFs, which gives an opportunity to discriminate the two fibers. Four NPDFs have been spliced with SMF pigtails with different lengths in such a way that the SMF backscattering regions spatially separate four NPDFs from each other. In comparison with Parent et al. 30 who applied three fibers and placed them inside the needle, in this setup four sensing fibers are glued outside of the needle at 90 degrees from each other. This fiber arrangement does not create an obstacle for the anesthetic and allows creating two pairs of opposite fibers (left and right, upper and lower). The distributed strain identified by the pair of left-right fibers is used to reconstruct the needle shape along the X-axis, while the strain detected by the upper-lower pair is converted to the needle shape along the Y-axis. Thus, the coordinate plane is created and the needle movement to all directions can be identified. Moreover, this arrangement of fibers can be useful to compensate for the influence of the temperature change on the measurements. Since the fibers are sensitive to both strain and temperature change, the difference between the temperature of the human body and the environment during the real MIS procedure can affect the strain measurement of the fibers. The two fibers located 180 degrees from each other detect almost the same strain with opposite signs, and almost the same temperature change. Therefore, the methodology to compensate for the temperature change has been also developed based on two pairs of opposite fibers and will be presented in another paper. The results of the preliminary experiments with the insertion of this needle into a custom-made phantom have shown a good potential of the suggested technology 6,33 . The needle is a Tuohy needle used for epidural anesthesia and the custom-made phantom mimics the spinal anatomy of the human body, so the system has been suggested for epidural anesthesia. However, it can be used with some modifications to guide the rigid surgical instruments for other MIS procedures.
In this paper, the performance analysis and accuracy estimation of the developed system is presented. The performance of the shape reconstruction is evaluated by fixing the base of the needle while moving its tip with www.nature.com/scientificreports/ respect to the base from 0 to 1 cm with a step of 0.1 cm to four main directions (the sides of the needle with fibers) and to four intermediate directions (between each pair of neighboring fibers). The reconstructed needle shape is compared with the reference and the reconstruction error for each direction is estimated. The accuracy of the needle shape reconstruction is evaluated separately for small bending of 0.1-0.5 cm and for large bending of 0.6-1 cm.

Results
Raw strain detected by the interrogation method. The interrogator used in this experiment is able to detect the strain sensed by each of the fibers connected to it (see the "Methods" section for more details). Figure 1 illustrates the strain detected by each fiber during the needle inclination to the lower direction (along the Y-axis). Since the lower side of the needle experiences compression and the opposite side stretches, the strain detected by the lower fiber is negative, while the upper fiber senses almost the same but positive strain. In general, the pattern for the upper-lower fibers is that for the tip shift by 0.1 cm the maximum strain is detected by the points located 1.5-2 cm from the base of the needle and constitutes about 150 µǫ . With each step of the tip shift, the strain increases by approximately 150 µǫ reaching 1500 µǫ at the end. The needle displacement causes the right and left fibers also experience bending because they are inclined together with the needle. Therefore, as can be seen in Fig. 1, right and left fibers also feel some strain. However, the strain detected by the right-left pair is different from the strain pattern of upper-lower fibers: first of all, it is much smaller (less than 300 µǫ ) and secondly, the two opposite fibers experience the strain with the same sign. Therefore, the direction of the needle bending can be identified based on the pair of fibers, which experience opposite strain. Strain sensed by the fibers during the needle bending to all other directions are given in Supplementary  Fig. S1. According to this figure, when the needle is bent to the upper direction, the elongated lower fiber detects the positive strain and the compressed upper fiber feels the negative strain. During the needle bending to the left and right (along the X-axis), the pair of left-right fibers becomes active and experiences similar strain with opposite signs depending again on the direction of movement, while the upper-lower pair detects small strain with the same sign. The needle inclination to the intermediate directions is characterized by all four fibers being active and sensing the strain of about 1000 µǫ for the maximum tip movement. For the case of intermediate directions, both pairs of fibers detect the strain with opposite sign, which implies that the bending has been conducted along both axes (X and Y). The results show that the strain detected by each fiber highly depends on the direction of the needle bending, and thus can be used for the identification of the needle shape. This gives an opportunity to develop an algorithm which reconstructs the needle shape based on the strain detected by two pairs of opposite fibers. The algorithm itself is discussed in "Methods" section and the result of the application of this algorithm is presented below.
Needle shape reconstruction. The strain data is used for the shape reconstruction algorithm, which is discussed in detail in the "Methods" section. Figure 2 presents the needle shape reconstructed with the use of this algorithm (red) compared with the reference (black) during the needle inclination to the lower direction. First of all, the base of the referenced shape (1st sensing point) shifts from 0 cm along the Y-axis as the tip moves. That is because, as it can be noticed in Fig. 7e, the fibers right near to the needle base are not glued firmly, so the strain measurement starts at about 0.6 cm from the base. Therefore, that first sensing point shifts with respect to the base of the needle when it is bent. Since the aim of the algorithm is to find the relative needle bending, the reference has been moved so that its first sensing point is at the origin and the reconstructed shape has been compared with the modified reference. Secondly, the reconstructed shape is underestimated although the direc- www.nature.com/scientificreports/ tion of the inclination has been identified correctly. The possible reason of such underestimation is that the glue limits the fibers' flexibility which leads to the detection of only a partial strain . In order to compensate for this influence, the correction coefficients have been calculated for both pairs of fibers (see the "Methods" section). The correction coefficient for the right-left pair of fibers found to be equal to 1.39295 × x + 1.91441, where x is the x coordinate of the sensing points along the fibers. The correction coefficient for the pair of upper-lower fibers is 1.25813 × y + 1.54276, where y is the y coordinate of the sensing points. Figure 3 illustrates the comparison of the needle shape after the application of correction coefficient (red) with the reference moved to the origin (black). As can be seen, the algorithm is able to reconstruct the shape with quite a good precision.  www.nature.com/scientificreports/ The comparison of the reconstructed shape before and after the application of the correction coefficients with the reference for all other bending directions is shown in Supplementary Figs. S2 and S3. It can be seen, that the reconstruction algorithm has succeeded in restoration of the needle shape during its bending to all eight directions (even to intermediate). Figure 4 illustrates the reconstructed shape separately from the reference for all directions combining the left and right (a), upper and lower (b), up-right and low-left (c), low-right and upleft (d) directions. The blue axis in Fig. 4 shows the tip shift according to the reference. The numbers shown above the blue axis represents the tip displacement from 0 to 1 cm with a step of 0.1 cm with respect to the base of the needle. However, as discussed above, the reconstruction of the needle has been conducted relative to its first sensing point (0.6 cm from the base), therefore the numbers below the blue axis show the tip position relative to the first sensing point. The reconstructed shapes of the needle are in agreement with the tip relative position found from the reference. For instance, the maximum tip shift detected by the algorithm for all directions is about 0.8-0.85 cm which corresponds to the tip relative position of 0.83 cm.

Discussion
According to Fig. 4, the algorithm after application of correction coefficient has succeeded in the reconstruction of the shape in both main and intermediate directions. However, when comparing the reconstructed shape with the reference (Fig. 3) it can be seen that there is still a small difference in the red and black shapes. This difference is the reconstruction error of the algorithm that has been shown in Fig. 5 separately for each direction for small (0.1-0.5 cm) and large (0.6-1 cm) bending. The average error patterns for all bending directions are quite similar to each other, but the right, up-right and low-right directions differs a little from the rest. First of all, the tip position for the three mentioned directions is underestimated, while it is overestimated for the other five directions. Secondly, the average errors for the right, up-right, and low-right directions are higher than for the rest of the directions for larger bending. There are several possible reasons which resulted in such difference: (1) Fibers gluing technique the fibers have been glued along the needle manually and although they were aligned as precise as possible, there is still a possibility of small misalignment. (2) The influence of glue itself it can differ a little from fiber to fiber and even from one part of the fiber to another part of the same fiber. www.nature.com/scientificreports/ (3) Reconstruction of the reference the reference has been reconstructed by taking photos of each position of the needle and processing them with the online program. The program allows to find the approximate coordinates of the sensing points along the needle and, thus, reconstruct its shape. The use of this program can also introduce some small mismatches.
According to Fig. 5, the maximum average error of the algorithm after the application of correction coefficient corresponds to the middle of the needle (3-4.5 cm) and this is true for the bending to all eight directions. For the small bending the maximum average error is about 0.045 cm (Fig. 5a), while for the large bending the maximum average error is in the range 0.06-0.15 cm (Fig. 5b).
During the minimally invasive surgeries, the aim is to position the needle tip correctly. Therefore it is important that the maximum reconstruction error of the proposed system corresponds to the middle of the needle, not its tip. According to Fig. 5, the needle tip position has been underestimated during its movement to the right, up-right, low-right, and low left directions by a maximum of 0.013 cm for the small bending and 0.07 cm for large bending. For the other four directions, the needle tip position has been overestimated by a maximum of 0.02 cm for small bending and 0.06 cm for large bending. Figure 6 illustrates the accuracy of the tip position estimation which is calculated as the reconstructed tip position over the reference. As can be seen, the accuracy ranges from 82 to 97%, and it is generally higher for the large bending than for the small bending. The average accuracy for all directions for the small bending is 90% and for the large bending is 92%.
In order to illustrate the performance of the system for the reconstruction of the needle behavior during its real-time movement, the visualization experiment has been conducted. The needle has been moved so that its tip draws different shapes (square, plus sign, multiplication sign, and sand clock) and that has been recorded on  www.nature.com/scientificreports/ the video. The videos that show the top view of the real movement of the needle and the reconstructed behavior of the needle are given in the Supplementary information (Videos S1-S4). As can be seen, despite the small imperfections of the setup, the system can be used for the real-time visualization of the needle behavior with an average accuracy of 90-92%. Figure 7 shows the experimental setup used to conduct the performance analysis of the needle shape reconstruction algorithm. The shape reconstruction is based on the four optical fibers glued around the needle and the Luna OBR interrogator (Luna OBR 4600, Luna Inc., USA). In this section the working principle and multiplexing of the Luna OBR, the needle shape reconstruction algorithm and the procedure of its performance analysis will be discussed.

The OBR interrogator: working principle and multiplexing method. The working principle of the
Luna OBR is based on the Rayleigh backscattering which is the scattering of light from each section of the fiber 30 . In this experiment, the length of the sections along the fiber is set to 0.5 cm. The instrument detects the spectrum of the backscattered light from each section and produces the plot of spectrum over length of the fiber (as shown in Fig. 7b). External physical factors that influence the fiber, like the application of the temperature or strain, causes the spectral shift of the backscattered light. The spectral shift is calculated by correlating the backscattering spectrum of each section of the fiber with the spectrum of the same section of the fiber recorded before it has been exposed to the temperature or strain. The temperature or strain are proportional to the spectral shift and can be found by the coefficients of − 0.8014 • C/GHz and − 6.6680 µǫ/GHz respectively 30 . In this experiment, the temperature is constant, while the strain changes due to the needle bending. www.nature.com/scientificreports/ The main reason for using the Luna interrogator is to achieve distributed strain measurement along all four fibers. The standard SMFs are not appropriate for multiplexing because they have the same scattering level and their backscattered spectra overlap. Therefore, high-scattering NPDFs have been produced by doping MgO nanoparticles to the core of SMFs (the fabrication process is discussed in the papers 31,32 ). The scattering power of NPDFs is 35-40 dB higher than the scattering level of SMFs, which allows achieving the Scattering-Level Multiplexing (SLMux). Four NPDFs of size 15 cm are spliced with the SMF pigtails in such a way that each SMF is about 8 cm longer than the preceding SMF + NPDF fiber (see Fig. 7c). Four SMF+NPDF fibers have been connected to the interrogator through a 1 by 4 coupler. The NPDFs are used as the sensing fibers, and each sensor can be discriminated from others because of the 8 cm lower-scattering SMF regions between them. Figure 7b illustrates the spectrum of the SLMux setup, which consists of four high-scattering (about − 85 dB) regions of NPDFs separated by low-scattering (− 125 dB) SMF regions. Strain measurements, that have been shown in Fig. 1, are taken from the spectral shift of that four regions of high-scattering fibers. Fig. 7d, four NPDFs are glued along the needle (d = 0.127 cm) at 90 degrees from each other. The attaching of the fibers to the needle has been performed manually and the setup consists of the needle, four fibers, the dynamometer, and two fixators (see Fig. 8a)

Fibers gluing technique. As can be seen in
The procedure of gluing the fibers to the needle: (1) About 1 cm of the first fiber is pasted to the tip of the needle by epoxy glue and is left for half a day in order for the glue to dry up. (2) After the tip of the fiber is firmly fixed, the needle is placed into the fixator in such a way that the fiber is on the upper side of the needle. The fixator is attached to the table with double-sided scotch tape. The fiber is stretched to make it straight by the dynamometer up to the point when it shows 100 g (to achieve consistent tension for all four fibers). The dynamometer is fixed by another fixator. About 5 cm of the fiber is pasted to the needle with the epoxy glue and left for half a day to dry up. (3) The fiber near the needle base (about 1.5 cm) is left unglued because it is not firmly fixed to the needle due to the dynamometer stretching. Therefore, the remained part of the fiber is fixed with a thread and pasted by the epoxy glue for another half a day. (4) After pasting the first fiber, the needle is rotated by 90 degrees from the position (b) to (c) shown in Fig. 8, and the procedure is repeated for the right side of the needle. Then the needle is rotated by another 90 degrees (Fig. 8d) and the fiber is pasted on the lower side of the needle. Finally, the needle is positioned as in Fig. 8e and the lower fiber is glued. www.nature.com/scientificreports/ This manual gluing technique has been used for this experiment to check the feasibility of the needle shape reconstruction algorithm. However, it is planned to improve the gluing technique in order to achieve more accurate fibers' positioning along the needle.
Shape reconstruction: fibers arrangement and reconstruction algorithm. The arrangement of four fibers at 90 degrees from each other allows to achieve two pairs of the opposite fibers (left-right and upperlower) and use each pair to reconstruct the needle shape along X and Y axes respectively. The algorithm for the needle shape reconstruction along the Y-axis, presented in Fig. 7e, consists of the following steps: (1) The distributed sensing provided by the Luna OBR allows obtaining sensing points (SP) located each s = 0.2 cm along the lower and upper fibers. In this experiment, the monitored length of the needle is 7.4 cm, so there are 38 SPs along each fiber. The sensor spacing and number of SPs may be increased depending on the needle dimensions, but for this needle, the 0.2 cm resolution has been found to be sufficient to reconstruct the shape accurately. (2) Each fiber is divided by the SPs into 37 sections. The elongation or compression of each section is calculated by assuming that the strain sensed by the section is the average of the strains detected by the two neighboring SPs ( ǫ L i and ǫ L i+1 ) and multiplying this strain by the length of the section before the strain has been applied (s). Thus, the length of the elongated or compressed i th sections of the lower ( S L i ) and upper ( S L i ) fibers are calculated as follows: (3) After that the coordinates of the ending points of the first sections of the lower and upper fibers are calculated as follows: (4) When the needle is bent to the lower direction, the lower fiber sections experience compression, while the opposite upper fiber is elongated, and vice versa. This results in the difference between the lengths of the two opposite sections which is used to calculate the bending angle of the subsequent section of the needle. The bending angle ( β i ) is the angle between the line which connects two opposite SPs ( L i U i ) and the Y-axis. As can be seen in Fig. 7e, the first bending angle is 0 and the second bending angle can be calculated as follows: (5) As it can be seen in Fig. 7e, the angle ∠L 3 L 2 H = 90 -β 2 , so the angle ∠L 2 L 3 H = β 2 . Therefore, the coordinates of the subsequent sections' end can be found from the sections length known from step 2 and the coordinates of the previous SPs: (6) The bending angle of the subsequent section is calculated as a summation of the previous bending angle with the angle between the line connecting the two opposite beginning SPs ( L 2 U 2 ) and the line connecting the two corresponding ending SPs ( L 3 U 3 ): (1) (3) www.nature.com/scientificreports/ (7) This process continues, until the whole needle inclination to the upper or lower directions is reconstructed. (8) Upper and lower fibers are used to reconstruct the shape of the needle along the Y-axis, so in order to detect the needle movement along the X-axis the same algorithm is applied for the pair of left-right fibers. After that, the coordinates of the points along the middle of the needle are calculated: x coordinates are the average of x coordinates of the left and right fibers' sensing points, y coordinates are the average of y coordinates of the upper-lower fibers' points and z coordinates are the average of the z coordinates of all four fibers' points. To reconstruct the whole needle in 3 dimensions, the points located d 2 cm from the middle are drawn. Figures 2, 3 and 4 show the movement of the middle of the needle, and Supplementary Videos S1-S4 illustrates the 3D bending of the needle.
Performance analysis: experiment conduction and data processing. In order to evaluate the performance of the needle shape reconstruction system described above, the needle calibration experiment has been conducted. The base of the needle has been positioned inside the yellow box (see Fig. 7a) so that the base is firmly fixed but the needle itself can move freely. The tip of the needle has been fixed with the breadboard, which has been glued to the micropositioner. This setup allows moving the needle tip from 0 to 1 cm with a step of 0.1 cm. The needle has been moved to the left and right directions (along X-axis), then rotated by 90 degrees and moved to the upper and lower directions (along Y-axis). Moreover, the needle has also been moved to the intermediate directions, such as upper-right and lower-left (along X axis), upper-left and lower-right (along axis). A mobile phone camera, aligned with the plane of the needle, has been used to take the photos of each position of the needle. The photos have been processed with the "Web Plot Digitizer" online program 34 , which helps to find the coordinates of the points along the needle and based on them reconstruct its shape. Figure 7f illustrates the two positions of needle which moved from 0 to 1 cm. The red dots along the needle drawn by the mentioned online program, are located approximately in the middle between the SPs of the left and right fibers. The coordinates of those points are used to approximately reconstruct the real shape of the needle during the experiment, which is used as a reference in the further analysis.
Five trials of the movement to each direction have been performed. The trials have shown consistent results, therefore in this paper, only one of the trials for each direction has been presented. The reconstructed shape has been compared with the reference obtained using the online program (see Fig. 2). In our algorithm, the aim is to find the relative positions of all the needle with respect to the starting point so the reference shapes have been all moved so that the starting point is at 0 cm. The reconstructed shape has been then compared with the modified reference and the coefficient that corrects the reconstructed shape has been found for each trial of the experiment. The coefficients from all trials of the movement to the left and right have been averaged and found to be 1.39295 × x + 1.91441, where x is the x coordinate of the points along the needle. The same has been done for all trials of the movement to the upper and lower directions and the coefficient for that pair has been found to be 1.25813 × y + 1.54276. The coefficients have compensated for the influence of the glue which resulted in only partial detection of the needle bending by fibers. The algorithm has been modified with the consideration of the two coefficients for left-right and upper-lower pairs of fibers and the shape has been reconstructed again (see Fig. 3). The same coefficients have been used to reconstruct the shape when the needle has been moved to all directions, including intermediate ones (see Supplementary Fig. S2). In order to better illustrate the needle movement by steps along four axes (main and intermediate) the reconstructed shapes for the needle bending to the pairs of opposite directions have been combined and presented separately from the reference in Fig. 4.
The errors for the small (0.1-0.5 cm) and large (0.6-1 cm) bending shown in Fig. 5a,b respectively) have been estimated by finding the average errors (the reference minus the reconstructed shape) of all five trials separately for each direction. The accuracy of the tip position shown in Fig. 6 has been calculated as an average of the accuracy (reconstructed tip position over the reference tip position) of all five trials separately for small and large bending.

Conclusion
This paper has presented the system for shape reconstruction of the rigid medical needle based on distributed strain measurement achieved by gluing four optical fibers at four sides of the needle. The strain sensed by the pair of opposite fibers during the needle movement is able to reconstruct the needle inclination along one axis. Two pairs of the opposite fibers allow to create a coordinate plane and reconstruct the needle bending to any direction. The setup has been calibrated by the correction coefficient and its performance has been tested by moving the needle to four main directions (sides where fibers are located) and four intermediate directions (in between each two neighboring fibers). The system has shown promising results by allowing to identify the position of the tip with the accuracy of 90% for small bending (0.1-0.5 cm) and 92% for large bending (0.6-1 cm). The system is proposed to be used for minimally invasive surgeries to visualize the behavior of the needle during its insertion into the human body.
Future work will be aimed at the improvement of the setup, in particular, modifying the fibers gluing technique and finding the bio-compatible glue. The manual gluing of the fibers has introduced the aforementioned errors and the improved protocol of fiber gluing may improve the accuracy of the setup. One of the possible ways to achieve the precise straightforward gluing of each fiber and exactly 90 degrees distance between them is to produce four microgrooves along the needle and glue the fibers inside them. Moreover, the epoxy glue used to attach the fibers in this setup may not be suitable for the real medical surgeries, therefore it is important to find a bio-compatible alternative. After that, it is planned to conduct a set of experiments with the real medical phantom and use the shape reconstruction data to classify different types of insertion (wrong or correct). As a result, the system can be real-time guidance for minimally invasive surgeries, which can not only visualize the behavior of the needle but also notify about correctness or incorrectness of the insertion in real time.