Introduction

Electromagnetic tracking systems (EMTS) have become more widely applied in clinical settings, such as supporting radiation therapy [1], computer tomography and ultrasound-guided interventions [2, 3]. EMTS register the position and orientation (pose) of the tracker tool relative to the pre-scanned patient anatomy [4]. The small size magnetic sensor can be mounted into medical instruments such as needles and catheters [5]. The non-line-of-sight operation of EMTS makes it advantageous in particular tracking applications, such as movement of a flexible instrument within the patient’s body [6]. To provide adequate tracking information and meet safety requirements, accuracy is one most significant issue for medical EMTS [7]. However, various error sources can negatively influence the tracking accuracy.

The jitter errors of EMTS increase when the working volume becomes larger [8] which limits the volume of interest (VOI) for accurate tracking. Unavoidable metallic objects in the OR, such as surgical instruments proximate to the sensor coil, cause significant errors in estimated sensor pose [9]. Errors in the measurement of mechanically predefined poses of the transmitter coils also reduce the tracking accuracy [10]. For supporting instrument tracking in IGS, the coordinate system of the EMTS should be registered with the pre-scanned patient anatomy, introducing registration error [11]. The stationary and moving metallic material and electronic devices located in proximity to the sensor coil cause additional tracking error. Moreover, considering the dynamic performance of EMTS, the sensor velocity becomes another source of error. It is difficult to separate all these sources of error in evaluating the tracking accuracy in reality [4]. However, different sources of errors can be easily separated and individually analyzed by using the simulator.

In evaluating the tracking accuracy, groups have proposed different assessment protocols. Reference positioning systems are commonly utilized [8, 12,13,14,15,16]. Test phantom-based assessments in evaluating EMTS tracking accuracy are suggested in the literature [8, 14, 15]. Precisely pre-bored holes in different directions with certain depths provide reference positions where the EM sensor can be manually inserted. More quantitative measurements are not always possible with such phantom-based evaluations. Another simple and low-cost way is to use modular bricks from LEGO (The LEGO Group, Denmark). Different volumetric structure can be freely built for various measurements [16, 17]. Significant errors can exist in the manually built LEGO towers. 3D robotic coordinate measuring machines [18] and three-axis robots have high volumetric accuracy. For such evaluations, the sensor coil was fixed on a robot arm and moved in the measurement volume to multiple locations [13]. These robot-based tracking systems normally serve in a large volume, and the arm movement can be freely programmed. However, the metallic structure could negatively influence on the tracker accuracy. Compared to EMTS, which usually require a less than 2 mm positioning error in estimated sensor pose, optical tracking systems (OTS) have a much higher accuracy of than EMTS [18], which can be utilized as reference positioning systems to access the tracker accuracy of EMTS [12]. For the methods introduced above, tracking errors of some magnitude always exist in the reference positioning systems. In this work, an EMTS simulator was developed to provide the exact locations of the sensor as ground truth.

As referred in [4], commercial EMTS have different field generator comprising multiple transmitter coils. However, the spatial arrangement of the transmitter coils is confidential for the manufacturers. EMTS with various shape of field generators have different accuracy [19]. In scientific papers [20, 21], the standard coil arrangement was given without being optimized. This work presents the evaluation of tracking accuracy according to different transmitter coil arrangements and the corresponding optimization solutions based on self-developed simulation software for EMTS. The simulator allows statistical analysis to be performed without difficulties in separating sources of error, difficulties in construction or large time consumption.

Background theory

EM tracking

EMTS have commonly multiple transmitter coils and at least one sensor coil [22]. In this work, we focus on five-degree-of-freedom (5-DOF) EMTS generally applied in assisting IGS. To simulate the generated magnetic field, magnetic dipole approximation is utilized [23], to simplify the computational processes and increase the tracking speed. The calculation of magnetic field flux density is given by (1):

$$\begin{aligned} \begin{aligned} \overrightarrow{B_{i}}=&\frac{\mu }{4\pi }\left( \frac{\left( 3\left( \overrightarrow{x_{s}}-\overrightarrow{r_{t,i}}\right) \cdot \left( \overrightarrow{m_{t,i}}\cdot \left( \overrightarrow{x_{s}}-\overrightarrow{r_{t,i}}\right) \right) \right) }{|\overrightarrow{x_{s}}-\overrightarrow{r_{t,i}}|^{5}} \right. \\&\left. -\frac{\overrightarrow{m_{t,i}}}{|\overrightarrow{x_{s}}-\overrightarrow{r_{t,i}}|^{3}}\right) \end{aligned} \end{aligned}$$
(1)

