1 Introduction

The outstanding capabilities of MRI for localization and robots for targeting pathologies can provide more possibilities for computational methods and MRI-guided interventions. The numerous advantages of imaging techniques can be combined with those of manipulator mechanisms. Practitioners will be able to perform more complicated and varied types of procedures. Surgical instruments can be tracked in real time, and the issue of tissue deflection during operations can be solved. The spatial constraints of high-resolution closed-bore MRI systems will be overcome by the development of robotic manipulators and sensors for surgical instrumentation [1]. However, these features require the development of a new generation of actuators that have high accuracy, great efficiency, and compatibility with MRI.

MRI is considered the best modality for detecting tumors [2]. Its excellent soft-tissue contrast avoids trauma to critical structures and facilitates tumor removal without ionizing radiation [3]. MRI has several advantages, including providing high-resolution, digitized 3D images, and a well-defined coordinate system. It is an ideal modality for real-time image-guided interventions because it provides precise, updated, and spatial information about the target tissue at any orientation with the ability to rapidly acquire a sequence of images [1].

Due to the ultrahigh magnetic field (3 Tesla and above), MRI imposes various limitations on the tools and materials that can be used. The field impedes the precise control of electromechanical movements [4]. Conventional robotics cannot be applied in the magnetic resonance (MR) environment, nor can ferromagnetic materials due to the high magnetic attraction forces and heat. These materials and tools generate detrimental imaging artifacts when they are placed in close proximity to the imager, and they may cause robot signal distortions [2]. These artifacts are sufficient to degrade the image quality, thus limiting the use in therapeutic medicine. Avoiding the interference between these tools and the MRI system is a difficult task, especially when the system is in active motion.

Additionally, few “off-the-shelf” actuators are available that can be safely used in the vicinity of an MRI instrument without an effect on their operation or degradation of the image quality [4].

The above-mentioned reasons limit the type of actuators that can be utilized in the vicinity of the scanner to four types: ultrasonic, hydraulic, pneumatic, and remote-manual actuators [5]. Hydraulic systems are incompatible due to the risk of leakage in the highly restricted area of the operation room, which requires sterility [2]. Pneumatic systems are decoupled from electromagnetism and thus do not affect MR images; however, they lack precise controllability, have a slow response time, and require a brake to stop the system in emergency conditions. Remote-manual actuators have lengthy procedures. Currently, patients must be removed from the scanner; then, the preoperative image is used as a roadmap to generate and place fiducial markers. Thereafter, the patient must be rescanned to validate the marker locations [6]. When MR contrast agents are employed, a lengthy procedure is an issue because the agents that are used to identify lesions have a short lifetime of 10 min [7].

Even though pneumatic and hydraulic systems address a few of these compatibility issues, they cannot provide the numerous advantages of ultrasonic motors (USMs). USMs are the most promising actuators despite the fact that they may interfere with the scanner. The small size of USMs overcomes the patient accessibility issues of cylindrical, closed-bore MRI systems. USMs also have the advantage of precise controllability, a high torque/size ratio, a short response time, and instant stopping by powering off the motor. Unlike electromagnetic motors, USMs are not driven by magnetism. Instead, USMs operate based on the vibrational modes generated in the piezoelectric materials of the stator; traveling waves produced in the stator move the rotor located on the top through frictional forces [8].

USMs can be utilized as effective actuators to perform surgeries safely with high precision and full controllability. However, USMs interact with MRI systems and they distort MR images. To address compatibility issues, USMs were kept at a distance (at least 50 cm) from an MR scanner [6]. Therefore, the behavior of USMs in MRI systems must be enhanced to provide engineering solutions to improve the design of these actuators, reduce their interactions, and achieve the desired level of MRI compatibility and image quality [4]. The strong capabilities of USMs can be retained and enhancements can be made to address USMs’ compatibility issues. This can lead to safer operation of USMs in high field MRI and enable practitioners to accurately and safely operate surgical tools.

