The electrocardiogram (ECG) is the state-of-the-art signal for gating in cardiovascular magnetic resonance (CMR) imaging where it is used to reduce cardiac motion artifacts . When the ECG signal is acquired during a magnetic resonance imaging (MRI) examination, it is superimposed by interfering signals caused by the magnetohydrodynamic (MHD) effect, radio-frequency (RF) pulses and fast switching gradient magnetic fields . RF-pulses and fast switching gradient magnetic fields are required during MR image acquisition. RF-pulses can be reduced with hardware shielding or lowpass filtering, because its frequency range (> 42 MHz) is separated from the ECG’s frequency range (0.05–100 Hz). The gradient magnetic fields cause severe distortions of the ECG signal due to the voltages induced in the body and the ECG electrode cables . Without further preprocessing, these gradient induced distortions will cause a significant drop of the QRS detection quality.
Different algorithms for the reduction of gradient artifacts exist in the literature. These algorithms are based on adaptive filter techniques , , , on bayesian filters  and independent component analysis (ICA) . Some of these filter techniques used additional information from the MR scanner , ,  to reduce the MR induced artifacts. Other filter could only be used for semi-online filtering  or needed learning and update periodes of the demixing matrix for ICA  what presents a potential error source.
In this work, the gradient induced artifacts were reduced using the Wilcoxon filter. This approach was applied to ECG signals during the imaging process without additional information from the MR scanner in real-time.
The Wilcoxon filter is a special case of a rankfilter, which is used for noise reduction in image processing . Further, this filter approach can also be applied to digital signal processing problems. If X is a rank sorted vector and part of a signal with N elements and written as X = [x1, x2, …, xN], the Wilcoxon filter is defined in ,  as:
The term is well known as Walsh average . The Wilcoxon filter is effective to white noise reduction and edges or slopes were not preserved because of the averaging of all possible pairs . Calculating the Walsh average for all the pairs causes problems in computational complexity because N(N+1)/2 values have to be sorted. The number of computations of the Walsh averages can be reduced using the inherent property of the Wilcoxon filter presented in . As presented in  all computed Walsh averages can be written in a matrix what is exemplary done for N = 5 as follows:
Thus, the median is calculated from 3 instead of 15 elements. The computational complexity was reduced from N(N+1)/2 to (N+1)/2 . As shown in , this simplification can be applied for a larger filter lengths.
3 Material and methods
For the evaluation of the presented method, a database (DBSkyra) was composed from several ECG records acquired in a 3 T MR-scanner (MAGNETOM Skyra, Siemens, Germany). The database consists of ECG signals (lead II, electrode distance: 10 cm) recorded in a reduced Einthoven triangle (the distance between the electrodes was minimized) placed on the left chest with braided cables to reduce the MHD effect and induced voltage due to the fast switching gradients . Because of the age relation of the young subjects and the ensuring location of the electrical heart axis, lead II shows the highest R-Peak amplitudes . The ECG signals were acquired using an MR-compatible ECG recorder based on the technology of the patient monitoring system Tesla M3 (MIPM GmbH, Mammendorf, Germany). The analogue low-pass filtered (7.2 kHz) ECG signal was digitized with sampling frequency of 16 kHz and a resolution of 24 bit. The ECG recorder was placed on the subject’s abdomen. The raw ECG signals were transmitted via optical fiber to the computer system placed outside the MRI cabin.
The ECG signals were recorded from 14 healthy subjects (nine males and five females, V1 − V14) at the age of 23.42 ± 4.9 years. The subjects had an average weight of 74.4 ± 12.7 kg together with an average height of 178.1 ± 9.7 cm. For the evaluation a set of the following MR sequences was chosen: fluid attenuated inversion recovery (FLAIR), T2-weighted turbo spin echo (T2TSE), gradient echo cardiac (GRE Cardiac), gradient echo (GRE), echo planar 2D diffusion (EP2DDiff) and a spin echo (SE). The duration of each sequence together with the repetition time (TR) and the echo time (TE) is presented in Table 1. The MR sequences were applied in the presented order. Between two sequences a break of 20 s was done. During this break the ECG signal was still recorded. DBSkyra had a length of 90 min.
3.2 Filter algorithm
Figure 1A depicts an exemplary ECG signal during an EPI sequence. Due to the structure of the EPI it represents a worst-case scenario (see Figure 1B). Besides short impulse shaped artifacts (e.g. Figure 1B at 0.2 s), a longer series impulses with a length of total length 0.08 s can be observed (e.g. Figure 1(B) at 0.03–0.11 s). To deal with these differently shaped artifacts, the algorithm was applied in a sliding window of 10 ms length (160 samples) with a step width of 0.0625 ms (1 sample). The window length of 10 ms showed best results for the chosen MR sequences. The ECG samples of 10 ms were first sorted by size and then their Walsh averages were calculated. After that the median of the Walsh averages was computed (see eq. 1). To estimate the current sample of the filtered ECG signal (Yi), the vector of the unfiltered ECG signal (Xi) consists of the current sample and the last 159 Samples. The computational complexity was reduced by using the inherent property of the Wilcoxon filter presented in .
After applying the Wilcoxon-based gradient artifact filter (Figure. 1C), the ECG signal was bandpass filtered with a 45 Hz low-pass (5th order elliptic filter) and a 0.05 Hz high-pass (3th order elliptic filter) filter to smooth the ECG and to reduce baseline wander Figure 1D.
3.3 Evaluation metrics
To evaluate the filter results the mean square error (MSE) was used for comparing the ECG without gradient induced artifacts before s(n) and after ŝ(n) applying the presented filter approach because of the known reference ECG. The MSE is defined as follows:
The filter algorithm reduces the power of the ECG superimposed by the gradient artifacts . Hence, the difference of the ECG signal before and after applying the filter approach can show the functionality of the algorithm. The average power of a discrete signal is defined as:
The average power of the gradient artifact free ECG (Ps) was calculated from the first 10 s of each signal. The ratio between the average power of the ECG signal during MR sequences (Psa) and the filtered ECG (Psaf) is defined as:
To show only the functionality of the presented gradient filter, the last filter step depicted in 1 (D) was not involved in the evaluation. Psaf was calculated before this filter step.
The MSE computed from the gradient artifact free ECG before and after filtering together with the average power and the power ratio defined in 3.3 for the 14 volunteers (V1–V14) are summarized in Table 2.
The MSE values range from 0.011–0.200 μV2 what show a low change in the ECG quality using the presented filter approach. The average power Ps ranges from 0.13–1.60 μV2 for each dataset. The average power Psa shows much higher values (19.52–234.76 μV2) than Ps due to the existing gradient induced artifacts. After filtering, the average power was reduced (0.19–1.58 μV2) and showed results which are in a similar range as Ps.
The Wilcoxon filter was applied to reduce the gradient artifacts in the ECG signal of lead II in real-time.
A low MSE was observed between the original (gradient artifact free) ECG and the Wilcoxon filtered ECG. Further filter steps like low-pass filtering of the artifact free ECG can improve the results of the MSE and the Ps, e.g. noise reduction by A/D-converter. One reason is the efficiency of the filter for noise reduction caused by the determination of the Walsh average . Another effect of the used filter approach is the nonpreserving of the edges. The slope, e.g. of the QRS-complex, was reduced what finally reduces the average power. A positive effect of the Wilcoxon filter is the reduction of pulse shaped artifacts what can be clearly shown in the comparison of Figure 1 A and C. The fact that edges are not preserved have an additional positive effect, too.
Due to the parameters of the ECG recorder and the possibility to record the gradient induced artifact in its full range of amplitude, the average power of the ECG is much higher than presented in . One reason might be the high resolution of the presented ECG hardware. The amplitude of the MR induced artifact is not limited and can be shown in its full amplitude range. This results in a higher signal power.
The use of the Wilcoxon filter was possible due to the high sampling frequency and the high resolution of the ECG signal and the induced gradient artifacts because of the well presentation of the artifacts as high frequency peaks. A low sampling frequency as well as a low resolution would distort the ECG artifacts. As a result of that the high frequency peaks are missing and the median based filter can not be applied successfully.
In future works, the algorithm will be tested using ECG signals recorded in other MRI scanners with different static magnetic fields. In addition. ECG leads I and III have to be evaluated to show the efficiency of the presented gradient filter on different leads.
Research funding: Marcus Schmidt and Johannes W. Krug are funded by the Federal Ministry for Economic Affairs and Energy (BMWi, Germany) under grant number KF3172301JL3. Conflict of interest: Authors state no conflict of interest. Informed consent: Informed consent has been obtained from all individuals included in this study. Ethical approval: The research related to human use complies with all the relevant national regulations, institutional policies and was performed in accordance with the tenets of the Helsinki Declaration, and has been approved by the authors’ institutional review board or equivalent committee.
Scott AD, Keegan J, Firmin DN. Motion in Cardiovascular MR Imaging. Radiology. 2009;250:331–51. Google Scholar
Felblinger J, Slotboom J, Kreis R, Jung B, Boesch C. Restoration of electrophysiological signals distorted by inductive effects of magnetic field gradients during MR sequences. J Magn Reson Med. 1999;41:715–21. Google Scholar
Laudon MK, Webster JG, Frayne R, Grist TM. Minimizing interference from magnetic resonance imagers during electrocardiography. IEEE Trans on Biomed Eng. 1998;45:160–4. Google Scholar
Abächerli R, Pasquier C, Odille F, Felblinger J. Suppression of mr gradient artifacts on electrophysiological signals based on an adaptive real-time filter with lms coeffcient updates. J Magn Reson Imaging. 2005;18:41–50. Google Scholar
Park HD, Jang BR, Cho SP, Kim HJ, Choi KH, Lee KJ. Minimizing MR gradient and RF pulse artifacts on ECG signals for MRI gating based on an adaptive real-time digital filter. IFMBE. 2007;14:1127–30. Google Scholar
Abi-Abdallah D, Drochon A, Robin V, Fokapu O. Cardiac and respiratory MRI gating using combined wavelet sub-band decomposition and adaptive filtering. Ann Biomed Eng. 2007;35:733–43. Google Scholar
Oster J, Pietquin O, Kraemer M, Felblinger J. Bayesian framework for artefact reduction on ECG in MRI. ICASSP. 2010;35:489–92. Google Scholar
Oster J, Pietquin O, Abächerli R, Kraemer M, Felblinger J. Independent component analysis-based artefact reduction: application to the electrocardiogram for improved magnetic resonance imaging triggering. Physiol Meas. 2009;30:1381–97. Google Scholar
Crinon RJ. The Wilcoxon filter: a robust filtering scheme. Proc ICASSP. 1985;10:668–71. Google Scholar
Pintas I, Venetsanopoulos AN. Nonlinear digital filters. 1st ed. New York: Springer Science + Business Media; 1990. Google Scholar
Song J, Kassam SA. Nonlinear filters based on generalized ranks for edge preserving smoothing. Proc IEEE Symp Circ Sys. 1986;401–4. Google Scholar
Dümbgen L. Einführung in die Statistik. 1st ed. Birkhäuser; 2016. Google Scholar
Lee JH, Kao JS. A fast algorithm for two-dimensional Wilcoxon filtering. Proc IEEE Symp Circ Sys. 1987;268–71. Google Scholar
Wendt RE, Rokey R, Vick GW, Johnston DL. Electrocardiographic gating and monitoring in NMR imaging. J Magn Reson Imaging. 1988;6:89–95. Google Scholar
Vijay Raghawa Rao BN. Clinical Examination in Cardiology. 1st ed. New Delhi: Elsevier; 2007. Google Scholar
About the article
Published Online: 2016-09-30
Published in Print: 2016-09-01
Citation Information: Current Directions in Biomedical Engineering, Volume 2, Issue 1, Pages 175–178, ISSN (Online) 2364-5504, DOI: https://doi.org/10.1515/cdbme-2016-0040.
©2016 Marcus Schmidt et al., licensee De Gruyter.. This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License. BY-NC-ND 4.0