{'fraction_non_alphanumeric': 0.02986758952753536, 'fraction_numerical': 0.008463737586518206, 'mean_word_length': 4.984916704187303, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A virtual platform for real-time performance analysis of electromagnetic tracking systems for surgical navigation

Electromagnetic Tracking Systems (EMTSs) are widely used in surgical navigation, allowing to improve the outcome of diagnosis and surgical interventions, by providing the surgeon with real-time position of surgical instruments during medical procedures. However, particular effort was dedicated to the development of efficient and robust algorithms, to obtain an accurate estimation of the instrument position for distances from the magnetic field generator beyond 0.5 m. Indeed, the main goal is to improve the limited range of current commercial systems, which strongly affects the freedom of movement of the medical team. Studies are currently being conducted to optimize the magnetic field generator configuration (both geometrical arrangements and electrical properties) since it affects tracking accuracy. In this paper, we propose a virtual platform for assessing the performance of EMTSs for surgical navigation, providing real-time results and statistics, and allowing to track instruments both in real and simulated environments. Simulations and experimental tests are performed to validate the proposed virtual platform, by employing it to assess the performance of a real EMTS. The platform offers a real-time tool to analyze EMTS components and field generator configurations, for a deeper understanding of EMTS technology, thus supporting engineers during system design and characterization.


INTRODUCTION
Tracking systems are widely used in many applications, providing information about the localization of a target object in a defined area. The medical field is among the ones that are mostly taking advantage form the research on tracking systems. Different kinds of technologies are used to develop such systems, depending on accuracy requirements, tracking environment, and tracking distance. The applications range from optical and inertial systems for motion tracking and rehabilitation [1]- [2], up to more complex systems for surgical navigation. The last one is a procedure that relies on tracking systems to guide the surgeon during interventions, it allows to reduce the invasiveness of the intervention, thus improving its accuracy and safety, reducing risks of complications and hospitalization time [3]- [6]. Surgical navigation mainly relies on optical and electromagnetic (EM) technologies [7].
Optical tracking systems are very accurate and reliable, and they are employed in many medical applications [8]- [11], but they constantly require a direct line-of-sight, which prevents their use in presence of obstacles during intracorporal tracking.
Electromagnetic tracking systems (EMTSs) overcome this limitation [12]: a very small magnetic sensor, which measures the magnetic field produced by a known field generator (FG), is inserted into the surgical instrument (e.g., a flexible instrument such as an endoscope or a needle [6]), and the position of the sensor is estimated by means of a suitable algorithm. The intraoperative localization of the instruments is shown on a screen in front of the surgeon, and the anatomical area is reconstructed by merging information obtained by different medical imaging techniques, such as Computed Tomography, Ultrasounds, and Nuclear Magnetic Resonance [13], [14], which are acquired during the pre-operative phase.
ABSTRACT Electromagnetic Tracking Systems (EMTSs) are widely used in surgical navigation, allowing to improve the outcome of diagnosis and surgical interventions, by providing the surgeon with real-time position of surgical instruments during medical procedures. However, particular effort was dedicated to the development of efficient and robust algorithms, to obtain an accurate estimation of the instrument position for distances from the magnetic field generator beyond 0.5 m. Indeed, the main goal is to improve the limited range of current commercial systems, which strongly affects the freedom of movement of the medical team. Studies are currently being conducted to optimize the magnetic field generator configuration (both geometrical arrangements and electrical properties) since it affects tracking accuracy. In this paper, we propose a virtual platform for assessing the performance of EMTSs for surgical navigation, providing realtime results and statistics, and allowing to track instruments both in real and simulated environments. Simulations and experimental tests are performed to validate the proposed virtual platform, by employing it to assess the performance of a real EMTS. The platform offers a real-time tool to analyze EMTS components and field generator configurations, for a deeper understanding of EMTS technology, thus supporting engineers during system design and characterization.
The main limitation of EM technology is the short tracking distance, which is generally no longer than 0.5 m from the FG in current commercial systems, due to the reduced amplitude of the magnetic field with distance, and the high sensitivity to EM interferences and magnetic field distortions, thus limiting tracking accuracy far from the FG [15].
Tracking distance and accuracy are crucial, and they should be taken into account during the development of a surgical navigation systems. Many aspects affect system performance, and engineers and manufacturers should consider all of them, since also a small accuracy or distance increase is a valuable achievement in this field.
In this paper, we propose a virtual platform for assessing the performance of EMTSs for surgical navigation, showing in real time how the various sources of error affect the accuracy of tracking distance estimation. This platform provides a useful tool for supporting engineers during design and prototyping of EMTSs.
The paper is structured as follows: the main sources of error in EMTSs, and the importance of knowing them during system developing, are discussed in Section 2; the virtual platform, developed to provide a tool to analyse system performance during the prototyping phase, is illustrated in Section 3; in Section 4, EMTS prototype architecture is described and the developed virtual platform is evaluated by simulated and experimental tests performed on the EMTS prototype; conclusions are drawn in Section 5.

SOURCES OF ERROR
Modelling the magnetic field and the various sources of error is crucial in many applications, allowing to implement ad-hoc algorithms for automated error compensation [16], [17]. EMTSs tracking accuracy can be affected by several sources of error, which can be divided into static errors and dynamic errors [7], [12], [15].
Static errors occur when the sensor is placed in a given position, maintaining a fixed orientation. They are in turn classified as follows.
• Systematic errors: they are due to distortions of the magnetic field generated by i) the presence of metal objects in the surrounding environment, which can produce eddy currents induced by the variable field (mainly in AC systems), which generate secondary magnetic fields that add up to the main magnetic field; ii) ferromagnetic materials which, immersed in the main field, orient their domains causing a magnetization that modifies the field lines; and iii) power supply currents of the EMTS itself or of other electronic medical devices present in the operating room that can also cause a distortion of the magnetic field. These errors can be reduced by appropriate calibration techniques [18]. • Random errors (also referred to as jitter [12], [19]): these errors, mainly due to noise, reduce the repeatability of the system. Dynamic errors change over time, and they are mainly caused by variations in external EM fields, due to the movement of external organs, such as conductive, ferromagnetic, and electrical materials, which cause field distortions that are extremely difficult to compensate. The movement of the sensor itself is also a source of dynamic error, depending on its speed.
It must also be considered that tracking accuracy depends on the design of the FG and the choice of the position reconstruction algorithm. Moreover, the non-ideality of the electronic components of the tracking system itself affects the performance of the system. In fact, the generated field is never perfectly stable due to the intrinsic limits of the FG, and the measurement and acquisition process is subject to noise, which cannot be totally eliminated. For the reduction of random and dynamic errors, suitable filtering techniques and synchronization of the sampling frequency are particularly useful [20]. The implementation of the Kalman filter can also significantly reduce random errors [21].