where \(\mu \) is the coil’s magnetic permeability, \(\overrightarrow{x_{s}}=\left( \begin{array}{c}X_{s}\\ Y_{s}\\ Z_{s}\end{array}\right) \) is the position of the sensor coil and \(\overrightarrow{r_{t,i}}=\left( \begin{array}{c}X_{t,i}\\ Y_{t,i}\\ Z_{t,i}\end{array}\right) \) is the position of the i-th transmitter coil toward XY and Z direction in the 3D Cartesian coordinate system of the magnetic field. \(\overrightarrow{m_{t,i}}\) is the magnetic dipole moment which can be calculated using (2):

$$\begin{aligned} \overrightarrow{m_{t,i}}=\pi \cdot N_{t,i}\cdot I_{t,i} \cdot R_{t,i}^2 \cdot \overrightarrow{r_{t,i}} \cdot \left( \begin{array}{c}\sin \varTheta _{t,i}\cos \varPhi _{t,i}\\ \sin \varTheta _{t,i}\sin \varPhi _{t,i}\\ \cos \varTheta _{t,i}\end{array}\right) \end{aligned}$$
(2)

where \(N_{t,i}\) represents the turns of the windings, \(I_{t,i}\) is the current flow, \(R_{t,i}\) is the radius, and \(\varPhi _{t,i}\) and \(\varTheta _{t,i}\) are the yaw and pitch Euler angles of the i-th transmitter coil. Knowing the magnetic field flux density and the parameters of the transmitter and sensor coil, the voltage induced in the sensor coil can be calculated using (3).

$$\begin{aligned} U_{\mathrm{est},i}=\omega \cdot A_{s}\cdot N_{s} \cdot \overrightarrow{B_{i}} \cdot \left( \begin{array}{c}\sin \varTheta _{s}\cos \varPhi {s}\\ \sin \varTheta _{s}\sin \varPhi {s}\\ \cos \varTheta _{s}\end{array}\right) \end{aligned}$$
(3)

where, \(\omega \) is the angular frequency of the generated AC magnetic field, \(A_{s}\) is the cross-sectional area of the sensor coil, and \(N_{s}\) is the number of the turns of the sensor coil. It should be noted that, generally, the amplitude of the voltage is proportional to the frequency. However, in reality, this is valid just for a certain frequency bandwidth, defined by the restricted bandwidth of the applied amplifiers and low-pass filters of the circuits. Furthermore, the inductance of the coils also influences the range of the bandwidth, considering the self-resonance. The pitch and yaw angles of the sensor are represented by \(\varPhi _{s}\) and \(\varTheta _{s}\). Optimization algorithms such as Levenberg–Marquardt algorithm [24] can determine the nonlinear parameters of sensor pose. The objective function is presented by (4).

$$\begin{aligned} F(X_{s},Y_{s},Z_{s},\varPhi _{s},\varTheta _{s})=\sum _{i=1}^k(U_{\mathrm{mea},i}-U_{\mathrm{est},i})^2 \end{aligned}$$
(4)

Here, k represents the number of the transmitter coils, which should be equal or greater than 5 in order to estimate the five variables.

Fig. 1
figure 1

Estimated 5-DOF sensor pose; \(X_{s}\), \(Y_{s}\), \(Z_{s}\) present the estimated sensor location in 3D Cartesian coordinate systems while \(\varPhi _{s}\) and \(\varTheta _{s}\) present the yaw and pitch Euler angles

The arrangement of the transmitter coils in Fig. 1 is an example of a typical EMTS. Different coil arrangements have been proposed by research groups [20,21,22] regarding overall accuracy, minimum space occupied by all coils, and placement on a 2D plane, respectively. In our experiments, we focused on arranging the transmitter coils in one plane within a small box [10].

Calibration of the measurement errors in transmitter coils’ poses