The aim of this research is to quantify and compensate the geometric distortion of MR images as generated by the presence of USMs. The problem considered in this study is as follows: the presence of the USM induces a geometrical distortion in MR images that causes the displacement of the displayed points relative to their actual locations and improper scaling of the distance between any points within the image. These displacements result in the misplacement of an actuated needle or drill in tissue and reduces the accuracy of the robot.

2 Methods

The internal and external magnetic flux densities are calculated inside and outside a sphere respectively within a homogeneous field by using Laplace’s equation and by applying boundary conditions [9]. The shift from the ideal to actual excited slices (Δy) can be calculated from these equations inside (Δy i ) and outside (Δy e ) the sphere as follows:

$$ {y}_i=\frac{2}{3}\ \Delta \chi \frac{B_0}{G_y},\kern0.75em y\le R $$
(1a)
$$ \Delta {y}_e=\frac{\Delta \chi}{3}\ \frac{B_0}{G_y}{R}^3\frac{2{z}^2-{x}^2- y{\hbox{'}}^2}{{\left({x}^2+ y{\hbox{'}}^2+{z}^2\right)}^{5/2}},\kern0.5em y\ge R $$
(1b)

where Δχ = μ e  − μ i (μ e and μ i are the external and internal relative permeabilities, respectively, of the spherical object), R is the sphere radius, B 0 is the intensity of static field, and G y is the magnitude of gradient field in the y direction. As Eq. 1b is an implicit equation, the maximum shift is calculated for |z| = R as follows [9]:

$$ {\left(\Delta {y}_e\right)}_{max}=\frac{\Delta \chi}{3}\ \frac{B_0}{G_y} $$
(2)

If the motor is modeled by an aluminum or brass sphere of 45 mm diameter, the maximum slice shift can be calculated using Eq. 2, as follows:

$$ {B}_0=3\ T,{G}_y=40\frac{ m T}{m}; $$

Inner material: for aluminum,χ i  = 2.2 × 10−5 and for brass, χ i  = 2.2 × 10−4

Outer material (air): χ e  = 0;

y e |max is 1.1 and 11 mm for aluminum and brass, respectively.

Linear distortion can be characterized by measuring the curvature of distortion. A reference image is obtained with a profile similar to that of a chessboard, with equally spaced vertical and horizontal lines. For this purpose, a grid phantom was designed and implemented to cover the maximum possible field of view. The phantom was placed within a 32-channel Philips head coil (Philips Healthcare, Best, the Netherlands); it was large enough to evaluate all image artifacts induced by the motor, and it had equally spaced horizontal and vertical lines for the grids [10]. The structure had a cylindrical form (Fig. 1) with the following characteristics: height of 15 cm, outer/inner diameters of 12.5/11.5 cm, bottom thickness of 5 mm, grid type of square with 2-cm sides, gap between the grids of 2 mm, lid thickness of 5 mm, and material of Nylon 12.

Fig. 1
figure 1

a The grid phantom, b the phantom lid

The largest distortion (l) was computed by calculating the distance between the farthest point on the line on the distorted image and the corresponding point on the reference image. The distortion was described as the l/L ratio in percentage, where L is the length of the undistorted line [11]. To quantify the distortion, l and the root mean square (RMS) values of the distances between the reference and distorted points were used in this article.

The reference images were obtained by imaging the phantom in the absence the motor. These images were compared with the images of the phantom when the motor was present. Three motor orientations (x, y, and z) exist with respect to the bore: the x orientation is when the motor shaft is parallel to the patient table and perpendicular to the bore axis, the y orientation is when the motor shaft is perpendicular to the patient table, and the z orientation is when the shaft is parallel to the bore axis. Two motor states (on and off) were evaluated. The geometric distortions of the grids were visually assessed by comparing the distorted images and their corresponding reference images.

2.1 Image specifications

A 3.0 Tesla scanner (Achieva, Philips Medical Systems, Best, the Netherlands) was used, and the phantom was placed in the 32-channel head coil (Philips) to receive full-strength signals. Conventional clinical pulse sequences, including T1-weighted spin echo (T1W) and T2-weighted turbo spin echo (T2W), were employed in two orientations, transverse (axial) and coronal (parallel to the patient bed). The scan parameters were as follows:

  • T1W: echo time (TE) = 10 ms, repetition time (TR) = 0.60 s, field of view (FOV) = 125 × 125 × 125 mm, in-plane voxel size =1 mm, slice thickness =5 mm, and flip angle =70°.

  • T2W: TE = 80 ms, TR = 3 s, FOV = 125 × 125 × 135 mm, in-plane voxel size =1 mm, slice thickness =5 mm, flip angle =90°.