VIRTUAL PLATFORM
The virtual platform is developed in LabVIEW ® software (by National Instruments Corp.), which is largely used to control and monitor industrial equipment and processes, and for the creation of test and measurement systems [22], [23]. It offers a real-time feedback of tracking accuracy ( Figure 1) and it provides an intuitive and user-friendly interface.
It is designed to be used in combination with a robot to move the sensor and provide accurate position references. The platform is composed of six main sections, which are described in the following subsections. The functioning of the platform is illustrated in Figure 2. The model of the EMTS if defined in an external file and imported into the platform, and the user defines the trajectory for sensor movement. Two different modalities can be performed: i) in the experimental mode, the platform connects to the DAQ device and the induced signal in the magnetic sensor is acquired as it is moved by the robot along the defined trajectory, ii) in the simulation mode, the signal of the magnetic sensor is simulated by employing a model of the magnetic field; in both cases, noise can be added to the signal. Finally, the position of the sensor is estimated by means of a suitable reconstruction algorithm, providing real-time 3D representation and error statistics.

3D view and real-time tracking statistic
Tracking systems provide the surgeon with the real-time estimate of sensor position, which is shown on a screen in front of the surgeon, where is also displayed the patient's anatomic area. 2D and 3D views are commonly used; in particular, the latter is more difficult to interpret, but seems to guarantee greater precision [24]. Hence, the platform provides a 3D view of tracking, where the actual and estimated position are displayed.
Moreover, real-time feedback of system performance becomes particularly useful when analyzing how a system responds to different inputs. Many design errors can be quickly avoided by real-time feedback. Hence, real-time plot and statistics of position tracking errors are provided during experiments. In particular, the position error along each cartesian axis, computed as the difference between the estimated position and the one provided by the robot, is shown on a graph, and its mean value and standard deviation are displayed. For example, the peak error in Figure 1 suggests performing a deeper exploration of the correspondent space region. All tracking results and statistics can be easily exported for further elaboration in Matlab or other software.