Human-eye-based measurement of the transmitter coil positions and orientations is very error-prone, thus strongly degrading the tracking accuracy of EMTS. Bien et al. developed a calibration method to compensate the pose errors of the transmitter coils using an optimization algorithm as described in [10]. Assuming the deviations of the transmitter coils’ poses are \(\triangle X_{t,i}\), \(\triangle Y_{t,i}\), \(\triangle Z_{t,i}\), \(\triangle \varPhi _{t,i}\) and \(\triangle \varTheta _{(t,i)}\), the real locations and the orientations of the transmitter coils are given by Eqs. (5) and (6).

$$\begin{aligned} \overrightarrow{r_{t,i}}= & {} \left( \begin{array}{c}X_{t,i}+\triangle X_{t,i}\\ Y_{t,i}+\triangle Y_{t,i}\\ Z_{t,i}+\triangle Z_{t,i}\end{array}\right) \end{aligned}$$
(5)
$$\begin{aligned} \overrightarrow{n_{i}}= & {} \left( \begin{array}{c}\sin (\varTheta _{t,i}+\triangle \varTheta _{t,i}) \cos (\varPhi _{t,i}+\triangle \varPhi _{t,i})\\ \sin (\varTheta _{t,i}+\triangle \varTheta _{t,i}) \sin (\varPhi _{t,i}+\triangle \varPhi _{t,i})\\ \cos (\varTheta _{t,i}+\triangle \varTheta _{t,i})\end{array}\right) \end{aligned}$$
(6)

Firstly, a certain number of pose measurements of the randomly positioned sensing coil must be performed. For each position, the induced currents in the testing coil by all sending coils were recorded, and the true position was detected by an additional optical tracking system. The optimization procedure was about finding best deviations \(\triangle X_{t,i}\), \(\triangle Y_{t,i}\), \(\triangle Z_{t,i}\), \(\triangle \varPhi _{t,i}\) and \(\triangle \varTheta _{t,i}\), which cause identical EMTS’ sensor position estimates as given by the optical system.

Fig. 2
figure 2

The flow chart of the developed EMTS simulator

Kalman filtering

Kalman filter is widely applied in different tracking modalities to improve the accuracy [25, 26]. In EM tracking, the noises in the estimated sensor pose are typically assumed as Gaussian noise [4]. In principle, Kalman filter can be applied to reduce the jitter errors. For catheter tracking in medical applications, the constant velocity movement model was proposed [27]. The system state vector is defined as \(x_{k}=\left( \begin{array}{c}X_{s},Y_{s},Z_{s},\varPhi _{s},\varTheta _{s}\\ \dot{X_{s}},\dot{Y_{s}},\dot{Z_{s}},\dot{\varPhi _{s}},\dot{\varTheta _{s}}\end{array}\right) \) including the sensor poses, linear and angular velocities. In this work, we have implemented the Kalman filter into the simulator and evaluated its performance without considering the localization errors due to the measurement setups.

Method and materials

The simulator

In this work, an EMTS simulator was developed to simulate the entire system flow based on the general AC EM tracking concept [10, 20, 21]. In practice, to evaluate the tracking accuracy, the reference poses of the sensor coil are provided by another positioning system. The actual sensor positions cannot be guaranteed since the measurement error always exists. This issue can be perfectly solved using the simulator, in which the ground truth of sensor pose can be predefined. Based on the real sensor pose, inversely, the voltage induced in the sensor coil can be calculated as the “measured” voltages. In reality, noises in voltage measurement and errors in the reference positioning systems always exist, while in the simulator artificial noise signals can be selectively added or wholly excluded. Figure 2 shows the workflow of the developed EMTS simulator.

After the program starts, we firstly defined the poses of the transmitter coils and the starting pose of the sensor coil. Errors in the transmitter coils’ poses can be added. The sensor can be fixed at one location or moved following the implemented movement models for statistical analysis. Each transmitter coil is activated sequentially to generate magnetic fields. The voltages induced in each transmitter coil are estimated. Noise signals can be added into the voltages of each channel individually. After acquiring the voltages induced by eight transmitter coils, the sensor’s pose was estimated by utilizing the ‘fsolve’ function in MATLAB (Mathworks, USA). The tracking accuracy, influenced by the transmitter coils’ arrangement with standard noises in measured voltages, was evaluated.

Accuracy assessment of simulations