2.2 Distortion measurement

Two types of algorithms were developed using MATLAB 2013b to detect and calculate the geometric distortions. In both algorithms, the horizontal lines of the distorted images were detected and compared with their corresponding reference lines for all motor configurations.

2.2.1 Thresholding algorithm

This algorithm was based on a threshold value of the image intensity that was used to detect the grid lines. Various thresholding values were tested to find the optimum one. After the image was segmented, the horizontal lines were extracted, and the distorted lines were compared with their reference to find the RMS and maximum distortion. The thresholding algorithm was as follows:

figure d

2.2.2 Edge detection algorithm

To overcome the difficulty of thresholding and avoid the detection of other artifacts (e.g., signal pileups), an edge detection algorithm was developed in MATLAB. This algorithm was based on the detection of the edges of horizontal lines, the selection of an upper edge or lower edge, and a calculation of the distortion (Fig. 2). In this method, the distortion was calculated as the vertical distance between the maximum and minimum of the selected points of the distorted line. The distortion was assumed to be nonsignificant at both ends of the detected edge; therefore, the edge points were mostly as assumed to be the minimum points and used as the reference (Fig. 2). However, this algorithm has the limitation of incorrect edge detection. Thus, the detected edge in each image was visually plotted and validated. The edge detection algorithm is as follows:

Fig. 2
figure 2

Detecting the lower edge of the horizontal grid using the edge detection algorithm

2.3 Compensation methods

2.3.1 Compensating by developing the mapping transformation matrix

Two approaches can be used to reduce geometric distortion: one at the source (motor) and one at the target (image). The solution at the source includes improving the motor design, encoder type, and shielding structure or designing a new MRI receiver coil specifically for the motor, whereas the solution at the target includes software development. A solution at the source can remove all types of motor-induced artifacts, including geometric distortions. The solution at the target is preferred when a geometric distortion is involved for the following reasons:

  • Easy to control the MR sequence specifications

  • Easy to develop a program to compensate for distortion, e.g., using MATLAB

  • Well-established and well-known conventional image processing solutions have previously been used to address the problem

  • Much more effective solution and less complexity is involved

One approach for removing geometric distortion is to develop a transformation matrix to map the distorted points of the image back to their proper locations. We have developed a transformation matrix using MATLAB for one distorted line in the image of the grid phantom. A comprehensive transformation could be derived by expanding the algorithm to all grid lines by combining the transformations of each individual line for each slice. However, the complexity of such an algorithm is high, leading to an increase in the scan time. Additionally, providing the matrix with an accepted clinical standard requires a large number of tissue imaging experiments. Additionally, the images sometimes include other types of artifacts besides geometric distortion, and fixing the geometric distortion would be useless without removing the other artifacts. Additionally, this method is feasible, and many compensation methods can be adopted from established image processing methods, which are referred to as “unwarping” [12]. Developing such an algorithm requires knowledge of other facts, such as the complexity of the distorted image due to SNR degradation when the motor is present, and requires minimizing the time needed for image post processing to save clinical time and facilitate real-time interventions.

2.3.2 Compensation through control of the pulse sequences