EMTS model import
• The number and arrangement of the transmitting coils, as well as their electrical properties, highly affect system performance [25]. Often the transmitting coils must be placed inside a well-defined space due to practical needs, such as the configuration of the clinical environment, weight limitations, or application requirements. Moreover, the tracking volume is usually proportional to the dimension of the FG (i.e., the magnetic field intensity) [12]. Hence the platform provides the import of a MAT-file (binary MATLAB ® file) containing the geometrical arrangement and the electrical properties of the transmitting coils of the FG, in order to test different FG layouts, as well as the parameters of the sensor coil. In Section 4.2, two different FG configurations will be compared to illustrate this functionality. • The assessment of tracking accuracy is a mandatory step in EMTSs developing, and different types of protocols have been defined [12], most commonly employing phantoms such as board and cube phantoms, as well as moving phantoms to assess dynamic performance. In addition, robots are also used to move the sensor, providing accurate position references, and allowing automatic and repeatable test; on the other side, robotic components can cause interference in the tracking volume, and they are quite expensive. In [26], the authors used a carbon fiber rod, held by the robot gripper, with the magnetic sensor positioned at the tip, in order to distance the sensor from the metallic components of the robot. The cinematics of the simulated robot (shown in Figure 1) is based on a real robot, model RV-2FB-D from Mitsubishi, which was employed in this research to move the sensor; however the platform provides the import of a file containing the model (i.e., the geometry of joints and links) of any robot.
Both the FG and the robot are displayed in the 3D scene of the platform, by means of the LabVIEW Robotics Toolkit. The FG shown in Figure 1 represents the EMTS described in Section 4.3.   In [27], a suitable interpolation algorithm has been used to reconstruct the position of the sensor in a small space. The sensor is placed in different calibration positions, and the voltage from the sensors are measured; then, position estimation is based on interpolation between calibration points by using Delaunay triangulation and linear interpolation. This technique requires measurements of the magnetic field in a dense grid to reach adequate accuracy, it does not allow extrapolation, and it is time-consuming, thus it could be applied only to small regions in the tracking volume.

Reconstruction algorithm and magnetic field model
Other algorithms are based on i) a model of the magnetic field obtained by approximating the coils as magnetic dipoles, or on ii) a model obtained by considering the mutual inductance between the transmitting coil and the sensor coil, which are considered as circular filaments [28]. Both models require the knowledge of the geometrical parameters of the coils, and the electrical quantities (i.e., current and voltage) of the transmitting coils, but do not need as many measurements as the interpolation method. Moreover, they could be used to compute the magnetic field (and therefore the induced voltage) in the whole tracking volume, allowing to perform experiments in a simulated environment.
Hence, the platform provides the possibility to choose an arbitrary reconstruction algorithm (developed in Matlab), or to track the sensor simultaneously with two or more reconstruction techniques, to compare their performance in different scenarios.
In this paper, to model the magnetic field produced by the FG and to reconstruct sensor position, we employ the dipole model explained in [21], [26], [28]. It is obtained by considering the magnetic moment generated by the i-th transmitting coil, expressed as: where ̂, is the versor orthogonal to the surface , of the i-th transmitting coil, and , , , , and are the coil radius, the number of turns, and the RMS value of the excitation current, respectively. The subscript i takes into account the differences of real parameters among each transmitting coil [26]. The where = | |, with = − , represents the vector distance between and the center , of the i-th transmitting coil, and ̂, is its associated versor.
If the magnetic flux is considered homogeneous on the surface of sensing coil , the induced voltage related to the i-th coil can be expressed as The position is estimated by minimizing the following cost function [29]: which represents the squared error between the induced voltage measured from sensor coil and the voltage ̃ obtained by applying (3); this latter depends on = [ T , , ] T , and on the vector of the currents . The minimum of (4), i.e. ̂= arg min ( , ), is obtained by using the Levenberg-Marquardt algorithm. For the details, see [29].