In this work, the testing volume was chosen to be \(500 \times 500 \times \ 500\,\mathrm{mm} \) because this it is reported to be a typical volume of interest (VOI) for medical applications. The starting position of the coil was \(\left( \begin{array}{c} -250\,\mathrm{mm} \\ -250\,\mathrm{mm} \\ \ \ 50\,\mathrm{mm} \end{array}\right) \). Considering the height of the transmitter coils, the sensor coil was initially moved \(50\,\mathrm{mm} \) away from the origin in the Z direction. After the measurement began, the sensor coil was moved in the X direction with a step size of 50mm for 11 steps. For each X location the sensor was additionally moved in the Y direction with the same step distance, resulting in 121 positions for one XY plane. In the next step, the sensor was moved 100 mm in the Z direction before repeating the scanning within the XY plane. In total we analyzed 6 layers, each at 121 locations, resulting in 726 poses of the sensor coil. The starting orientation of the sensor was selected to be \(\left( \begin{array}{c} -180{^{\circ }} \\ -180{^{\circ }}\end{array}\right) \), with the increasing step for each location being \(360{^{\circ }} \div 726 = 0.4959{^{\circ }}\). After one complete measurement, the position and orientation of the sensor were increased to \(\left( \begin{array}{c} 250\,\mathrm{mm} \\ 250\,\mathrm{mm} \\ \ 50\,\mathrm{mm}\end{array}\right) \) and \(\left( \begin{array}{c} 180{^{\circ }} \\ 180{^{\circ }}\end{array}\right) \). The defined reference positions and orientations of the sensor coil within the simulator are presented by Fig. 3.

Fig. 3
figure 3

The reference positions and orientations of the sensor coil defined within the simulator

A simple noise model, additive Gaussian white noise (AGWN), has been added to the “measured” voltages. For particular systems, different noise levels or noise models can be assumed. In this work, the noise level was selected to be \(-100\) dBW as a standard, for all the scenarios. The sensor pose error calculation is given by (7) and (8):

$$\begin{aligned} E_{p,j}= & {} \sqrt{(X_{m,j}{-}X_{r,j})^2{+}(Y_{m,j}-Y_{r,j})^2{+}(Z_{m,j}{-}Z_{r,j})^2}\nonumber \\ \end{aligned}$$
(7)
$$\begin{aligned} E_{o,j}= & {} |\varPhi _{m,j}-\varPhi _{r,j}|+|\varTheta _{m,j}-\varTheta _{r,j}| \end{aligned}$$
(8)

where j illustrates the sensor coil placed in j different locations. The sensor reference poses are \(X_{r,j}\), \(Y_{r,j}\), \(Z_{r,j}\) and \(\varPhi _{r,j}\), \(\varTheta _{r,j}\) and the calculated sensor poses are \(X_{m,j}\), \(Y_{m,j}\), \(Z_{m,j}\) and \(\varPhi _{m,j}\), \(\varTheta _{m,j}\) By using the EMTS simulator, the reference sensor pose is defined directly in the software as ground truth.

Optimizing of the transmitter coils’ spatial arrangement

The signal quality, represented by the signal to noise ratio (SNR) of the measured voltages, influences the tracking accuracy [28]. As seen in Eqs. (13), the poses of the transmitter coils and the sensor coil affect the amplitude of the voltages induced by the transmitter coils. The aim is to find the maximum of the measured mean voltage \(U_{\mathrm{mean}}\) for all the testing points by changing the spatial arrangement of the transmitter coils. MATLAB “patternsearch” function was selected to realize this optimization process. In this application, the objective function to be optimized is chosen to be the absolute value of the reciprocal of the mean voltage, which is given by Eq. (9):

$$\begin{aligned} F_{1}=\left| \frac{1}{U_{\mathrm{mean}}}\right| \end{aligned}$$
(9)

Herein, 726 positions of the sensor coil were chosen, and at each position, the sensor coil was vertically faced to the XY, XZ and YZ planes individually. Therefore \(726 \times 3=2178\) sensor poses were used. The vector coils’ arrangement to be optimized is defined as an \(8 \times 5\) matrix, as Eq. (10) presents:

$$\begin{aligned} \triangle x= \begin{bmatrix}\triangle X_{1}&\triangle Y_{1}&\triangle Z_{1}&\triangle \varPhi _{1}&\triangle \varTheta _{1} \\ \triangle X_{2}&\triangle Y_{2}&\triangle Z_{2}&\triangle \varPhi _{2}&\triangle \varTheta _{2} \\ .&.&.&.&. \\.&.&.&.&.\\ \triangle X_{8}&\triangle Y_{8}&\triangle Z_{8}&\triangle \varPhi _{8}&\triangle \varTheta _{8} \end{bmatrix} \end{aligned}$$
(10)
Fig. 4
figure 4