Three artifact reduction methods were employed: sequence selection, slice thickness reductions, and bandwidth increments [13, 14]. To understand the effect of these factors on the geometric distortions, geometric distortions were quantified using four sequences (T1W, T2W, turbo spin echo (TSE), and fast field echo (FFE) with the following properties:

  • T1W: TE = 10 ms, TR = 0.60 s, FOV = 160 × 160 × 150 mm, in-plane voxel size =1 mm, slice thickness =5 mm, and flip angle =70°.

  • T2W: TE = 80 ms, TR = 3 s, FOV = 160 × 160 × 150 mm, in-plane voxel size =1 mm, slice thickness =5 mm, flip angle =90°.

  • TSE: TE = 72 ms, TR = 4 s, FOV = 160 × 160 × 150 mm, in-plane voxel size =1 mm, slice thickness =5 mm, flip angle =90°.

  • FFE: TE = 2.8 ms, TR = 12.1 ms, FOV = 160 × 160 × 150 mm, in-plane voxel size =1 mm, slice thickness =5 mm, and flip angle =30°.

The same parameters were used to compare the effects of the sequences. These sequence parameters included the slice thickness, BW, number of signals averaged (NSA; =1), and turbo factor (=1). The effects of TH reduction and BW increments were compared. For the y orientation of the motor, three slice thicknesses (5, 3, and 1 mm) with two BWs (437 and 875 Hz) were tested.

In this comparison, the distortion ratios were measured using a DICOM viewer (RadiAnt DICOM Viewer, version 2.2.9; Meixant, Poznan, Poland) for images that were collected with the minimum and maximum bandwidth and for the three slice thicknesses, 5, 3, and 1 mm.

3 Results

Geometric distortions were observed in all motor orientations. Figure 3 shows three orientations of the motor in the MRI scanner. The distortion was less when the motor was in the z orientation was greater when the motor was in the x or y orientation. The geometric distortion of the powered motor (“on”) was not detectable. The motor was tested at three speeds: 25, 75, and 95% of the maximum speed. However, nonsignificant distortions were observed in all cases.

Fig. 3
figure 3

Three orientations of the motor in the MRI scanner

The thresholding algorithm was applied, as shown in Fig. 4, to the third slice of the T1W transverse image of the reference (a) and the corresponding selected center line of the grid (b). The figure compares all configurations (y (c), z (e), and x (g)) with their corresponding center lines (b, d, f, and h) in the “off” state. Figure 4 (g) shows the geometric distortion when the motor was “on.” Although the zipper artifacts appear in the image when the motor is on, the geometric distortion remains unaffected. The center line, along with one line above and one line below the center, was considered in this algorithm because of the significant distortions compared with those of the other lines.

Fig. 4
figure 4

Geometric distortion of the motor orientations with the corresponding center line that was selected by the thresholding algorithm. The thresholding algorithm was applied to the third slice of the T1W transverse image of the reference (a) and the corresponding selected center line of the grid (b). The figure compares all configurations (y (c), z (e), and x (g)) with their corresponding center lines (d, f, and h)

The RMS and maximum distortion were measured in pixels. The maximum distortion was defined as the maximum distance (in pixels) between the corresponding points on the reference and distorted lines. The distortion is greater when an image slice is closer to the motor. However, in image slices that are very close the motor, image artifacts other than geometric distortion, such as signal voids, may be present. Figure 5 illustrates the root mean square (RMS) and maximum distortion (max dist) values calculated for T1- and T2-weighted sequences for transverse images of the third slice. The values are for three horizontal lines of the phantom: the center line (line 0), one line above the center line (line +1), and one line below the center line (line −1). The x, y, and z orientations of the motor inside the bore are each represented. Figure 5 displays the distortion measurements for the third slice showing the maximum geometric distortion without the presence of signal voids. In the transverse images, the center of the phantom image was close to the motor. Consequently, greater distortion was observed and calculated for the three center lines of the phantom. Figure 6 illustrates the root mean square (RMS) and maximum distortion (max dist) values calculated for T1- and T2-weighted sequences for the coronal images of slices 8–10, which had the highest distortions of the grid phantom. The values are for two horizontal lines of the phantom: the bottom line (first line) and one line above the bottom line (second line). The x, y, and z orientations of the motor inside the bore are each represented. Figure 6 displays the measurements for the images that are closer to the motor and have greater distortion than other slices. In the coronal images, the bottom of the phantom image was close to the motor. Thus, greater distortion was observed and calculated for the two bottom lines of the phantom.

Fig. 5
figure 5

The root mean square (RMS) and maximum distortion (max dist) values for T1- and T2-weighted sequences for transverse images of the third slice. The values are for three horizontal lines of the phantom: the center line (line 0), one line above the center line (line +1), and one line below the center line (line −1). The x, y, and z orientations of the motor inside the bore are each represented

Fig. 6
figure 6

The root mean square (RMS) and maximum distortion (max dist) values calculated for T1- and T2-weighted sequences for the coronal images of slices 8–10, which had the highest distortions of the grid phantom. The values are for two horizontal lines of the phantom: the bottom line (first line) and one line above the bottom line (second line). The x, y, and z orientations of the motor inside the bore are each represented

3.1 Compensation of geometric distortions

Table 1 shows the distortion ratio for four sequences, three slice thicknesses, and two bandwidths. In the six tested sequences, the selection of sequence did not affect the size of the geometric distortions. The reduction in slice thickness also did not affect the distortion size. However, the depth over which the distortions were present was reduced by decreases in the slice thickness. Slice thickness reduction may result in SNR degradation. When TH reached 1 mm in the FFE sequence, the SNR was too low to measure the geometric distortions. Bandwidth increments reduced the geometric distortions. Doubling the BW resulted in a 50% reduction in the distortion in most of the cases.

Table 1 BW impact on geometric distortion

4 Discussions

The degree of distortion is not uniform and varies with the radial distance between the imaging position and the motor location. However, distortion can be approximated linearly. Distortion occurs in the phase-encoding direction due to the dephasing of spins. Because the motor shifted the frequency of spins to higher values in the frequency-encoding direction, upward distortion was observed in the images (refer to Fig. 2). The presence of distortions is due to the static field inhomogeneity caused by the metallic parts used in the motor case, stator ring, and encoder. The observed geometric distortions were found only in the frequency-encoding direction [15].

Distortion was minimal when the motor was in the z orientation. In this case, the motor was located in a symmetrical configuration with respect to the MRI fields. Therefore, the distortion of the field lines was less than that of the other configurations. Conversely, the other orientations showed material distortion due to nonsymmetrical orientation of the motor with respect to the magnetic fields, resulting in the appearance of substantial geometrical distortion.

The vertical distance between the grids was 2 cm, corresponding to 20 pixels in the MR image. Therefore, the maximum error caused by distortion would be ten pixels with a tolerance of one pixel, corresponding to a 1-cm error at a distance of 2.5 cm from the motor. This error is significant, especially when targeting a sample using a needle/drill during surgical intervention. Moreover, this value causes a distortion ratio of 8.5%, which is beyond the acceptable level of 5% for medical display distortion [10]. The theoretical value for geometric distortion in the y direction is 1.1 and 11 mm for aluminum and brass, respectively. The experimental value of 1 cm is found to be consistent with the theoretical value. One of the reasons for the theoretical value being slightly lower than the experimental value is the assumptions in writing the formula. Bandwidth was assumed to be zero so that the slice thickness becomes zero. However, in reality, the slice thickness cannot be zero.

The desired spatial accuracy for geometric distortions is at least 2% [10]. The distortion level is enhanced to approximately two pixels by maximizing the bandwidth (Table 1), corresponding to a distortion ratio of 1.7% on average, which is equal to a 2-mm error in locating a position in the true dimension. This value is within the acceptable level for a medical display distortion. Therefore, the motor can safely and precisely operate approximately 6 cm away of isocenter.

5 Conclusion

Geometric distortion appears in slices close to the motor. Using two developed algorithms (thresholding and edge detection), the maximum distortion was evaluated to be ten pixels, which corresponds to a distortion ratio of 8.5% and beyond the acceptable level of 5% for a medical display distortion. Safer USM operation in the high-field MR environment can be achieved by minimizing geometric distortion. Doubling the BW resulted in a 50% reduction in the distortion. The distortion level is enhanced to approximately two pixels by maximizing the bandwidth. This value is within the acceptable level for a medical display distortion. These findings are theoretically and practically important because it is not necessary to keep the USMs at a distance from the MR scanner to address compatibility issues, as recommended in most research literatures to mitigate USM compatibility issues. Therefore, the USMs can be preferred alternative because the USMs have high precision in controllability that play a magnificent role in actuating MRI-compatible surgical robots and because accurate targeting of pathologies can occur in free distorted images.