Experimental or simulation mode
The platform allows to control and perform both simulation and experimental tests.
Simulation mode -The aforementioned models allow to carry out experiments on a simulated environment, resulting in a valuable tool for EMTSs design. It is possible to define the FG and the sensor coil (Section 3.2), the position reconstruction algorithm (Section 3.3), and custom trajectories along which to move the sensor. Experimental mode -It is possible to define a trajectory, move the robot and acquire data from the Data Acquisition (DAQ) device. The 3D scene will show the real-time movement of the robot, along with the tracked position (the green dot in Figure 1). Hybrid mode -It is possible to import experimental data acquired during past experiments, and to run a simulation test showing the tracking results, also simulating the actual acquisition time of the related experiment.

Noise section
The voltage noise in the sensor signal highly affects tracking accuracy. Several error sources contribute to sensor voltage noise, and two main contributions can be considered (all noise components are intended as standard deviation of RMS quantities): i) the measurement and acquisition noise , and ii) the FG noise ( , )-The last one depends on the position of the sensor relative to the FG and is due to excitation current noise . The voltage noise can be expressed as: where it has been assumed that and both contribute independently. Note that • is approximately constant in the whole working volume, since it depends on the measurement devices and on the Johnson noise of the sensor. Experimentally, it has been measured ≅ 20 nV for each frequency component.
• depends on sensor pose and excitation currents, hence it is related to , and its contribution is higher when the sensor is closer to the FG. Moreover, can differ between each transmitting coil. Experimentally, it has been measured ≅ 0.07 mA as an average value among transmitting coils. In [29], a technique to compensate the effect of on the position error has been proposed. The effect of these noise components must be considered during simulations. Hence, the platform includes a section to set the noise components ( is a scalar, is a 1 vector), to be added in simulations and also during real-time experiments, to investigate how a certain source of error affects tracking accuracy. For instance, a discussion about the selection of the DAQ device depending on the noise is carried out in Section 4.1.

VALIDATION
The proposed platform is suitable for the assessment of virtual EMTSs during simulation, as well as the developed EMTS prototypes. In Sections 4.1 and 4.2 we employ the platform for a practical case, showing its usefulness in assisting engineers during EMTS design and characterization, and in Section 4.3 we illustrate some tests performed on the real EMTS.

DAQ device selection
The platform can support engineers during DAQ device selection by using the noise section described in Section 3.5. When setting up the measurement chain to acquire the signal form the sensor coil, it is important to select the DAQ device according to the accuracy requirements of the system. Frequency sampling and noise are two main parameters to be considered [20], which affect system accuracy. In particular, the noise floor indicated in the datasheet of the DAQ device is added to the induced voltage, thus it directly affects position repeatability and accuracy [20]. In this way, the choice of a low-noise DAQ device can be evaluated for the purpose of improving performance.
In this section, we performed some simulations: the RMS induced voltage was simulated by applying (3), then adding a voltage noise component to simulate the noise floor of the DAQ device. Figure 3 shows the results, where the mean of the Euclidean position error over a linear trajectory (101 points at 600 mm from the FG) is plotted versus a range of selected , considering a fixed current noise of = 0.07 mA. As expected, it can be observed an increasing error with acq ; moreover, the behaviour is quite linear. A mean Euclidean error below 2 mm is obtained if using a DAQ device with acq lower than 40 nV. This information could be particularly useful when choosing components, considering the trade-off between increased cost and required accuracy.

FG configuration optimization
As said in Section 3.2, the platform allows to test different FG configurations, to evaluate the influence of the number, arrangement, and electrical properties of the transmitting coils on system performance. In this Section we compare the performance of two FG configurations: one representing the EMTS prototype (Figure 1), and one flat FG composed of six coplanar transmitting coils ( Figure 4). The coils of the two configurations are identical in their geometrical and electrical parameters, except for their position and orientation in space. Figure 5 shows the position error along each axes, obtained by keeping the sensor with a fixed orientation along the z-axis, and moving it along the x-axis along a linear trajectory of 101 points, with a step of 1 mm, from point (x, y, z)=(-50, 0, 600) to (x, y, z)=(50, 0, 600), considering the reference system of the FGs. The RMS induced voltage was simulated by applying (3), assuming an acquisition frequency of 20 Hz. Current and voltage noise of = 0.07 mA and acq = 20 nV were added to each channel.
It can be noted higher accuracy in the 5-coils FG configuration, whereas the 6-coils FG exhibits higher position error, in particular along x-and y-axes. This suggests that further investigation should be performed to understand the cause of the error in that configuration, to avoid it during the realization of the FG.