The stochastically defined position and orientation of the eight transmitter coils: a single-plane-single-orientation, the standard transmitter coil arrangement, in one XY plane with one orientation for all the coils, b single-plane-multi-orientation, the transmitter coils with multiple orientations in one XY plane, e single-orientation and around the volume of interest (VOI), f multi-orientation and around VOI. The optimized transmitter coils’ pose based on searching for the maximum voltage (c) in a box volume and (g) in a full 3D space, based on minimizing the sensor position error. And the optimized transmitter coils’ pose based on searching for the minimum positional RMSE (d) in a box volume and (h) in a full 3D space, based on minimizing the sensor position error. The scale along the axis is 100 mm

Selecting the initial poses of the transmitter coils is important for the “patternsearch” algorithm because according to the manufacturer’s instructions,Footnote 1 “patternsearch” can find the local minimum. We firstly performed the optimization by choosing initial poses of the transmitter coils within a standard box volume which are similar to the planar field generators of commercial products, as shown in Fig. 4b. For this approach, there are three other preconditions for the optimization. First, the transmitter coils should be placed out of the testing volume. Second, the coils should be positioned at different locations, with a minimum spacing to allow them to be mechanically separated. The calculation of the minimum distance is given by (11).

$$\begin{aligned} L_{\mathrm{min}}=\sqrt{R_{t}^2+\left( \frac{D_{t}}{2}\right) ^2} \end{aligned}$$
(11)

where \(R_{t}\) is the radius and \(D_{t}\) is the height of the transmitter coils. The third precondition is that the boundaries of the searching vector for the pattern search algorithm should be set within a box volume, i.e., the upper boundary of Z distance is selected to be smaller than \(70\,\mathrm{mm} \) which is similar to the commercial products. After that, we performed another optimization by removing the boundary limitation into consideration. Therefore, the optimization was performed in a pure 3D volume.

After performing the optimization by searching the maximum of the voltages across the magnetic sensor, we chose the minimum RMSE of the positional accuracy as the optimization target. For this approach, the function to be optimized is given by Eq. (12):

$$\begin{aligned} F_{2}=\sqrt{\frac{\sum _{i=1}^n E_{p,i}^2}{n}} \end{aligned}$$
(12)

Here, \(E_{p,i}\) is the sensor position error at each point in the test volume. The optimizations were performed twice similar to searching the maximum voltage. The results have been compared and discussed in the following sections.

Experiment and evaluation

Accuracy according to differences in spatial arrangement of transmitter coils

In this experiment, the transmitters coils were chosen with the material being copper, the radius of 15 mm, the height of \(30\,\mathrm{mm} \), and 200 turns of windings. The field generators (FG) of commercial EMTS generally have a small size, e.g. NDI Aurora Planar FG (Northern Digital, Canada) is \(200 \times 200 \times \ 70\,\mathrm{mm} \) in length, width and height respectively. According to this, we defined different poses of the transmitter coils in the simulator to analyze the influences on the tracking accuracy caused by coil arrangement. Figure 4 shows the poses of the transmitter coils and Table 1 shows the detailed spatial arrangement of the coils.

In Fig. 4, the yellow cylinders present the transmitter and sensor coils, respectively. We firstly positioned the transmitter coils within such 3D area with a standard arrangement with all the coil faced toward one orientation, as Fig. 4a shows. After that, in Fig. 4b, each coil was added with multiple \(20^\circ \) and \(30^\circ \) in yaw and pitch angle shift. In Fig. 4e the transmitter coils were located around the VOI with the same orientation, and in Fig. 4f, the transmitter coils were positioned around the VOI with multiple orientations. These poses of the transmitter coils are stochastically defined. After that, the optimized transmitters’ poses were applied.

Table 1 The transmitter coils’ arrangement with the IDs from a to h according to Fig. 4

For each scenario, the tracking accuracy was evaluated. This experiment aims to analyze the influence of the different transmitter coil arrangements on the tracking accuracy.

Testing the performance of the calibration algorithm

