The program, Echo E-waves, is freely available for download at www.echoewaves.org [11]. It is implemented in the MATLAB® release 2015a (Mathworks, Natick, Massachusetts, USA) environment for Windows (64-or 32-bit architecture). In the following section we describe the structure and functionality of the program. For analysis of inter-and intraobserver variability, sets of E-waves with visually moderate to good quality were selected from 20 patients undergoing echocardiography as part of ongoing clinical studies on adults with acute myocardial infarction with or without obstructive coronary artery disease, and excluding patients with significant valvular disease. The studies were approved by the Regional Ethical Review Board in Stockholm, Sweden, and all subjects provided written informed consent. All echocardiographic acquisitions were performed on Vivid E9 scanners (GE, Horten, Norway). The Echo E-waves program was run on an Intel® Core i5™ 2500 K processor with a NVIDIA® GeForce® GTX 670 graphics card and the 64-bit version of Windows 7.
Echocardiographic image acquisition
The program can analyze PW Doppler echocardiographic images of transmitral flow acquired in the same manner as is recommended by clinical guidelines [12]. However, some adjustments are suggested to ensure improved accuracy in analysis. A horizontal sweep speed of 100 mm/s is recommended, as lower sweep speeds lead to a substantial loss of temporal resolution. A sweep speed of 150 mm/s or 200 mm/s is also acceptable. However, in our experience these sweep speeds make the visual recognition of the shape of the E-wave somewhat more difficult, since they are less commonly used clinically. The program currently reads DICOM images from GE, Philips, Siemens and Acuson systems. When using a GE or Philips system, the user can export a cine recording of Doppler data stretching over several screen widths as a single DICOM multi frame file. A method for this is described in on the program website (www.echoewaves.org). From all the systems above, single frame DICOM image files can also be loaded. For the purposes of testing the intra-and interobserver variability, 20 echocardiographic exams collected during ongoing clinical trials were selected. The exams were performed by four dedicated sonographers, all with at least 8 years of experience with clinical echocardiography. A 3.5 mm sample volume was placed at the tips of the mitral leaflets, and PW Doppler recordings were performed both during free breathing and after cessation of the Valsalva maneuver.
Loading and visualization of Doppler data from DICOM images
Using DICOM metadata, the Doppler region of the image is automatically identified and displayed with correct time and velocity scaling. For ease of overview, the contents of the folder are displayed as thumbnails in the Heartbeat Browser, also enabling navigation of the data set using mouse or keyboard input. Extended (cine) recordings of Doppler registrations from GE and Philips scanners are automatically cropped to one image per cardiac cycle. In order to facilitate the detection of the part of the Doppler signal constituting the E-wave, the user can change color maps, gain settings and apply contrast stretching. Currently, the program does not load the contents of folders with a mix of single frame and cine DICOM files. The graphical user interface is described in Fig. 1.
Detection of the velocity profile
In the data structure of a DICOM image, Doppler data is represented as a two dimensional matrix of numbers, with each matrix index corresponding to a velocity at a given point in time. In these images, the horizontal axis of the image is time in seconds, and the vertical axis is velocity in meters per second. The value at a given matrix index indicates the brightness of the pixel at the corresponding position in the image, and the brightness corresponds to the amount of blood travelling at that given velocity at that point in time. For the purpose of detecting the velocity profile, the program searches each column (i.e. each time point) of the image from the top down for the first pixel having a brightness higher than or equal to a user defined threshold level, matching each time point with a velocity. However, as the Doppler recording is susceptible to noise, and due to the presence of non E-wave signal, the algorithm has been optimized by taking into account pre-existing knowledge of how the velocity profile of the E-wave can be differentiated from Doppler signal not originating from the E-wave. For instance, velocity at the moment when flow is about to begin must be zero. Furthermore, we can assume that there must be an upper limit to the velocity difference between two time points a few milliseconds apart. The algorithm accordingly discards a detected velocity that differs too much from the previous velocity. Discarded velocities are displayed for reference and transparency as to the behavior of the algorithm.
The user can adjust the input to the curve fitting algorithm with regards to the time points along the horizontal axis of the Doppler image at which the detection algorithm starts and ends, as well as the threshold of Doppler signal intensity at which detection occurs. Notably, it is of great importance that the starting point is set accurately at the onset of flow, as a small deviation can lead to substantial differences in the constants resulting from curve fitting. In many cases, the exact position of the onset of flow can be difficult to ascertain visually at first glance. However, the velocity profile during the acceleration time is often quite distinct, and if close attention is paid to how different starting points affect the visual correspondence of the PDF curve to the underlying Doppler data of the acceleration time and the upper, often well defined part of the E-wave, a convincing position for the starting point can be identified in effectively all cases. Positioning of the end point must take into account the various non-E-wave Doppler signals that frequently occur during the deceleration phase. A good curve fit will often be achieved if the end point is set at approximately 75 % of the total E-wave duration and typically at less than 50 % of the maximum E-wave velocity. In the case of partial overlap of the E-and the A-wave, the user must examine the E-wave to see if it is of sufficient duration to determine where it would have ended had there been no overlap between the E-and the A-wave. Typically, this is not possible when the crossover point between the E-and the A-wave occurs at a velocity is above 50 % of the maximum velocity of the E-wave. The program contains no particular feature to guide the user in this process, but using the alternative method to curve fitting described below can often make the task easier. We recommend excluding E-waves from analysis when there is an overlap with the A-wave at greater than 50 % of the maximum velocity of the E-wave. To further increase the agreement between the final fitted curve and the E-wave portion of the Doppler signal, the program also has two options that will make the deceleration time of the fitted curve shorter. The rationale for this is that the various artifacts and non-E-wave blood flow signals during the deceleration phase usually have higher velocities than the true E-wave, and thus will prolong the deceleration time of the fitted curve if they are included. The first approach to alleviate this is to simply replace the final two detected velocities with the value zero. The second approach is to first fit a curve to the detected velocities, as described below, and then calculate the tangent at the time point where the velocity has decreased to 70 % of the maximum velocity. Extrapolating this tangent to the velocity baseline will form a close approximation of the line drawn in clinical echocardiography to mark the deceleration time. This straight line of velocities is then substituted for the velocities of the original fitted curve during the corresponding time frame, and this new set of velocities is then fitted again, producing a final curve with a shorter deceleration time. On a modern computer, these calculations are performed virtually instantaneously. By default, both approaches for making the deceleration time agree more with clinical practice are enabled. It should be noted that these two alterations of the curve fitting process, although having justifications in physiology (if the E-wave ends, its velocity must be zero at the end) and the nature of the Doppler acquisition (noise and non-E-wave signal during the deceleration time and diastasis), they are based on empirically determined parameters. In our experience, using them will lead to a faster and more intuitive curve fitting workflow, in that the sensitivity to the problems mentioned above will be reduced. These fitting settings should be viewed as improvements to speed of effectively obtaining a visually acceptable fit, and not as changes to the PDF model per se. If the user so chooses, they can be disabled individually.
Curve fitting and adjustment of the fitting algorithm input
The paired time-velocity data obtained during detection is used as input to a native curve fitting function of MATLAB, which employs the Levenberg-Marquardt algorithm, a standard algorithm for solving non-linear least square problems. After curve fitting, the constants c, k, and x0 are obtained with values that, when used as input to an expression of velocity as a function of time, would yield the closest match to the originally detected velocity profile. This calculated curve is displayed as an overlay to the original Doppler image, along with the result of the velocity profile detection algorithm for visual confirmation. After display of the fitted curve, the user can adjust the start and end points of the velocity profile detection time interval, as well as the threshold for detection, resulting in an automatic update of the fitted curve. These adjustments can be made by clicking and dragging with the mouse, or by using keyboard shortcuts. No measures of goodness of fit for the E-wave are displayed. Mathematically, the curve fitting process will produce an excellent fit in nearly all cases, and differences in e.g. sum of squared errors cannot be used to decide if an adjustment to a fit will result in a physiologically more accurate fit. Rather, we have found that visual assessment is the most reliable and useful method for assessing the appropriateness of a given fit.
Automatic detection and curve fitting
In order to facilitate curve fitting of data sets comprised of large numbers of E-waves, a semi-automatic algorithm for curve fitting several E-waves has been implemented. The user must first set the starting point and adjust the settings so that the first E-wave is fit in an acceptable manner. The program stores the part of the image corresponding to the start of this user-defined E-wave as a template. The template is then used to find the starting point of the E-wave on the subsequent images using normalized cross correlation. The velocity profile detection algorithm described above is then run from this starting time point to either 1/3 of a cardiac cycle, or to the time point where velocity has fallen below 35 % of the peak velocity of the E-wave. The detected velocities are used for curve fitting as described above. The resulting parameters are compared to the mean of the previously obtained parameters, and if any parameter of the current E-wave deviates more than 40 % from the mean of the previous, the program discards the fit and moves on to the next E-wave. Usage of this automated method can speed up analysis, however, it requires close scrutiny of the obtained results.
Quality control
In order to review produced results, and also facilitate the identification of anomalies, the results are displayed simultaneously in multiple fashions. The numerical values of the constants c, k, and x0 are displayed in a list, and the mean of the constants and the derived parameters are also displayed. Furthermore, the calculated curve for each E-wave is displayed in a graph, where each curve is selectable. Each E-wave is also displayed as a selectable marker in a plot of peak driving force vs. peak resistive force. Selecting an E-wave in any of these displays retrieves and displays the corresponding E-wave with its fitted curve, which can then be adjusted or deleted if the user so chooses.
Alternative method to curve fitting
It has been shown that the curves yielded by applying the mathematics of damped harmonic motion to Doppler E-wave velocity profiles can be fully described in terms of unique combinations of their acceleration and deceleration times and peak velocities [13]. In other words, each unique combination of the constants c, k, and x0 also has a unique combination of acceleration and deceleration time and peak velocity. As a consequence of this, the constants for an E-wave can be calculated if these two time intervals and the velocity are known. As an alternative to fitting the full data set of velocities, it is thus possible to use just these three measurements. In the program, this is implemented both as a primary way of producing a curve, and as a method for adjusting a previously obtained curve. The user can produce a curve by marking the start, peak velocity and end points. For any curve, regardless of if it was produced by curve fitting or this alternative method, the start, peak and end points are manually adjustable by dragging them with the mouse, enabling an easy user interface for adjusting the shape of the curve, which is updated in real time.
Export of data
All constants and derived parameters can be saved and exported to a spreadsheet. The Appendix details the mathematical calculations employed in the software for subsequent calculation of derived parameters. If Excel® is installed on the computer on which Echo E-waves is running, the results can be saved in.xlsx format, and otherwise in a comma separated values.txt format. Saving of images and graphs is also possible. It is also possible to copy the results to the computer’s memory clipboard and paste them into a program of choice. The program also stores the part of the DICOM images containing the Doppler data as well as any results of curve fitting and user interaction, so that images and/or curve fits for a given set of DICOM files can be retrieved, reviewed and/or edited at a later time. Saving in this manner also enables full optional anonymization, leaving the saved file without any trace of patient or source file identification. These data files are created in the native .mat format of MATLAB. When saving the results of an analyzed case, it also possible to designate a results folder, which will save all results to a common space, and also append each case to a file (.xlsx or.txt) with the means and standard deviations of all constants for each case, effectively creating a study database.
Statistical analysis
All statistical analyses were performed in MATLAB release 2015a (Mathworks, Natick, Massachusetts, USA). The basic PDF constants and the derived parameters were analyzed as mean values for each patient. The coefficient of variation (CV) for the difference between measurements, intraclass correlation coefficient, and percentage difference with standard deviation were calculated and presented as needed. The CV was calculated as the standard deviation of the mean differences between analyses divided by the mean and expressed as a percent. Durations of analysis and numbers of analyzed E-waves are reported as median and interquartile range (IQR).