Developed EMTS and experimental test
The results obtained from the simulations performed with the platform must be comparable with the ones obtained with an actual FG, in order to validate it effectiveness in assisting the system designers.
In collaboration with the company MASMEC Biomed (Modugno, Bari, Italy), an EMTS prototype was developed to obtain accurate estimation of sensor pose beyond 0.5 m from the FG, thus improving the state-of-the-art of commercial systems [20], [26], [27], [29].
It consists of three main components ( Figure 6): i. a magnetic field generator to generate EM signals (the same shown in Figure 1); ii.
a small EM sensor coil from Aurora system; iii.
a Control Unit for data acquisition and signal processing. The FG is composed of five transmitting coils, whose arrangement minimizes mutual inductances. Each coil is powered with a sinusoidal current at different frequencies (approximately from 1 to 5 kHz), thus generating an AC magnetic field, whose amplitude does not exceed 0.2 mT, which is the threshold value set in the IEEE Standard C95.1-2005. The whole magnetic flux generates an induced voltage on the EM sensor (to be inserted into the surgical instrument), which is acquired, digitalized, and filtered by means of five band-pass filters obtaining five RMS voltage components, related to the different excitation frequencies. These components are used to estimate sensor position by means of a suitable reconstruction algorithm.
Moreover, the current in each transmitting coil is measured by using five Hall effect sensors (LA 55-P -LEM), for the purpose of i) ensuring stability of the magnetic field by means of a current control loop, and ii) reducing error due to variations in the magnetic field, as shown in [29].
The control software was developed in LabVIEW ® , and the sensor was moved by means of an industrial robot (by Mitsubishi), which provided accurate position reference.
An experimental test was performed to show the potentialities of the proposed platform when tracking a real sensor coil. The EM sensor coil was moved by the robot along the trajectory defined in Section 4.2, and the RMS induced voltage was measured with a frequency of 20 Hz, as suitable for real-time surgical applications (the sampling frequency of the DAQ device is set to 50 kHz, with 2500 samples, thus computing the RMS value every 50 ms, i.e., 20 Hz [20]). The same trajectory was performed on both simulated and experimental data. For the simulation, = 0.07 mA and = 20 nV were considered for each channel, as quantified from the experimental data. Figure 7 shows the obtained results. The position error obtained in both simulated and experimental case are comparable, with a mean Euclidean position error of about 1 mm and 2 mm, respectively, which is suitable for many surgical procedures [12]. The difference is due to the approximation of the coils with magnetic dipoles, and to uncertainty in parameters. This result validates the performance of the platform in simulating real tracking, providing a valuable tool during system design and prototyping.

CONCLUSIONS
Several sources of error affect EMTSs, and the high accuracy required from surgical application is highly influenced by the design and arrangement of the transmitting coils of the FG. Many design errors can be quickly identified and avoided by realtime feedback. In this paper we illustrated the main features of a virtual platform, which permits to analyse system performance by adding noise components and simulating error sources, hence the robustness and the accuracy of the system and its weaknesses can be studied. Moreover, it can be particularly useful for system prototyping, by investigating the effects of system parameters (geometrical and electrical ones).
The usefulness of the platform was demonstrated by performing simulations related to some practical cases. Finally, it was validated by performing some tests on a real EMTS, obtaining a mean Euclidean position error of about 2 mm at a distance of 600 mm from the FG, comparable with the position error of 1 mm obtained by simulations, which is suitable for many surgical procedures.
Further development will regard an improved graphic and user interface, the inclusion of other sources of error (magnetic field distortion, EM interferences), as well as a dynamic system model, in order to evaluate position error in fast varying conditions; the Kalman filter will also implemented to obtain smooth trajectories. Moreover, in this first version, the algorithm is developed in Matlab, but other programming languages -e.g., Python-will be considered in further versions.