In this experiment, we used a standard spatial arrangement of the transmitter coils, i.e., single-plane-multi-orientation, as Fig. 4b illustrates because it is a most conventional planar field generator without optimization. Here, a random shift in position, between \(-0.5 \) and \(0.5\,\mathrm{mm} \), and in orientation, between \(-0.5{^{\circ }}\) and \(0.5{^{\circ }}\), are added to each transmitter coils. Table 2 shows the shifts being added to eight transmitter coils. MATLAB ‘rand’ function is used for random number generation. In this evaluation, the generated random shift of the transmitter coils’ poses is illustrated in Table 2.

Table 2 The added shift to each of the transmitter coils
Fig. 5
figure 5

The plot of sensor position error according to coil arrangement introduced in Fig. 4

To investigate the robustness of the method, the evaluation of the performance of the calibration was also done using the random shifts as specified Table 2 increased by a factor of 10 and 100, i,e, the deviations were in the range of 0.5, 5 and \(50\,\mathrm{mm} \) in position shift, and \(0.5{^{\circ }}\), \(5{^{\circ }}\) and \(50{^{\circ }}\) in the orientation shift. In this evaluation, first, no noise signals were added into the measured voltages. Only the influences due to the change in transmitter coils’ poses were considered. After that, \(-100\) and \(-80\) dBW noise signals were introduced in the measured voltages to simulate the real-world scenario. The testing volume was the same as defined in evaluation A.

Considering the \(50\,\mathrm{mm} |{^{\circ }}\) measurement error as the worst case, we also performed an experiment to estimate the minimum samples required for the successful calibration process. In this experiment, we selected between 50 and 726 measured sensor poses to perform the calibration.

Testing the performance of the Kalman filtering

In this experiment, we also selected the transmitter coils’ arrangement as Fig. 4b presents. A \(-100\) dBW and AGWN was introduced as well as experiment A. In order to evaluate the dynamic performance of Kalman filter, the sensor coil was moved in the simulator from \(\left( \begin{array}{c}0\,\mathrm{mm}\\ 0\,\mathrm{mm}\\ 350\,\mathrm{mm}\end{array}\right) \) to \(\left( \begin{array}{c}100\,\mathrm{mm}\\ 200\,\mathrm{mm}\\ 650\,\mathrm{mm}\end{array}\right) \) at the velocity of \(\left( \begin{array}{c}1\,\mathrm{mm/s}\\ 2\,\mathrm{mm/s}\\ 3\,\mathrm{mm/s}\end{array}\right) \), toward X, Y and Z directions. The angular velocity of the sensor coil of \(\left( \begin{array}{c}1^\circ /\mathrm{s}\\ 2^\circ /\mathrm{s}\\ \end{array}\right) \) starting from \(\left( \begin{array}{c}-180^\circ \ 180^\circ \ \\ \end{array}\right) \) to \(\left( \begin{array}{c}-80^\circ \\ \ \ 20^\circ \ \\ \end{array}\right) \). The sensor movement and the pose estimation is synchronized in the simulator by fixing the sampling rate to be 1 Hz. In total, 100 sensor poses were measured in this experiment.

Results

Accuracy according to differences in spatial arrangement of transmitter coils

The changes in the transmitter coils’ arrangement also lead to variations in the tracking accuracy. The tracking errors corresponding to different transmitter coils’ arrangement were evaluated and shown in Figs. 5 and 6.

Fig. 6
figure 6

The plot of sensor orientation error according to coil arrangement introduced in Fig. 4

As introduced by Figs. 5 and 6, when the coils are facing to one direction, even at lower layers, significant orientation errors exist. Compared to the results for other scenarios, both position and orientation error are much greater. The tracking accuracy is increased by placing the planar transmitter coils with multiple orientations as (b) and (f) illustrate.

By placing the coils around the VOI, the tracking accuracy is significantly improved compared to placing the coils in a planner area. Multiple orientations of the transmitter coils also benefit from the improvement of tracking accuracy. As (g) and (h) show, after being optimized in a 3D space, the accuracy is further improved. The detailed description of the tracking accuracy is indicated by Table 2. In Figs. 5 and 6, there were no significant differences between both optimization methods.

The performance of the calibration algorithm

The measurement errors of the transmitter coils’ positions and orientations were reduced to approximately to 0 for the 3 scenarios. Figure 7 shows the result of cumulative errors of the transmitter coils’ positions and orientations after calibration.

Fig. 7
figure 7

The change in transmitter coils pose errors during the calibration process: a, d without noise included, b, e with \(-100\) dBW and c, f with \(-80\) dBW Gaussian white noise added in the measured voltages

As Fig. 7a presents, when there are no noise signals introduced, the calibration algorithm corrects the measurement errors well. The difference is that with larger errors, the calibration algorithm needs more iterations to proceed. After being calibrated, the total errors of the transmitters have all being reduced to a very small value in both position and orientation. As (b), (c), (e) and (f) illustrate, the calibration becomes worse in the presence of noises in the measured voltages. This is because—as long as the number of measurements is not infinite,—the noise provides contradictory data and therefore no exact solution in terms of transmitter coils’ arrangement exists. Another reason is that the adaptation algorithm may run into local minimum.

Fig. 8
figure 8

The transmitter coils’ accumulative a position errors and b orientation errors change during the calibration process with the number of poses for the calibration algorithm being selected between 50 and 726 with the error range of \(50\,\mathrm{mm}|^\circ \)

As presented in Fig. 8, the calibration algorithm of correcting transmitter coils measurement errors requires a certain amount of sensor locations. When less than 100 points were applied, the calibration algorithm cannot rectify the measurement errors.

Testing the performance of the Kalman filtering

The result of evaluating the dynamic Kalman filter performance with is shown in Fig. 8. The tracking errors increase when the Z distances between sensor and transmitter coils become larger. After applying Kalman filter, the pose errors were reduced to a much lower level.

Fig. 9
figure 9

Evaluation of the dynamic Kalman Filter performance in EM tracking. a 3D scatter plot of non-filtered, filtered and ground truth of the sensor positions, b and c present the sensor’s position and orientation errors being reduced after applying Kalman Filter

Figure 9b, c show the improvement in tracking accuracy by employing Kalman filter. The RMS errors before filtering are \(5.28\,\mathrm{mm} \) and \(5.51^\circ \), which have been reduced to \(0.82\,\mathrm{mm} \) and \(0.69^\circ \) after being filtered.

Discussion and future work

We present a method of developing a simulator which allows advanced analysis in EMTS. The main drawback of the dipole approximation is it cannot be utilized in the regions too close to the dipole [29]. Therefore, in this work, the VOI for all the experiments was chosen with a minimum Z distance of \(50\,\mathrm{mm} \) away from the origin XY plane. It is similar to the realities where generally the field generator is placed some distance away from the VOI for surgical applications. The simulator allows the analysis to be conducted in a virtual world where all the unavoidable errors and uncertainties can be removed or separately considered. In this work, the tracking errors caused by the Gaussian white noise in the measured voltages and the inaccuracy in the measured transmitter coils’ arrangement were separately analyzed. The noise level was fixed at \(-100\) dBW. It can also be adjusted to simulate the real systems, if the noise level has been previously measured. Another important parameter for simulating the real system is the frequency of the excitation signals. As introduced in “EM Tracking” section, the signal’s frequency is proportional to the voltage induced in the sensor coil in a certain bandwidth. Thus, with the same noise level, a higher signal frequency provides a higher SNR.

In this work, the parameter selection was based on our self-developed experimental setup [10]. The amplitude and frequency of the generated sine-wave signals for the transmitter coils were 1V and 1 kHz as a standard. In the previous work on the real system, the sensor positional mean error was measured to be 6.9 and 2.15 mm before and after the calibration. The calibration algorithm cannot further reduce the tracking error because of the existing noises, registration errors, and the tracking errors of the OTS itself, etc. In this work, the sources of errors have been separately analyzed. For a comparison between the simulated result and our experimental setup, we adjusted the parameters in the simulator, to let them exactly match our system by changing the poses, radius, and turns of the coils. The testing volume was also redefined to be \(240\,\mathrm{mm} \times 240\,\mathrm{mm} \times 180\,\mathrm{mm}\), which is the same as the testing volume for our EMTS prototype. When only considering the noise, the mean positional error was \(0.16\,\mathrm{mm} \); when only considering the shift in the transmitter coils’ arrangement, the mean positional error was evaluated to be \(5.24\,\mathrm{mm} \). After being calibrated, the tracking error was reduced to be less than 0.01 mm without considering the noise and other uncertainties. The simulator can also be applied to allow a comprehensive comparison between the simulation and any other real systems and performing tests without always requiring the hardware.

Table 3 The tracking errors of the 726 sensor poses due to different spatial arrangement of the transmitter coils

The developed simulator provides a framework for simulating the entire EMTS. It also allows other sources of errors, such as the conductive distortions caused by metallic materials in medical instruments and devices in operating rooms, to be implemented for more advanced analysis in the future. However, the implementation of ferromagnetic distortions could be more challenging, because of the nonlinearity of the magnetic susceptibility of ferromagnetic materials [30].

To assess the tracking accuracy, in this work, a standard testing volume of \(500 \times 500 \times \ 500\,\mathrm{mm}^{3} \) was chosen. The testing volume and sensor pose can be customized within the simulator, allowing the simulations of real tracking applications.

This work focuses on the analysis of a typical 5-DOF medical EMTS in assisting IGS. Most commercial EMTS utilize a planar field generator [4]. For a typical 5-DOF EMTS, at least five transmitter coils are required for “solving” the 5-DOF parameters. The additional coils provide more comprehensive information for the optimization algorithm. For the real systems, eight transmitter coils are commonly applied [20, 21, 30]. Therefore, this number was also chosen in this work to let the simulator be adaptable for other setups and enable customization. For comparison, we firstly compared the tracking accuracy with all the transmitter coils placed in a planar field generator. The result shows that when the coils are faced in a single orientation, the system has the worst accuracy. Accuracy is improved by applying multiple coil orientations and further enhanced by the optimized transmitter coil arrangement to get the largest voltages across the sensor coil. Placing the transmitter coils around the VOI improved the tracking accuracy to a high level. The optimization of the coil arrangement further improved the tracking accuracy.

The comparison between using the different objective functions for the optimization algorithm is presented in Table 3. The results illustrate that choosing the sensor position RMSE as the objective function let the system have an even better accuracy. In the box-area, the both optimized coil arrangement can be easily applied in reality. However, as shown in Fig. 4h, the optimized transmitter coils are not symmetric to each other in a 3D VOI, which may add complexities in the construction process. In this work, the objective functions were defined to either maximize the induced mean voltages or minimize the positional RMSE of the sensor coil within the defined testing volume. In the future, more parameters can also be selected for the optimizations. For example, in some applications where orientations errors need to be focused, a more advanced objective function also considering the sensor orientation errors needs to be defined.

The calibration algorithm for correction of the measurement errors of the transmitter coils’ poses was evaluated by using the simulator without considering noises, errors of the reference positioning system and other uncertainties from the real world. The results show that the algorithm itself works correctly without noises. When noises were introduced in the voltage measurement, the calibration algorithm cannot perfectly correct measurement errors in the transmitter coils’ pose. The performance of Kalman filtering has also been tested based on the simulator. The result shows that applying Kalman filter is promising to enlarge the actual working volume. However, the Kalman filter solely reduces the sensor jitter errors caused by the noises. The actual tracking accuracy (correctness) cannot be improved by applying Kalman filter. In the future work, more complex noise models can be selected to perform a systematic analysis to evaluate the performance of Kalman filter in EM tracking.

The proposed simulator can also be applied to analyze other system parameters and testing new applications in electromagnetic tracking, before trying them on a real system setup. It removes the uncertainties from the reality and can be applied to speeding up developing new technologies. In addition, the simulator can also be adapted to 6-DOF tracking system by adding an additional sensor coil with a fixed pose to the first sensor coil [31]. It will allow the rotation angle to be estimated.

Conclusion

Various sources of errors influence the accuracy of electromagnetic tracking systems. A real-world system does not allow the sources of errors to be analyzed individually. Therefore, we developed software to simulate the entire electromagnetic tracking system. The ground truths of the sensor coils’ position and orientation can always be known within the simulator. System parameters such as noise level and transmitter coil poses can also be separately adjusted in the simulator. In this work, the optimization of the transmitter coil arrangement and the comparisons of tracking accuracy according to different transmitter coil poses were performed. The results show that the EMTS is more accurate when the transmitter coils are placed around the VOI in an optimized layout. The results also indicate that the calibration algorithm can correct the measurement errors of the transmitter coils’ poses. The Kalman filter is promising to enlarge the working volume of electromagnetic tracking systems. The developed simulator also supports other analysis in general EM tracking.