65
Rapport 88 Pre-studies for automatic wall-searching program Förstudier till automatiskt väggsökningsprogram Thesis work by Annika Grandell Tove Gustavi Institutionen för elektronik KTH Enheten för medicinsk teknik Institutionen för medicinsk laboratorievetenskap & teknik KI Stockholm 2001 KAROLINSKA INSTITUTET

Pre-studies for automatic wall-searching program ...130.237.83.53/Kurshemsidor/Examensarbeten/Avslutade exjobb/2000... · great amount of theory is reviewed both in the medical area

Embed Size (px)

Citation preview

Rapport 88

Pre-studies for automaticwall-searching program

Förstudier till automatiskt väggsökningsprogram

Thesis work byAnnika Grandell

Tove Gustavi

Institutionen för elektronikKTH

Enheten för medicinsk teknikInstitutionen för medicinsk

laboratorievetenskap & teknikKI

Stockholm 2001

KAROLINSKAINSTITUTET

2

ABSTRACT

This work is the start of a larger project aiming to locate the inside of the heartwall in ultrasound images. It is mainly the location of the walls of the leftventricle that is of interest, since this will give an indication of the pumpfunction of the heart. The goal is an investigation to see if three specific pointsare enough to make a curve that approximates the heart wall. The three pointsare the apex and the two points where the AV plane and the heart wall crosses.

Before describing the development of the detection of these three points, agreat amount of theory is reviewed both in the medical area and in the imageprocessing area.

Since ultrasound images are very noisy, much effort was made in trying toimprove the images at hand. Relatively easy image processing methods werethen used to select points that lay on edges. By combining this informationwith the fact that the apex is relatively still and that the AV plane hasmovement in certain parts of the heart cycle, the apex and the AV plane couldbe detected. To find the crossings between the AV plane and the heart wallfurther treatment of the original image had to be done.

The resulting methods have proven to be quite stable and can be used infurther developments. It is also seen that approximating a parabola to the threepoints and combining this curve with the AV plane will be a good startingpoint for the automatic detection of the entire heart wall.

3

SAMMANFATTNING

Detta arbete är början på ett större projekt, som siktar på att detektera helainsidan av hjärtväggen i ultraljudsbilder. Det är huvudsakligen vänsterkammares väggar som är intressanta eftersom det kan ge en indikation påhjärtats pumpfunktion. Målet med arbetet är att se om tre specifika punkter ärtillräckliga för att anpassa en kurva som approximerar hjärtväggen. De trepunkterna är apex samt de två punkterna som uppstår i korsningen mellan AVplanet och hjärtväggen.

Inför utvecklingen av detektionen av dessa tre punkter behandlas en stor delteori, både inom det medicinsk tekniska området och inom bildbehandling.

Eftersom ultraljudsbilder är väldigt brusiga lades mycket tid ned på att försökaförbättra de aktuella bilderna. Relativt enkla bildbehandlingsmetoder användesför att plocka ut punkter, som låg på kanter. Genom att kombinera dennainformation med det faktum att apex ligger relativt stilla under en hjärtcykeloch att AV planet rör sig i vissa lägen i hjärtcykeln kunde apex och AV planetdetekteras. För att hitta korsningen mellan AV planet och hjärtväggenbehövdes ytterligare behandling av originalbilderna.

De resulterande metoderna har visat sig vara ganska stabila och kan användasför vidare utveckling. Det visas också att genom att approximera en parabel tillde tre punkterna och kombinera parabeln med AV planet kan man få ett brautgångsläge för automatisk detektering av hela hjärtväggen.

4

ACKNOWLEDGEMENTS

We would like to thank all the people that have helped us in our work;professor Håkan Elmqvist and the personnel at the division of medicalengineering and persons connected to Vingmed.

We would especially like to thank:

Our supervisor Lars-Åke Brodin for the interest he has taken in our work.

Britta Lind for the help acquiring ultrasound images.

Camilla Storaa for the help during the project and for the proof-reading of thereport.

Anders Torp, who always found time to help us with everything related toimage processing.

5

TABLE OF CONTENTS

Abstract_______________________________________________________ 2

Sammanfattning________________________________________________ 3

Acknowledgements______________________________________________ 4

Table of contents _______________________________________________ 5

1 Introduction _______________________________________________ 7

2 Theoretical background______________________________________ 8

2.1 The anatomy and physiology of the heart___________________ 8

2.2 Ultrasound ____________________________________________ 92.2.1 General information on ultrasound ________________________ 92.2.2 Propagation of the ultrasound beam _______________________ 92.2.3 Interaction with matter ________________________________ 102.2.4 Generation of ultrasound_______________________________ 102.2.5 Resolution __________________________________________ 112.2.6 Artefacts and disturbances _____________________________ 12

2.3 Acquiring images _____________________________________ 142.3.1 A-mode ____________________________________________ 142.3.2 B-mode ____________________________________________ 142.3.3 M-mode____________________________________________ 142.3.4 TGC_______________________________________________ 15

2.4 The use of Doppler information__________________________ 152.4.1 The Doppler effect ___________________________________ 152.4.2 Continuous Doppler __________________________________ 152.4.3 Pulsed Doppler ______________________________________ 162.4.4 Use of velocity information in producing images____________ 162.4.5 Tissue Velocity Information ____________________________ 16

2.5 Echocardiography _____________________________________ 172.5.1 Trans-thoracic echocardiography ________________________ 182.5.2 Transesophageal echocardiography ______________________ 18

3 Presentation of the problem__________________________________ 19

3.1 Area of interest _______________________________________ 193.1.1 Pump function of the left ventricle _______________________ 193.1.2 Strain measurements __________________________________ 20

3.2 Basic conditions _______________________________________ 223.2.1 clp-files ____________________________________________ 223.2.2 The machine used ____________________________________ 233.2.3 Assumptions and conditions on the images ________________ 23

3.3 Matlab as a development language _______________________ 243.3.1 GcMat _____________________________________________ 24

6

4 Image processing __________________________________________ 26

4.1 Methods for improving images __________________________ 264.1.1 Stretching___________________________________________ 264.1.2 Median filter ________________________________________ 284.1.3 Wiener filter ________________________________________ 294.1.4 Averaging __________________________________________ 324.1.5 Total Variation based noise removal algorithms_____________ 32

4.2 Methods for enhancing edges____________________________ 334.2.1 Derivative filters _____________________________________ 33

5 Implementation ___________________________________________ 36

5.1 Improving the images by filtering ________________________ 365.1.1 Reducing the speckle noise_____________________________ 365.1.2 Finding edges in an image______________________________ 38

5.2 Algorithm for finding the apex __________________________ 395.2.1 Results and reliability _________________________________ 425.2.2 Comments on the source file____________________________ 43

5.3 Algorithm for finding the atrioventricular plane____________ 435.3.1 Results and reliability _________________________________ 465.3.2 Comments on the source file____________________________ 47

5.4 Algorithm for finding the crossings between the AV plane andthe heart walls ________________________________________ 48

5.4.1 Results and reliability _________________________________ 525.4.2 Comments on the source files Fel! Bokmärket är inte definierat.

5.5 Fitting a parabola to three points in the heart wall__________ 54

6 Conclusion _______________________________________________ 58

6.1 Results and reliability __________________________________ 58

6.2 Usefulness and possible improvements ____________________ 59

6.3 Further developments__________________________________ 59

7 References________________________________________________ 61

8 Appendix 1: Source files ____________________________________ 63

9 Appendix 2: Dividing the work _______________________________ 98

10 Appendix 3: Nomenclature __________________________________ 99

7

1 INTRODUCTION

One of the most frequently used methods to examine the heart isechocardiography. Echocardiography uses ultrasound to image the heart.Echocardiography has several advantages making it a very useful examinationmethod. It is non-invasive and therefore not harmful for the patients and theresult can be viewed in real-time during the examination.

In an echocardiographic examination, a transducer is used to emit beams ofultrasound that are reflected against the different layers of tissue within thebody. The reflected waves are detected and the time it takes for them to returnto the transducer is measured. The information recorded can then be used toproduce images of the scanned area.

The examination can also give information of the movement of the hearttissues. The development of echocardiography in the last couple of years hasabove all been within the Doppler imaging techniques. Despite thedevelopment, great knowledge and experience is still needed to interpretechocardiographic images. By developing new automatic techniques, the useof echocardiographic techniques can further increase. As the interpretation ofthe images is done automatically it is easier for non-trained personnel to usethe equipment.

The objective of this work is to investigate if it is possible to automaticallylocate the apex and the two points corresponding to the crossings between theatrioventricular plane and the heart wall. If these points can be found, testingwill be done to see if a curve, fitted to these points, can approximate the heartwall well enough for automatic border detection functions to be used. This willin turn lead to knowledge of the location of the entire heart wall in the wholeheart cycle. Knowledge of the location of the heart wall in the left ventricleduring a heart cycle can give much information on the pump function and theregional deformation.

There exist some on-line automated border detection programs. These aremostly based on the use of integrated backscatter. The pulse repetitionfrequency is lower resulting in reduced speckle noise, the backscatter isintegrated and analysed and the interfaces between blood and tissue areenhanced and thus easier to detect. [17, 18, 19] This work will instead befocused on the use of imaging processing methods when trying toautomatically locate the three points of interest.

The reading of this report requires knowledge of some basic medicalengineering. However no previous knowledge of image processing is required.

In Appendix 1 the files that are written particularly for this work are attached.Files that are used and are not attached are either functions provided by Matlabor files that are implemented in GcMat.

8

2 THEORETICAL BACKGROUND

To facilitate the reading of this work this section contains a short goingthrough of the anatomy and physiology of the heart, followed by a moredetailed presentation of the use of ultrasound imaging and the theory that it isbased on.

2.1 The anatomy and physiology of the heartThe heart is a muscle located in the upper left part of the chest. It has the sizeof a normal fist and is protected by the thorax. Around the heart is a membranecalled the pericardium, which in turn is attached to the epicardium. Theepicardium is the outer layer of the heart wall. Between these membranes is afluid, which makes it easy for the membranes to slide against each other. Themyocardium in turn is inside the epicardium and is the cardiac muscle tissue.The innermost layer of the heart is the endocardium and is a thin layer.

The heart is divided into four cavities, two atria and two ventricles. The rightpart of the heart handles the blood that shall be oxygenated in the lungs. Thiscycle is called the pulmonary circulation and consists of the pulmonary veinand artery and of course the lungs. The left part of the heart handles theoxygenated blood and provides it to the whole body, called the systemiccirculation. The blood is pumped through the aorta on to the rest of the vesselsof the body. The sizes of the cavities are approximately the same besides thesize of the left ventricle, which is approximately twice the size of the othercavities.

The left ventricle has to pump the blood to the whole body and its walls aretherefore thicker than the walls of the right ventricle, which only has to pumpthe blood to the lungs.

Figure 1 - Anatomy of the heart [1], anterior view of frontal section

9

The movements of the heart can be divided into a cardiac cycle consisting ofdiastole and systole. Diastole stands for relaxation and systole for contraction.First the atria are filled with blood. Then the atria contracts and the ventriclesare filled with blood. They in turn contract and pump the blood into thepulmonary and systemic circulation. To prevent the blood from sliding backmitral valves are located between the atria and ventricles, between the leftventricle and the aorta and also between the right ventricle and the pulmonaryvein.

In the cardiac cycle, the heart is activated by an electrical impulse. Theimpulse starts in the sino-atrial node located in the right atrium. The signal isthen transferred to the musculature in the heart wall. In the atrioventricularnode, located between the right atrium and the right ventricle, the signal isdelayed by a fifth of a second. The impulse then continues and is after a whiledivided into two signals which goes to respective ventricle. The signals movedown to the apex where the muscle contraction then starts from the apex andmoves upwards.

In the contraction of the left ventricle, the atrioventricular (AV) plane movesdownwards towards the apex. The apex is assumed to be relatively fixed,whereas the AV plane moves a distance of approximately a centimetre.

2.2 UltrasoundExamination with ultrasound is an important diagnostic tool. Its mainadvantage against other examination methods is that it does not have anyharmful side effects. Further information on the subjects in this section(section 2.2) can be read in [2, 3, 4].

2.2.1 General information on ultrasoundUltrasound waves propagate as longitudinal waves and have a high frequencyabove the audible frequencies. The frequency range for ultrasound is 20 kHzand above. The velocity with which the ultrasound waves propagate the bodyis for soft tissue approximately 1540 m/s. The intensity of the wave isproportional to the square of the amplitude.

2.2.2 Propagation of the ultrasound beamAs all other sound waves, the ultrasound wave needs a medium to propagate.Depending on the distance to the transducer, two regions with differentcharacteristics are formed: the Fresnel region and the Fraunhofer region.

The size of the Fresnel region, or the near field, depends on the diameter of thetransducer and the frequency of the emitted wave. In this region the beam doesnot diverge due to interference effects. The size of the region is given by thesquare of the radius divided by the wavelength of the emitted wave.

In the Fraunhofer region, or the far field, the beam diverges. The angle of thedivergence depends on the diameter of the transducer and the wavelength ofthe ultrasound wave. The greater frequency or the larger transducer the smallerangle and vice versa.

10

2.2.3 Interaction with matterThe acoustic impedance describes the properties of the matter in question. Theacoustic impedance is expressed as the product of the density of the materialand the velocity of sound in the material.

2.2.3.1 ReflectionA reflection of the ultrasound beam occurs when the beam comes across aninterface between two materials with different acoustic impedance. Thereflected energy depends on the angle of incidence and is reduced when thebeam does not strike the surface perpendicular.

2.2.3.2 RefractionThe transmitted wave after the interface between two materials with differentacoustic impedance will have a different propagation angle due to thefrequency change in the transmitted medium. However if the incident wave isperpendicular to the interface no angle change will occur.

2.2.3.3 AttenuationThe energy of the ultrasound beam is reduced with depth. The energydecreases exponentially with depth. Energy losses occur partly due tointeractions with matter and the energy is therefore lost as heat. The heat isproduced when the particles vibrations cause friction. Energy losses also occurwhen the beam is scattered due to interactions with small point-like objects.

2.2.4 Generation of ultrasoundTo produce ultrasound a piezoelectric crystal is used. The crystal receives anelectrical impulse and converts it to a mechanical wave. The thickness of thecrystal is selected to one half of the produced wavelength. This is to causeconstructive interference between ultrasound waves that have been reflectedinside the crystal and the first transmitted wave. To detect an ultrasound wavethe crystal’s function is reversed and it instead acts as a receiver converting amechanical wave to an electrical impulse.

2.2.4.1 The transducerThe transducer is the transmitter and receptor of ultrasound waves. Thepiezoelectric crystal is only one of the parts in the transducer. Behind thecrystal is a backing block. Its purpose is to absorb the ultrasound wavestravelling in the backward direction and also to act as a damper. The reason forwanting the damping function is that it reduces the duration of the producedultrasound pulse.

In front of the piezoelectric crystal is the matching layer, which has propertiesthat maximizes the transmission of ultrasound waves to the body. Surroundingthe parts is a cover that protects and insulates the parts. [5]

2.2.4.2 Behaviour of the ultrasound beamIn ultrasound scanners multiple transducers are ordered in different ways toproduce beams of different shapes.

11

In a linear probe the transducer elements are ordered linearly and produces arectangular scan segment.

In a phased array transducer the emission of ultrasound pulses can be delayed.By increasing the time between the emissions of ultrasound pulses from thetransducers, the ultrasound beam can be steered. By letting the pulse emittedbe delayed linearly along the probe, the wave front of the resulting beam canbe directed in a certain direction depending on the time delay. To create alarger field of view the beam is shaped as a diverging scan segment bydelaying the outer transducer’s emission of waves.

By instead delaying the inner transducer’s emission the resulting beam willconverge towards a certain point, i.e. it will be focused.

2.2.4.3 The Q-factorThe Q-factor is a measure of the duration of the ultrasound wave that iscreated in the piezoelectric crystal. The electrical impulse sent to the crystalcauses it to vibrate and therefore the ultrasound wave transmitted is not just apeak. Depending on, above all, the backing block, the transmitted wave isdamped. The more damped it is, the lower Q-factor it has.

Figure 2 - High Q, i.e. light damping Figure 3 - Low Q, i.e. heavy damping

2.2.5 ResolutionThe resolution is a measure of the smallest distance between two objects thatcan be distinguished.

2.2.5.1 Time resolution – pulse repetition frequencyThe time resolution depends on how often the pulses are sent out, the pulserepetition frequency. There is however an upper limit on the pulse repetitionfrequency since the emitted ultrasound pulse has to be detected before the nextpulse is sent out. The time resolution thus depends on how deep the ultrasoundbeam has to penetrate and the maximum pulse repetition frequency is derivedfrom this demand.

2.2.5.2 Axial resolutionThe axial resolution is a measure of the distance between two objects in thebeam’s direction that can be separated from each other. The most important

12

factor is the length of the ultrasound pulse, i.e. the Q-factor. The smallestdistance between two objects that can be detected is half the length of theultrasound pulse. If the separation is larger the reflected echoes will overlap.

2.2.5.3 Lateral resolutionThe lateral resolution is a measure of the distance between two objects in thecross section of the beam that can be distinguished. If two objects are withinthe same ultrasound beam they will not be separable. The resolution is worsedeeper inside the body than it is in superficial layers. This depends, amongother things, on the divergence of the beam.

2.2.6 Artefacts and disturbancesThe ultrasound image contains disturbances that make the image an inaccuratereplication of the actual appearance of the examined area.

2.2.6.1 Speckle noiseThe dominating disturbance in ultrasound images is the speckle noise. Thisnoise is the reason why ultrasound images look so grainy. As described above,the ultrasound image is built-up by the reflection against tissue of the sent outpulse from the transducer. If two points in the tissue lie very near each other,their reflections can coincide and cause coherence. The points must howeverhave a distance between each other that is smaller than the duration of the sentout pulse. For constructive coherence to occur, the (radial) distance betweenthe reflecting points must be a multiple of the distance of half the wavelength.Then the two points will overlap and form one bright dot in the ultrasoundimage. If however the distance between the small objects are (2n+1)λ/4 (n is aninteger) the interference will instead be destructive and the two points will berepresented as a black spot. Two images taken with only a small timedifference will show very similar speckle patterns. Since the movementbetween these images has not been large the structure of the tissue has notaltered much either. This means that the speckle pattern will arise in similarmanners.

The higher the Q-value, the more speckle noise will appear, since the regionwhere two reflections overlap at the receiver will be larger. Below is anillustration of the reflected signals of two points that have a constructiverespective destructive interference. [11, 21]

13

Figure 4 - Distance between points are nλλ/2, overlap leads to constructive interference

Figure 5 - Distance between points are (2n+1) λλ/4, overlap leads to destructiveinterference

2.2.6.2 ReverberationsMultiple echoes can occur when a strongly reflected signal is again reflectedback into the body, i.e. multiple echoes are produced. This means that thetransducer will receive false echoes that do not arise from an interface. Thisprincipally occurs near the surface where the signal has not attenuated much.

2.2.6.3 Shadowing and enhancementIf an interface with high acoustic impedance difference (see 5.2.3) is closelyfollowed by another interface, the following interface will be “shadowed” bythe strong interface. This implicates that the interface will disappear or bestrongly reduced in the produced image. The opposite effect with a too strongecho will occur when an interface with a weak echo is followed by anotherinterface, which then will be enhanced.

2.2.6.4 Speed artefactsThe velocity of the ultrasound is approximated to 1540 m/s in tissue whenproducing an image from the acquired data. This means that structures withhigher acoustic impedance will be reproduced with a reduced thickness, sincethe actual velocity in this type of medium is higher than 1540 m/s. Theopposite applies to structures with lower acoustic impedance that will bereproduced with an increased thickness.

2.2.6.5 MirroringIf the ultrasound beam strikes a strongly reflecting structure with an angle, thebeam will be reflected. The reflected beam in turn can strike another material

14

and be reflected back to the strongly reflecting structure and ultimately reachthe transducer. This will lead to a false echo, which appears in the imagebehind the strongly reflecting structure.

2.2.6.6 Increase of widthAs the beam moves deeper into the body, it diverges. This means that objectsdeeper within the body will be reproduced as bigger than they actually are.

2.3 Acquiring imagesThere are a few different recording techniques used at ultrasoundexaminations. Some of the techniques present the recorded information as atwo-dimensional image of the scanned area and some present the data as afunction of time. Different techniques are used to visualise different features.Sometimes, the relative intensity, instead of the intensity, is used in the displayand is measured in decibel. More on the subject treated in this section (section2.3) can be read in [2, 3, 4].

2.3.1 A-modeA-mode stands for amplitude mode and is the simplest way of usingultrasound. Ultrasound pulses are only transmitted along one beam and thereflected echoes are recorded. The intensity as a function of depth is measured.The output is thus a graph where the horisontal axis represents the time fromwhen the pulse is sent out and the vertical axis represents the amplitude of thereflected pulses. See figure21 for a typical A-mode graph.

2.3.2 B-modeB-mode stands for brightness mode and is displayed as a two dimensionalimage. Either a moving transducer or an array of transducers is used. Thismeans that a larger sector is scanned than in A-mode. The resulting echoes arerecorded and an image is produced. See figure 9 for a typical B-mode image.

2.3.3 M-modeM-mode stands for motion mode and shows the time variation of one beam.Thus a stationary transducer is used. A two dimensional image is built upwhere the variation of the interfaces are plotted as a function of time.

Figure 6 - A typical M-mode image

15

2.3.4 TGCTGC is short for Time Gain Compensated. This is an adjustment that is used toamplify the returned echoes. Since the ultrasound beam is attenuated in tissue,the amplitude of the returned echoes will decrease with time after emission.Therefore the returned echoes are amplified as a function of time. The idealcase is an image where all interfaces are reproduced equally strong.

2.4 The use of Doppler informationThe information of the movements of the blood and tissues can be calculatedusing Doppler information.

2.4.1 The Doppler effectWhen a sound wave with a certain frequency, f, hits a moving object, thereflected sound wave will have a different frequency, f’, depending on thevelocity of the moving object. Moreover, the change of frequency dependson, θ , which is the angle between the direction of the original sound wave andthe direction of motion of the moving object. The formula for the Dopplereffect is:

cv

fff θcos

2)'( =−

c is the velocity of sound in air.

From the Doppler shift, the velocity of the moving object can be derived.However, it is the velocity component along the beam that is being derived. Ifan object only moves perpendicular to the transmitted pulse, no Doppler shiftwill occur. Two types of Doppler methods are used: continuous and pulsed.[3, 4]

2.4.2 Continuous DopplerMeasuring velocities using continuous Doppler requires two transducers: onetransmitter and one receiver. A high Q-factor is necessary. The transmitter isenergised by an alternating current and sends out ultrasound continuously. Thereceiver then registers the frequency of the reflected waves and determines thedifferences in frequency between the transmitted and the received signals. Theadvantage of continuous Doppler is that aliasing is avoided and therefore highvelocities can be measured. The main drawback however is that the variousvelocities cannot be determined in depth since the waves are sent outcontinuously.

Aliasing means in this case that high velocities will be represented as lowbecause of a too low sampling rate, fs, when deriving the velocities from theDoppler shift. The sampling rate must be so high that the signal is measured atleast twice every period, fs≥2f0, where f0 is the frequency of the measuredsignal. The sampling rate is nevertheless depending on the pulse repetitionfrequency. There is, however, an upper limit on the pulse repetition frequencyas described above. This upper limit reduces the sampling rate and thus resultsin an upper limit on the velocities that can be measured. If a velocity exceeds

(eq. 1)

16

this limit, the sample rate will be too low and the aliasing phenomenon willoccur. This will result in undersampling and as a consequence, highervelocities will be registered as low.

2.4.3 Pulsed DopplerThe pulsed Doppler uses transducers, which acts as both transmitter andreceiver. Unlike the continuous Doppler, the pulsed Doppler is depth sensitive.The operator of the transducer selects an area of interest to examine and thepulse repetition time is determined according to the selected depth. If the pulserepetition frequency is too high, velocities deep inside the body will not bemeasured, since the echoes from these parts will not have returned before thenext pulse is transmitted. This will result in an upper limit on the pulserepetition frequency and therefore, there will also be a maximum limit on themeasurable velocities. This will result in aliasing.

2.4.4 Use of velocity information in producing imagesIn images where velocities are displayed, the colours used are often red andblue. Red to yellow represents movement toward the transducer and blue togreen movements away from the transducer. [13, 15]

2.4.4.1 Auto-correlation method for calculation of the velocitiesThere are some different approaches used when determining the velocitytaking the frequency shift as a starting point. However, in this text only theauto-correlation method will be described.

Since it is the derivative of the phase that determines the velocity, this is theimportant calculation factor to speed up for the purpose of real-timeillustration of velocities. The basic idea of the auto-correlation method is thatthe method is quick to estimate the phase factor and its derivative. The auto-correlation method is in fact an approximation of the velocities, sinceultrasound images are discrete both spatially and in time. Instead of analysingthe phase shift in every received signal, the auto-correlation method suggeststhat the phase shift can be approximated by taking two, in time, subsequentscan lines and compare these, resulting in an approximation of the phase shift.The comparison of scan lines involves calculation of the auto-correlationfunction in every point along the scan line. This in turn is approximated, sincethe amount of data is limited. The auto-correlation function with lag one istherefore discretized. The auto-correlation method is mathematically quiteadvanced and is thus only briefly described here. More can be read in [4, 9,16].

2.4.5 Tissue Velocity InformationThe use of Tissue Velocity Information (TVI) has become an important tool indescribing the function of the heart. TVI is only one of the names used whenreferring to movement of tissue measured by Doppler. Other names used areTissue Doppler Imaging (TDI) and Doppler Tissue Imaging (DTI).[8, 9, 13, 14, 15]

17

2.4.5.1 Extraction of the TVIVelocities in the body can be calculated by using Doppler methods and theauto-correlation method described in section 2.4.4. However the velocitysignals can arise from either movement of the tissues or the blood flows. Thereare two ways to separate the blood flow from the movements of tissue. First,the blood velocities are much higher than the tissue velocities and second, theamplitude of the signal coming from the reflection against blood cells is muchweaker than the signals coming from tissue.

Figure 7 – Characteristics of Doppler signals and how to separate them from each other

To extract the tissue velocity information, either a high pass filter on theamplitude information or a low pass filter on the velocity information can beused.

2.4.5.2 Display of the TVIDepending on its purpose, the tissue Doppler velocities can be displayed eitherin M-mode or in two-dimensional images. If the M-mode display is used thepulse repetition frequency is much higher, but if instead the two-dimensionalview is used the velocities can be overlapped on an ordinary ultrasound image.The pulse repetition frequency is lower because the velocities have to becalculated in every segment of the heart between two subsequent displayedimages.

2.5 EchocardiographyEchocardiography is the term used when referring to ultrasound basedmethods for heart imaging. Originally it was used only for images derivedfrom the amplitude information, but in spoken language it also refers to imagesderived from Doppler-measurements.

Echocardiography is a frequently used method for examining the state of theheart. It is a non-invasive method and the result can be seen in real-time duringthe examination. A full examination often includes both M-mode and 2-Drecordings, in addition to continuous, pulsed, high-pulsed and TVI [20].

The frequencies of the ultrasound used in echocardiographic examinationsnormally ranges between 2-5 MHz. At the examination the ultrasound probecan be placed either on the chest or it can be positioned in the oesophagus.

Tissue movement

Blood flow

Velocity Amplitudem/s dB

18

2.5.1 Trans-thoracic echocardiographyBy placing the transducer on different positions of the chest, different views ofthe heart can be imaged. The four standard views, so called acoustic windows,are suprasternal-, parasternal-, apical- and subcostal-view:

Figure 8 - Acoustic windows of the chest

A rotation of the transducer results in a rotation of the scanned plane. It is upto the person performing the examination to find the appropriate angle. It isalso up to the examiner to decide whether she wants to include all fourchambers of the heart in the image, or whether she wants to focus on one sideof the heart (resulting in a so called 2-chamber image).

2.5.2 Transesophageal echocardiographyBy sending down a probe with an ultrasound transmitter in the oesophagus, itis possible to reduce some of the noise that is produced when the sound wavespenetrate the chest. Furthermore, the resolution is improved because the probeis located closer to the heart.

Normally, trans-thoracic echocardiography is preferred because it is easier toperform and less inconvenient for the patient. Though in certain cases thequality of the trans-thoracic image is insufficient and transesophagealechocardiography has to be used. This may be the case with, for instance,overweight patients. Transesophageal echocardiography is also used tomonitor the heart during cardiac surgery.

Suprasternal

Parasternal

Apical

Subcostal

19

3 PRESENTATION OF THE PROBLEM

The research assignment was to develop an algorithm that can automaticallyfind the co-ordinates of certain points in the heart wall in an ultrasound image.The points should be expressed either in screen co-ordinates (x and y referringto the position of the pixels on the screen) or in scan co-ordinates (the beamand range depth corresponding to the points, see section 3.2.1). The threepoints to be found were the apex and the two points in the image where thewalls of the heart cross the AV plane (see section 2.1, figure 1).

Figure 9 - Display of the three wanted points

Initially, the task was to find the inner walls of the heart, but later it wasdecided that the task should be limited to finding three key points. The reasonwas mainly that the task of finding the entire heart wall would be too large.Having found the three points mentioned, it would, however, be easier toeventually find the rest of the heart walls. Moreover, the movement of thesethree points, or rather the movement of the AV plane relative apex, gives afairly good overview of the heart function. The results obtained can thereforebe used independently of a wall-finding program.

3.1 Area of interestMuch can be learned if the points corresponding to the apex and the AV planeare known.

3.1.1 Pump function of the left ventricleStudying the movement of the AV plane towards the apex is interesting mainlybecause it has been shown that the shortening of the distance between the AVplane and the apex correlates with the left ventricle ejection fraction. Theejection fraction is a measure of the pumping function of the ventricle. Itdescribes the quotient between the volume of the blood that is pumped into theaorta during systole and the volume of the blood that fills the ventricle justbefore the contraction starts. Today, the measurement of the ejection fraction

20

is mostly done by drawing the contours of the inner walls of the left ventriclein the end-systole respective the end-diastole by hand. This gives a highlysubjective result. Two different contour drawings can result in an areadifference to up to 10%. [18]

In the figure below it is easy to see how the manual drawing of the contour ofthe left ventricle can be difficult and subjective.

Figure 10 - Manual tracing of the left ventricle

The measurement of the displacement of the AV plane is mostly done by usingthe area-length method, i.e. by hand drawing where the AV plane is in the end-systole respective the end-diastole in an M-mode image. This method is alsoquite subjective.

By automatic location of the AV plane in the end-systole respective the end-diastole, a value of the displacement of the AV plane can be given that isobjective and independent of observer.

Another way of using the knowledge of the location of the apex and the AVplane is to calculate an approximation of the location of the heart wall. Fromthis approximation the contour of the inner wall can be derived, usingadvanced wall-searching algorithms. This means that it would be possible tocalculate the inner contour in the end-systole respective the end-diastole and toderive the ejection fraction from these results.More details on the use of finding the walls can be read in [6, 12].

3.1.2 Strain measurementsThe three points (apex and the crossings between the AV plane and the heartwalls) give a good estimation of the location of the heart walls. The heart wallswill roughly describe a parabola connecting the three points. This estimationmight be enough to enable a calculation of the strain in the heart walls, usingthe TVI.

21

Strain, ε, is a measurement of the deformation of the wall tissue and is definedas the length expansion, L2- L1, of a tissue segment divided by the originallength of the segment, L1 :

1

12

LLL −

Strain is used to examine the moveability of the heart. For example, strainmeasurements are used to detect hypo- and akinesia (abnormal muscularaction) after a heart infarct. The damaged tissue will still move, due to themovements of surrounding tissue, but it will no longer contract. This meansthat the strain for dead tissue is close to zero.

The strain is normally calculated from the TVI through the strain rate. Strainrate is a related conception defined as:

1

12

Lvv

SR−

=

As shown in section 3.1.2.1, the strain and the strain rate are related throughthe following expression:

1)exp(2

1

−= ∫t

t

dtSRε

Measurements for calculation of strain can be done in a number of differentways. MR is one of the techniques used on humans. The advantages ofmeasuring strain by ultrasound are that the method is both fast (real-time) andnon-invasive. The major drawback is that, using the tissue Doppler technique,only velocities parallel to the ultrasound beam can be measured. Anotherproblem is that the resolution of the TVI is low. Since the ultrasound machinehas to deal with both the amplitude information and the TVI, the manufacturerof the machine has generally made the resolution worse on the TVI by

r

v(r+∆r)= v2

L1

v(r)=v1

Figure 11 – Illustration of the strain concept

(eq. 2)

(eq. 3)

(eq. 4)

22

reducing the number of beams, in order to improve the resolution of theamplitude image. [7, 10]

3.1.2.1 Derivation of the relation between strain and strain rateAs mentioned, strain is defined as the length expansion of a tissue segmentdivided by the original length of the segment:

1

12

LLL −

By setting L2-L1 = dL1 = (v2 – v1)dt, and rearranging the expression above, thefollowing result is obtained:

dtL

vvLdL

1

12

1

1 −=

The right hand side of the expression consists of the so-called strain rate, SR,times the time increment. Integrating both sides gives:

∫=2

11

2logt

t

e dtSRLL

This expression in its turn leads to the following relation between strain andstrain rate:

1)exp(2

1

−= ∫t

t

dtSRε

3.2 Basic conditionsAlthough the results of this study are general and not depending on, forexample, the machine used to record the data or the software used in testingthe algorithms, a few things must be said about the practical conditions duringthe work. It is also necessary to say something about the assumptions that havebeen made in order to facilitate the work. The developed methods were testedon 25 sets of images.

3.2.1 clp-filesThe data used in the work were recorded on a Vingmed System Five machineand stored as clp-files. A clp-file contains two sorts of data: the amplitudeinformation and the tissue velocity information. The amplitude informationrepresents the strength of the reflection of the ultrasound wave, that is thedifference in acoustic impedance at a certain depth and at a certain time. Theinformation can be extracted from the clp-files as third order tensors of size(beams*ranges*timeframes). Beams is the number of ultrasound beams thatare used in the recording. The number of ranges represents the resolution indepth and timeframes is the total number of pictures in the recording. The data

(eq. 5)

(eq. 6)

(eq. 7)

(eq. 8)

23

used to develop the algorithms have a resolution in depth of about 400 rangescorresponding to about 10 cm. 35-45 beams are used and each recordingconsists of 200-400 time frames, which corresponds to just over two cycles ofthe heart. The clp-files also contain TVI-data (Tissue Velocity Informationdata), which is a measurement of the velocity of the heart tissue parallel to theultrasound beams. The velocity can be measured simultaneously with theamplitude information using the Doppler effect and the result is stored in thefile as complex numbers. When recording the TVI only about one fourth of thebeams used to record the amplitude information are used, leading to a ratherpoor resolution in the beam-direction. Also, the number of ranges is less.

3.2.2 The machine usedA Vingmed System Five machine was used in therecordings of the data. The machine itself is notrelevant to the results of this work, however thereare some things that need to be said about thefiltering of the output data.

The ultrasound machine has a built-in filter, whichacts as a highpass filter. This affects the data so thatthe tissue velocities under a certain value cannot bediscerned. Unfortunately this clipping of data hasgreat consequences for the work. This will befurther discussed later on.

The reason for having the described highpass filter is that it reduces noise anddisturbances. The value on the lowest velocity is an adjustment to how muchnoise that can be accepted in the ultrasound image.

In the regions close to the probe, multiple reflections and strong echoes fromthe ribs and the outer skin-layer will disturb the TVI. Filtering the Dopplersignal with a highpass filter would reduce these disturbances, since themultiple, stationary reverberations have a low velocity, i.e. a low Dopplershift. With this filter the velocity information in the areas that have a lowDoppler shift, including the low velocities of certain structures in the heart,will be removed in the filtering and given a constant value.

3.2.3 Assumptions and conditions on the imagesThe methods of finding the three points are not completely general. A numberof assumptions are made that reduce the work substantially, but also bringalong requirements on the data. The first assumption is that the images to beprocessed are always apical 2-chamber images of the heart. In addition to this,the methods require that both the apex and the AV plane are comprised in theimage. This may seem like a matter of course, but restricting the methods tothe images that fulfil the requirements makes it possible to draw someconclusions that can be used to separate the requested points from the rest ofthe data. For example it is reasonable to assume that apex will be locatedwithin a rather small radius from the probe.

Figure 12 – Vingmed System Five

24

The image quality must be reasonably good. Ultrasound images are generallyquite noisy. Therefore, the methods used to find the requested points must berather robust and tolerate a certain amount of noise. Of course, there willalways be a limit on how much disturbances that can be tolerated

An assumption that is not related to the quality or the extent of the image is theassumption that apex is still during the heart cycle. This is of course notexactly true, but it is a starting point and a reasonable approximation that willdo for our applications.

3.3 Matlab as a development languageThe reason for using Matlab as a development tool is its simplicity. It is veryeasy to test procedures and it also has a good image processing toolbox. In thecase of image processing Matlab has several built-in filters, which makes iteasy to improve the pictures.

The drawback of using Matlab is that it is relatively slow compared with, forinstance, C++. C++ is nevertheless quite complicated compared to Matlab.One of the reasons for using Matlab is that it is easy to use its differentgraphical toolboxes. GcMat is an example of this.

3.3.1 GcMatGcMat is used to visualise ultrasound images. GcMat is written and developedby Vingmed. Ultrasound data can easily be treated with built-in GcMatfunctions. The ultrasound data is stored in clp-files when the ultrasound isregistered, as described in section 3.2.1. From these files different sorts ofinformation (amplitude data and velocity information) can be extracted inGcMat. The extracted information can then be treated and presented as anultrasound image would be presented. The data is, as described in section3.1.2, of the format beams*ranges. If the data is displayed in an orthogonal co-ordinate system, the interpretation is difficult. If instead a built-in commandthat scanconverts the data is used, the data can be presented as an ordinaryultrasound image. This is illustrated below.

25

Figure 13 - Illustration of the data on format range*beam

Figure 14 - Illustration of the scanconverted data

The use of GcMat is complicated by the fact that its functions have beenconstructed by several different persons. As a result, some functions havesimilar, or the same, purpose. This is very confusing for the user, since there isa lack of documentation of the functions. Some functions with the samepurpose actually return different results.

26

4 IMAGE PROCESSING

An arbitrary image can be discretized to form a digital image. The space co-ordinates are discretized as well as the colour of each area element. The areaelements are called pixels (short for “picture element”). As a result ofdiscretizing, an image can be seen, treated and stored as a matrix. The numberof pixels that make up the image determines the resolution in a digital image.As a rule, the number of pixels along each side of the picture as well as thenumber of greylevels/colours in the colour scale is chosen to be integer powersof two. This is not necessary, but it is a convention that is generally accepted.

Image processing on digital images is performed by letting mathematicaloperators work on the image matrix. In the attempt to find the three points ofinterest in the ultrasound images of the heart, several well-known techniquesfor noise reduction and image enhancement were used. This section consists ofa compilation and description of the most commonly used methods, and it isdivided into two parts. In the beginning of the work, much effort was focusedon trying to improve the quality of the ultrasound images. The first part dealsmainly with noise reduction, but it also describes a few other methods that donot change the information content of the images. These methods are onlyused to facilitate the viewer’s interpretation of the images. The second part ofthis section deals with methods for enhancement of details in images.

For further readings on image processing and the methods described in section4, see [22].

4.1 Methods for improving images

4.1.1 StretchingStretching is a method for improving the contrast of a picture that has acompressed colour scale. The method does not change the information in thepicture, but by stretching and compressing parts of the colour scale it ispossible to let the interesting details of the picture represent a wider range ofthe colour map. Stretching therefore improves the contrast of those parts of thepicture, making it easier for the viewer to interpret the information.

The implementation of the method involves mapping of the original colourmap, z, onto a new colour map, z’. To perform this mapping a transformationfunction, T, is used.

z’=T(z)

This function determines the stretching of each interval of the colour scale.The steeper the transformation function is, the larger the stretching. For apicture with a large number of dark details, a logarithmic transformationfunction may successfully be used. Another commonly used stretching ishistogram equalisation. Below is an illustrative example of a transfer functionfor stretching.

(eq. 9)

27

Figure 15 - Transfer function for stretching

4.1.1.1 Histogram equalisationHistogram equalisation is used to spread out the colours represented in apicture evenly over the colour scale. A histogram is computed, showing thenumber of pixels within each interval of the colour scale. Each interval of theoriginal colour map is then mapped onto a new interval with a size thatdirectly corresponds to the proportion of the pixels within the old interval.

4.1.1.2 ThresholdingSometimes it is desirable to show only the pixels with high values, taking nointerest in those pixels that have lower values than a certain threshold. It isthen possible to map all the pixel values above the threshold value onto onesingle value. This mapping renders a picture that shows all the pixel valueshigher than the threshold mapped onto a specific value, while the pixels withlower values are displayed in one single specific colour. The same discussionis applicable for the case where low values are of interest.

Figure 16 - Transfer function for thresholding

28

4.1.2 Median filterA median filter replaces the grey level value of a pixel with the median valueof the surrounding pixels. A median filter is used to reduce noise and preserveedges. It is particularly good when the image consists of disturbances that havea limited extent and also have grey level values that differ from thesurrounding pixels. These disturbances can be removed by using the medianfilter. The larger the filter the larger disturbances can be removed. Howeverwith larger filter, information on small details can be destroyed. The medianfilter is a non-linear filter.

Figure 19 - Ultrasound image without filtering

Figure 17 – Thresholded imageFigure 18 – Original image

29

Figure 20 - Median filter applied

The remarkable difference in the images can more clearly be seen whenlooking at only one scan line, i.e. plotting the amplitude as a function of depthfor one beam.

In the images it is clear how the noise is reduced.

4.1.3 Wiener filterThe Wiener filter is a filter that when applied to an altered image restores it.The basic principle is that the filter uses knowledge of how the image has beenchanged. If this is not known, estimation has to be done. The image is restoredbased on the minimizing of the square of the error.

The Wiener filter is a development of the inverse filter. The inverse filter isalso used to restore an image, which has been modified. The process ofmodifying an image can be modelled as,

),(),( yxfHyxg =

Figure 21 - Amplitude information for one beam without filter and with median filter

(eq. 10)

30

where f(x,y) represents the original image and g(x,y) represents thetransformed image. H represents the transformation process. Thetransformation process can also be expressed as a convolution. Someconditions have to be fulfilled. For instance, the transformation process, H, hasto be a shift invariant linear operator. The process can then be written as:

∫∫ −−=∗= '')','()','(),( dydxyyxxfyxHfHyxg

By taking the Fourier transformation of this, the formula looks a lot easier:

),(ˆ),(ˆ),(ˆ vufvuHvug = H

gf

ˆˆˆ =⇒

ℑ=⇒ −

),(ˆ),(ˆ

),( 1

vuH

vugyxf

When noise is present, eq. 11 then becomes:

),(),(),(),( yxnyxfyxHyxg +∗=

The Fourier transformation of reconstructed original image the looks like:

H

nff ˆ

ˆˆ~+=⇒

Now, the function is not only singular but also when the transformationfunction assumes low values noise will be enhanced.

To avoid these problems the Wiener filter can be used. The basic idea of thisfilter is to find a transfer function that when applied on the distorted imagecreates the best approximation of the original image. The derivation of theWiener filter involves the concept of cross correlation. The cross correlation isa measure of the similarity between two functions and the mathematicalexpression for the cross correlation is:

∫ ∫ ∗=−=+=Φ4 4

))(*()()(*)()(*)(R R

fg xgfdxgxfdxgfx ξξξξξ

Taking the Fourier transform of this expression yields:

gffg ˆ*ˆˆ =Φ

When g=f the cross correlation is called the auto-correlation function. Anotherproperty for the correlation functions are:

iiib TΦ=Φ ˆˆˆ

(eq. 11)

(eq. 12)

(eq. 13)

(eq. 14)

(eq. 15)

(eq. 16)

(eq. 17)

31

T is the wanted transfer function, which approximates the original image. Seenas a picture:

The proof for eq. 17:

bTbbiib ∗∗=∗=Φ *)(* bTbibˆ*ˆ*ˆˆ =Φ⇒

)(*)(* TbTbiiii ∗∗∗=∗=Φ TbTbiiˆˆ*ˆ*ˆˆ =Φ⇒

iiib TΦ=Φ ˆˆˆQ

In the case of the Wiener filter, according to eq. 13, nfHi +∗= . Thisexpression combined with eq. 18 will result in an expression for the transferfunction T, which shall operate on i.

nnbnnbbbnfhnfhii

nbbbbnfhib

HHH

H

Φ+Φ+Φ+Φ=Φ=Φ

Φ+Φ=Φ=Φ⇒

+∗+∗

+∗

ˆˆ*ˆˆˆˆˆˆˆ

ˆˆ*ˆˆˆ

2

))((

)(

If the noise is assumed to be uncorrelated, i.e. 0ˆˆ =Φ=Φ nbbn , eq. 19combined with eq. 17 will result in the wanted transfer function, T.

iiib TΦ=Φ ˆˆˆ )ˆˆˆ(ˆˆ*ˆ 2

nnbbbb HTH Φ+Φ=Φ⇒

bbnnH

HT

ΦΦ+=⇒

ˆ/ˆˆ

*ˆˆ

2

Below is the result of applying a Wiener filter on the same ultrasound image asfigure 19:

i b* T

(eq. 18)

(eq. 19)

(eq. 20)

32

Figure 22 - Wiener filter applied on the ultrasound image

4.1.4 AveragingOne way to reduce the noise is to take the average of a number of frames. If alarge number of frames are averaged the noise will be reduced remarkably.However, segments of the image that move noticeably will be smudged over alarger area. For segments that are relatively still averaging is a good tool toreduce noise.

If there is movement, some noise reduction can still be achieved by averagingimages from only a few adjacent time frames. The less movement the moreframes can be used in the averaging process and the noise reduction willthereby increase.

4.1.5 Total Variation based noise removal algorithmsThe basic idea of these kinds of image restoration methods is to minimize thenoise in the image by minimizing a mathematical function under a number ofconstraints. The problem will thereby be reduced to finding a suitablemathematical function to minimize. If such a function can be found, theresulting optimisation problem can be solved with known methods.

A noisy image, u0(x,y), can be thought of as the original image, u(x,y), addedwith additional noise, z(x,y).

zuu +=0

In this case, the conditions that have to be fulfilled are:

∫ ∫Ω Ω

= dydxudydxu 0

(eq. 21)

(eq. 22)

33

220 )(

21

σ=−∫Ω

dydxuu

The first constraint, eq. 22, simply means that the mean value of the noise,z(x,y), computed over the entire area of the image (Ω) is zero. That is, thenoise is equally spread out over the colour scale. The second constraint, eq. 23,means that the standard deviation of the noise is σ (σ > 0).

The real problem is to find the function to minimize. This problem is currentlyan area of research, and will not be discussed in this report. For further readingon the subject, see reference [23].

It has been shown that the function u(x,y) that minimizes the magnitude of thegradient, ∇u, represents an image in which the edges are preserved at the sametime as the noise is levelled out. The function to minimize is:

∫Ω

+ dydxuu yx22

To minimize this function, standard methods are used. To start with, the Euler-Lagrange equations are derived. They can then be solved numerically afterdiscretization of the time and space co-ordinates [23].

4.2 Methods for enhancing edgesAs mentioned, averaging is an efficient way to reduce the noise. Howevermany of the details in the original image are lost in the processing. To reducethis effect of the averaging filters, highpass filtering can be used. Highpassfilters are designed to enhance the edges in the image.

4.2.1 Derivative filtersAveraging over pixels can be looked at as integration over the pixel values.The opposite of integrating is to differentiate. According to this line ofreasoning, differentiating an image would enhance the details instead ofblurring them. Derivative filters of first, second and third orders are often usedin image processing to sharpen pictures.

A simple kind of derivative filter for the first derivative is the Prewitt filter.There are many filters that are more advanced, both for the first order and forhigher orders of derivatives, but the principle idea is the same. The derivativein one pixel is approximated from the values of the surrounding pixels. Theconvolution of the image and the filter is an image of the derivatives in eitherthe x- or the y-direction. The derivative-image can then be imposed on theoriginal image. The appearance of the Prewitt filter and the result of theapplication of the filter can be seen below.

(eq. 23)

(eq. 24)

34

Figure 24 - Original image

Edges have high values of the derivatives and can easily be found bycalculating the first derivative and thresholding the result. The “middle” of theedge, or rather the highest derivative of the edge, can be found by using theknowledge that the second derivative is there close to zero. (Keep in mind thatthe derivatives are only approximated, and that the second derivative thereforewill not be exactly zero.)

4.2.1.1 Taking the derivative over many pixels – special treatment ofnoisy images

Taking the derivative of a noisy picture enhances the noise. To avoid this thederivative can be computed over a larger interval. Taking the mean value of npixels (n is an integer) and subtracting from that the mean value of the nfollowing pixels will give an estimation of the derivative between the twoareas. The main drawback of this method is that the larger n is, the more

-1 -1 -1

0 0 0

1 1 1

-1 0 1

-1 0 1

-1 0 1

Figure 23 – Prewitt filters in y- respective x-direction

Figure 25 – Prewitt filter appliedin the x-direction

Figure 26 – Prewitt filter appliedin the y-direction

35

details are lost in the filtration. Therefore it is important to consider the choiceof n carefully for every picture. Used correctly, however, the method has greatbenefits. It is a stable method that does not require good quality of the pictures,and therefore it makes it possible to perform edge detection based onderivative methods on pictures that are too noisy for normal derivative filtersto be used.

36

5 IMPLEMENTATION

5.1 Improving the images by filteringThe images derived from the clp-files are images derived directly from theultrasound machine. Although some filtering has already been done within themachine, the quality of the images is poor. Therefore some additional filteringhas to be done before the actual task of finding apex and the points in the AVplane can be started.

One step towards finding the three points of interest is to detect the edges asgood as possible. Finding the exact position of the edges is very difficult and itis currently an area of research, but it should be possible to find at least partsof the walls that are perpendicular to the direction of propagation (which areeasier to detect). Edge detection can be performed using derivative filters, butfirst as much noise as possible must be removed.

Ultrasound images are generally very noisy. Much of the disturbances are dueto so called “speckle noise”, which gives the images a grainy appearance. Thespeckle noise makes it more or less impossible to use ordinary derivativefilters to detect edges since derivative filters tend to reinforce noise.

5.1.1 Reducing the speckle noiseSeveral methods that can be used to reduce the noise in an image are presentedin section 4.1. How well a method works depends on the image, or rather onthe sort of noise in the image that the method is applied to. For example,median filtering is particularly useful on images that have disturbances thatcause separate pixel values to deviate much from the values of the surroundingpixels. Consequently, median filtering is a method that applies well toultrasound images. The result of using median filtering on an ultrasound imageis shown in section 4.1, figure 19 and 20, where the results of Wiener filteringcan also be seen (figure 22).

The clp-files contain sets of images, each consisting of 200-400 imagesrecorded during only a few seconds. This means that the time interval betweentwo images is small. Averaging over a couple of time frames should then bepossible to perform without losing too much detail due to the movement of theheart. Averaging over a number of following images would reduce theuncorrelated noise, but it would not remove the speckle noise since it is time-dependent and does not change much on the time between two followingimages.

The problem with time-dependent noise can be avoided if the averaging isdone over images from different heart cycles, but from the same moment inthe cycle. Using electrocardiograms, images that correspond to the sameposition in the heart cycle can be extracted. After averaging over only threeimages, corresponding to the same position in the heart cycle, theimprovement is very good. Of course, the averaging of images from different

37

heart cycles requires that the transducer is held relatively still during theexamination. A drawback with this method is that the quality of the ECGoutput is often poor and it is therefore difficult to extract the correspondingframes in different heart cycles from the ECG information. One of the easiestpoints in the heart cycle to recognise from the ECG-curve is the R-peak of theelectrocardiogram. This peak represents the beginning of the systolic phase ofthe ventricles.

The images below show the difference between an ordinary image and animage, which is an average between three images from the same instant in theheart cycle.

Figure 27 - Ordinary image with a large amount of speckle noise

38

Figure 28 - Averaged image with reduced speckle noise

A more advanced noise removing method is the total variation (TV) methoddescribed in section 4.1.5. The implemented code has been tried on bothultrasound images and a test-image (picturing black rectangles on a whitebackground) to which noise was added. The result was not to full satisfaction.The method is implemented as an iterating method with some input parameterssuch as, for instance, the value of the discretization. The method made theimages better for a limited number of iterations, but it turned out to be more orless impossible to choose the values of the variables in a way that made themethod converge. In addition to the fact that the method is unstable, it also hasthe drawback that it is slow and requires a lot of computation. There aresimpler methods that give better results and therefore the TV method is notused in the final algorithms for finding the requested points.

5.1.2 Finding edges in an imageIn finding the inner and outer heart wall in an ultrasound image, basicderivative filters, like for instance the Prewitt filter, are not that useful. This isbecause of the noise present in the image. In spite of the noise-reducingfiltering, there is still a substantial amount of noise left in the image in theform of random intensity variations between adjacent pixels. In an image withhigh resolution (many pixels), local variance in the intensity can efficiently bereduced without too much loss of sharpness by averaging the intensity over anarea of n*m pixels (choose n, m small compared to the total amount of pixelsin the image). In ultrasound images the spatial resolution is low perpendicularto the beams, since it is limited by the number of transducers in the ultrasoundtransmitter. Normally the number of probes used to record ultrasound imagesof the heart lies between 35 and 40. Averaging over pixels in that directioncould destroy important information.

39

The method of calculating the derivative over a number of pixels (see section4.2.1.1) reduces the impact of noise that cannot be completely removed. Themethod is very stable and has proved to be highly useful in the processing ofultrasound images. Where nothing else is implied, this is the method used tocalculate derivatives in the developed algorithms.

Derivative filters can be constructed to calculate the derivative in an arbitrarydirection. In edge detection it is often not the direction of the derivative in apoint that is interesting, but the absolute value of the gradient. Therefore it isoften desirable to use a rotation invariant derivative filter. This is difficult todesign for ultrasound images, partly because the spatial resolution (i. e. thediscretization) is different in different directions, partly because the co-ordinate system of the incoming data is not orthogonal. This is the reason whyrotation invariant derivative filters are not used in this work. Instead the resultsfrom derivative filters in beam- and range-direction (alternatively x- and y-direction) are added.

Another problem is the detecting and depicting of edges parallel to theultrasound beams. These edges do not reflect much of the ultrasound in thedirection of the transducer and as a result, strong variations in acousticimpedance does not automatically result in high intensity in the amplitudeimage.

5.2 Algorithm for finding the apexAs mentioned above, some requirements have to be made on the images inwhich the apex is supposed to be located. First of all the images have to beapical. Also, the apex has to be present in the images.

After establishing that the apex is relatively still during the heart cycle, time-averaging methods can be used. The information that can be used in findingapex is thus:

• Apex is relatively still during the heart cycle• The mean velocity is low for apex• Apex should lie on an edge in the vertical direction

The first step is to apply a derivative over multiple pixels in a verticaldirection. The theory for this is described in section 4.2.1.1. The strongestpositive values of this derivative are extracted. This is then done for all theavailable time frames and averaged. Every pixel then has a value between 0and 256. If a pixel has a value of 256, it means that the pixel lies on a strongedge, which does not move, in every time frame. The averaging process leadsto a reduction of noise. This is also described above in section 4.1.4.

The next step is to extract pixels that have a high derivative value and that, atthe same time, have a mean velocity close to zero. A low value of the meanvelocity means that the area is quite still during the heart cycle.

When pixels that correspond to an edge and that have a low velocity have beenextracted, it turns out that the major part of these pixels lies in the apex area.

40

Some pixels that do not coincide with the apex also occur, probably due todisturbances and artefacts. To reduce the candidate points to only one point,the median value of the indexes are taken in both the range direction and thebeam direction. Taking the median value instead of the mean value reduces theeffect of the pixels coming from the noise.

Below it is illustrated how the pixels where the apex is supposed to be locatedare reduced from including all the pixels to only one pixel. Since the apex issupposed to lie in the same position during the whole heart cycle, the imagesbelow are in one time frame, but the same kinds of illustrations can bedisplayed for any time frame.

Figure 29 - Step 1: Taking the derivative of the image leads to reduction of points wherethe apex is supposed to lie

41

Figure 30 - Step 2: Summation of derivative images over time

Figure 31 - Step 3: Extracting the pixels with low velocities

After these steps, the images from step 2 and step 3 are summarised and theresulting picture is thresholded. The remaining pixels are overlaid on thenormal image and results in the following image:

42

Figure 32 - Step 4: Thresholding the summated image

Figure 33 - Step 5: Taking the median value of the candidate points of the image in step 4

5.2.1 Results and reliabilityThe apex is located in the correct area in more or less all ultrasound images.However, in one of 25 images the location does not coincide with the rightarea. In this image the stationary reverberations are quite large and affects theoutcome. On the whole, it can be said that stationary reverberations willdisturb the algorithm, since the algorithm is, among other things, based on therelative stationarity of the apex.

43

5.2.2 Comments on the source fileThe algorithm for finding the apex is implemented in the file findapex2.m.There are several parameters that can be altered in the algorithm for findingthe apex. Of course, if the values are altered the outcome will also change. Theparameters and their current values are:

• derpictures: This variable is a three dimensional tensor, containingmatrices, where each matrix in turn is a result of the application ofapplying a derivative filter on the original image with function der.m.In this step the threshold parameter can be determined. Since the heartwall in the apex area is not always distinct, a low value on thisthreshold parameter has been chosen so that the edge will not befiltered out. The value on the threshold parameter has also been chosento be positive since the slope is known to be positive, i.e. the apex islocated in an area where the pixel values are increasing with depth. If ahigher value on this parameter is chosen there is a possibility that thearea where the apex is located will be filtered away and thus anincorrect location, or possibly no location, will be found. If a lowervalue on the parameter is chosen the accuracy will be lower.The current value on the threshold parameter is 0,03.

• factor: This variable is a number that determines the thresholding ofthe TVI. This is the number sent to the function, tvitest.m (seeAppendix 1). The TVI is quantified, described in section 3.2.2, and thelowest velocities are set to a constant value. factor=3 means thattissues moving with velocities up to three times this value areextracted. Consequently, this value allows the apex to have a smallmovement, but yet be in a relatively fixed position during the entireheart cycle, and not be filtered away. If the value on factor is chosen tobe lower, there is a possibility that areas with small movements arefiltered away. On the other hand, if the value on factor is chosen higherthe accuracy will be less since a larger area where the apex can belocated will result.

The functions are now quite slow and time consuming. The main reason forthis is that it takes time to take the derivative of all the images in the heartcycles. One way to speed things up is to reduce the number of frames used andonly take the derivative of, for instance, every tenth image or perhaps evenfewer. This will however reduce the accuracy in the determination of thelocation of the apex. Still, the accuracy will probably be good enough since theassumption that the apex is relatively still is in turn an approximation. Anotherway to speed up the calculations could be to first locate the area where theapex is located and then take the derivative of only this area instead of thewhole image.

5.3 Algorithm for finding the atrioventricular planeWhen locating the AV plane in every time frame, it is important to start outfrom a frame where the AV plane is trustworthy located. This is done inmultiple steps:

• To make use of the tissue velocity information, determine a place in theheart cycle where the AV plane has a high velocity. This place could

44

for instance be represented by a time frame corresponding to one fourthof a heart cycle, starting at the R-peak, i.e. a little way into the systolicphase of the ventricles. In this position, the AV plane has a highvelocity and the valve between the ventricle and atrium is closed.

• Extract images that correspond to the chosen point in the heart cyclewith help of ECG information.

• Take the derivative in the vertical direction of the extracted images.(Described in section 4.2.1.1) Extract only the strongest derivatives andform thresholded images. An overlap of the derivative images results inpixels that are candidates to the location of the atrioventricular plane.

• Exclude the areas corresponding to the blood flow using the velocityinformation as described in section 2.4.5.1.

• Extract tissue with high velocities (including the AV plane) bythresholding the tissue velocity information. This results in an imagewith selected points where the AV plane is supposed to lie.

• Combine the information from the derivative and the velocityinformation. This will reduce the allowed pixels further, resulting in afew candidate points.

• Taking the median value of these points along each beam results in amaximum of one pixel along each beam. The median value is used toreduce the effect of disturbances.

• Since a curve is needed, the given points have to be extra- andinterpolated, demanding that the curve does not make any suddenshifts, so that every beam has a pixel value where the AV plane islocated.

When the AV plane has been found in one image, the information of thelocation of this curve is used for calculation on where the AV plane is locatedin adjacent frames. By predicting the location of the AV plane and combiningthis information with the derivative of the image it will be possible to reducethe allowed pixels where the AV plane could be. A curve is then achieved inthe same way as the curve in the first reference frame. The prediction on thelocation of the AV plane in the next frame is done by using the ECGinformation to determine in which direction the AV plane moves.

Below is an illustration of the sequence of images leading to a curverepresenting the AV plane.

45

Figure 34 - Step 1: Extracting the derivatives

Figure 35 - Step 2: Combine derivatives and TVI

46

Figure 36 - Step 3: Taking the median values of the candidate points

Figure 37 – Step 4: Extrapolation, interpolation and adjusting the curve representing theAV plane

5.3.1 Results and reliabilityThe determination of the location of the AV plane in a frame where thevelocity is high is stable. The AV plane is found in all the ultrasound imagesthe function has been tested on. However, on a small amount of the images,the curve approximating the AV plane follows the inner wall upwards towards

47

the apex instead of crossing the heart wall in the same height as the AV planeis located.

The method for tracking the AV plane has proven to be less reliable. The curveapproximating the AV plane is not always exactly where the AV plane is. Yetthis method works fairly well since it never gets off track completely. Still itcannot be used without any refinements. One reason for the lack of stability isprobably that the location of the AV plane is difficult to find when the valve isopen; since the method is based on horizontal edge finding and when the valveis open there is no distinct line to be found where the AV plane is supposed tobe located.

5.3.2 Comments on the source fileAs for the location of the apex, there are values on several parameters that canbe chosen in the source file testavplane.m.

• factor: Just like the algorithm for finding the apex the function der.m isused. This time the value on factor can be chosen higher since therealways is a distinct horizontal edge where the AV plane is located, atleast for the frame chosen where the velocity is high and the valve isclosed. The value on factor, i.e. the threshold value, is chosen to 0,2. Ifa higher value is chosen there is a risk that there will not be enoughpoints represented to get an accurate line representing the AV plane.For the tracking of the AV plane during the heart cycle a value onfactor of 0,1 is chosen since the AV plane is not distinct in all phases ofthe heart cycle since the valve is open in some points.

• fac: This variable is a measure on how many percent of the pixels ofthe extracted derivative points that are selected. In this case, 30% of thederivatives with the highest values are extracted. If a lower value ischosen, the number of pixels selected will not be many enough andthereby will not result in a curve representing the AV plane. If a highervalue is chosen the accuracy will be reduced and the location of the AVplane will be imprecise.

• s: This parameter describes how smooth the curve representing the AVplane shall be. s is a measure of how many known points that are takeninto account when determining the value in a certain point. If s is large,jumps can occur, thus allowing the valve to be open. If a lower value ischosen, there is a risk that extreme values will remain. The currentvalue of s is 3.

The speed of the function locating the AV plane in one frame is quite fast,but one possible speed-up could be to determine the area where the AVplane is located before taking the derivative. The algorithm for tracking theAV plane in the entire heart cycle is relatively slow, but since there aremany frames present, not much can be done to reduce the required amountof time.

To improve the quality of the algorithm for finding the AV plane andtracking it, the concept of strain can be used to give the extra informationneeded. The strain is highest in the heart wall where the AV plane crosses.

48

5.4 Algorithm for finding the crossings between the AVplane and the heart walls

Having found the AV plane, it is desirable to find the two points, called theAV points, that correspond to the crossings between the heart walls and theAV plane. If the walls of the heart could be found in a way similar to the waythe AV plane is found, it would be an easy task to find the crossings. Theproblem is that the walls are parallel to the ultrasound beams, and as aconsequence they do not always return a strong echo to the probe. As a result,it is very difficult to find more than parts of the walls. In detecting the walls,both the amplitude information and the Tissue Velocity Information of theheart can be used. A number of techniques for finding and enhancing the wallsin an image are described below.

• Subtraction of the derivative in the beam directionA well-known technique for enhancing edges in an image is derivativefiltering. Taking the derivative in the beam direction of the ultrasoundimage gives an image with high values along the inner and outer edgesof the vertical heart wall and very low values (close to zero) in themiddle of the wall. Subtracting the derivative from the amplitudeimage therefore enhances the heart wall in the image.

Figure 38 - Derivative in the beam direction

• Subtraction of the derivative in the range directionThe AV plane often returns strong reflections, which are confusingwhen localising the walls. If the reflections from the AV plane can beremoved in the amplitude image, it will lessen the risk of finding thewalls where the reflections from the AV plane are strong. Thederivative taken in the vertical direction has high values at the AVplane. Subtracting the derivative from the amplitude image willdecrease the intensity at the AV plane in the amplitude image.

49

• Enhancing the strongest echoesThe heart walls in an apical image should theoretically be easy to findby extracting the two strongest peaks in the amplitude at every depth ofthe image. Because of noise and other disturbances that arise from thetissues surrounding the heart and from the technical equipment used inthe examination, this cannot be used as a reliable method for findingthe walls. However, it often gives a good estimate of the location of theheart walls, especially if the result is thresholded. Thus, only the strongpeaks in the amplitude image are used, and the weak ones, that aremore likely to be due to noise, are removed.

Figure 39 - Extraction of the two strongest peaks in the range direction

• Tissue Velocity InformationThe TVI returns a matrix containing the velocities measured in theheart tissue. The blood in the left ventricle generally has a high meanvelocity compared to the velocity of the heart walls. The bloodvelocities are removed by highpass filtering and areas in the imagecorresponding to blood therefore have low velocities in the matrixcontaining the TVI. The AV plane, on the other hand, often has highvelocities in the TVI. The TVI can thereby be used in different ways.By removing the areas with low TVI from an amplitude image, theinterface between tissue and blood should be enhanced. By removingthe areas with high TVI from the amplitude image it should be possibleto reduce the effect of the AV plane when trying to find the walls.

50

Figure 40 - The Tissue Velocity Information of the heart

Using the methods described above, it should be possible to find a curve thatapproximates the wall, but to find the AV points it is not necessary to trace theentire wall. Theoretically, the two points should be possible to find byextracting the two strongest peaks in the amplitude information just over theAV plane. This can be done in the untreated ultrasound image or in anamplitude image in which the walls have been enhanced in order to improvethe stability of the method. In Appendix 1 (avpoints.m), the Matlab code forboth alternatives is found. The Matlab code that renders the weighted image isfound in weightimage.m. The methods used to render the weighted image are;subtraction of the derivative in the beam direction, addition of the strongestpeaks and finally subtraction of the TVI in order to reduce the reflections fromthe AV plane. The original image and the weighted image are displayedbelow.

51

Figure 41 - The original untreated image

Figure 42 - The weighted image

Even when using the weighted image, the method is far from stable. Therefore,it also requires relatively good estimations of the areas in which the AV-pointsare to be found. Taking the time average of the ultrasound image over twoheart cycles practically always gives an image in which the heart walls caneasily be found. Knowing the depth of the AV plane for a certain time frame,the time average can be used to find approximate values of the beam co-ordinates of the AV-points. The search for better values of the co-ordinates(using the weighted image for the time frame of current interest) can then berestricted to the areas surrounding the approximated points.

52

5.4.1 Results and reliabilityThe method manages to locate both the AV-points satisfactory within the heartwall in approximately 70-75 % of the images that it has been tested on. Themethod has been tried both using the weighted image and using the originalultrasound image. No substantial differences were found and therefore it is notpossible to motivate the calculations it takes to render the weighted image.

The result on a single picture depends very much on how well testavplane.mlocates the AV plane (see section 5.3). The algorithm for finding the AV-points is based on the result of testavplane.m since the idea is to find the twopoints belonging to the AV plane that are most likely to represent the crossingswith the heart walls.

Two examples of the density along the AV plane in a weighted image areshown below. In the first plot the two peaks representing the heart walls caneasily be seen. The second plot shows how difficult it is to discern the wallswhen the amplitude information is poor.

As mentioned, the heart walls are almost parallel to the ultrasound beams andtherefore the reflections from the walls are often poor. This is one of the mainreasons why it is so difficult to develop a stable algorithm for finding thewalls. Another source of error is the reflections from the mitral valve. Whilethe walls are almost parallel to the ultrasound beams, the valve is almostperpendicular to the direction of propagation of the beams. Consequently, thevalve will give rise to a strong intensity peak in the amplitude image, whichcan easily be taken as one of the walls if it is not combined with otherinformation (see below in section 5.4.2).

The final results (found using a weighted image) are displayed below.

Figure 44 – Intensity along the AVplane in a distinct image

Figure 43 – Intensity along the AVplane in an indistinct image

53

Figure 45 - The points located in the distinct image

Figure 46 - The points located in the indistinct image

5.4.2 Comments on the source filesThe Matlab code is commented in the files, but a few things should be saidabout the choice of the constants in the files avpointstart.m and avpointiter.m.

avpointstart.m:• constant1: This primitive wall-finding algorithm finds the wall as the

point in the AV plane where the mean value of the amplitude intensity,calculated over a number of ranges, is at its maximum (see figure 43,44). The value of constant1decides over how many ranges the density,

54

i.e. the mean value of the amplitude intensity, is calculated. The largerconstant1 is, the less sensitive the method is to noise and the less likelyit is that the method will fail completely in detecting the walls. On theother hand, with a very large value on constant1, the method will get avery bad precision. It is also more likely that other features than thewall will contribute to the density.

• constant2: Noise and various features in the heart, such as the mitralvalve, sometimes contributes to the density in such an extent that oneof the “walls” is found in the middle of the left ventricle. Since the firstfound wall is almost always found in a satisfactory way, it is possibleto reduce the risk of finding the second wall in the wrong place bydemanding that the number of beams separating the walls must exceedconstant2.

• constant3: As mentioned, the mitral valve often gives rise to strongreflections and it is therefore likely that the density will be high wherethe mitral valve crosses the AV plane. The result is that one of the AVpoints is found at the valve instead of in the wall. When the valve is notclosed, some of the points found by testavplane.m, belonging to thevalve, can be removed from further processing by applying a constraintthat determines how much the depth of an AV-point is allowed todiverge from the median depth of the AV plane.

avpointiter.m:• constant1: see constant1 in avpointstart.m• constant2: The function avpointiter.m updates the positions of the two

AV-points, given the approximated positions. constant2 is the numberof beams that are allowed to differ between the new and the old point.The old point is originally found by avpointstart.m and in most cases itlies close to the wall. If no constraints are introduced on how much thenew and the old position are allowed to differ, avpointiter.m willsometimes find a stronger peak in the density that does not lie in thesurroundings of the wall.

• constant3: Represents the number of ranges that are allowed to differbetween the new and the old point.

The running time for the program is not optimized. One way of speeding upthe calculations is to calculate the weighted image only for the area around theAV plane, instead of calculating the weighted image for the entire frame, as ispresently done in the Matlab files in Appendix. For the current values of theconstants, see the source files in Appendix 1.

5.5 Fitting a parabola to three points in the heart wallTo do a good estimation of the volume of the left ventricle based on anultrasound image, it is necessary to locate the inner edges of the heart wall.This task can be performed by applying an advanced edge detection algorithmto the image. However, this algorithm requires a fairly good estimate of thelocation of the wall to start with. It is possible that this estimation can be done,using only the three points found in the previous sections, that is apex and thetwo AV-points.

55

One possible way is to let the left ventricle be approximated by an ellipse andto use the three points to calculate its size and rotation. This was tried on a fewimages, but it was soon made clear that the approximation was not goodenough, since the actual shape of the ventricle varies a lot from person toperson.

The work was instead focused on fitting a parabola to the three points, with theconstraint that the top of the parabola should be located in apex. It was shownthat this was a better estimation of the heart wall, and that it would probablygive a curve that follows the heart wall well enough to be used as a start curve.

A parabola is defined by the following relation (in a Cartesian co-ordinatesystem):

ycbxax =++2

a, b and c are constants. The parabola can be rotated, giving one moreconstant, ϕ, which is the angle of rotation. To simplify the calculations, the co-ordinate system can be rotated by -ϕ. Set -ϕ = θ.

Figure 47 - Rotation of the co-ordinate system with an angle θθ

The relation between x and y will then become:

'''2 ycbxax =++

θθ sincos' yxx +=θθ cossin' yxy +−=

eq. 26 must be fulfilled in the three points (x1’, y1’), (x2’, y2’) and (x3’, y3’). Inaddition, the constraint stating that the top of the parabola should be located inapex must also be fulfilled. After rotating the co-ordinate system, this

θ(x1,y1)

(x2,y2)

(x3,y3)

(eq. 25)

(eq. 26)

(eq. 27)

56

constraint simply states that the derivative in apex (x2’, y2’) is zero. Theconstraint can be written as:

0'2 2 =+bax

Put together, this information gives four equations to solve. The threeequations in the points (x1’, y1’) and (x2’, y2’) can be used to express a, b, and cin terms of θ (remember that x1’, y1’, x2’, y2’ are all functions of θ):

221

21

)''(

''

xx

yya

−−

=

'2 2axb −=2

1121 )'(''2' xaxaxyc −+=

All that remains now is to find the θ that solves the last equation, that is:

''' 332

3 ycbxax =++

Unfortunately this is a non-linear equation containing both sine and cosineterms. Instead of trying to solve the equation analytically, it can be re-writtenand solved as a minimization problem. The function to be minimized withrespect to θ is:

''' 332

3 ycbxaxf −++=

Having found the θ that minimizes the function, it is an easy task to calculatethe numerical values of the constants a, b and c. The parabola can then bedrawn in the ultrasound image and in most cases it will be a fairly goodapproximation of the wall, as can be seen in figure 48. The Matlab code for thefitting of a parabola is found in Appendix 1 in the file named parabel.m.

(eq. 28)

(eq. 29)

(eq. 30)

(eq. 31)

57

Figure 48 – Result of the fitting of a parabola

58

6 CONCLUSION

6.1 Results and reliabilityThe method for finding the apex is functioning on the majority of the testedimages. The conditions on the images are that they are apical 2-chamber viewsand that the apex is actually present on the images. One prerequisite that couldincrease the accuracy in the finding of the apex is to further reduce thestationary reverberations, which if they are too distinct can cause the methodfor finding the apex to instead localise the apex to the area of thesereverberations. The reason for this is that the stationary reverberations and theapex behave in a similar manner. They all give distinct echoes and have a verysmall displacement during the heart cycle. Unless the present filter that has thepurpose of reducing the stationary reverberations is improved, the problemwill remain.

The method for finding the atrioventricular plane in one specific time frame isalso quite robust and the AV plane is located in every image tested on. Thiscertain time frame corresponds to the time in the heart cycle a little way intothe systolic phase of the ventricles where the valves are closed. Sometimes thecurve approximating the AV plane is not exactly right located in the edges ofthe plane. If the curve follows the inner wall upwards towards the apex, thisdoes not have to be a problem. If the purpose is to approximate a curve to theinner heart wall, the AV plane is combined with the approximated wallsanyway, and the exact location of the crossing between the walls and the AVplane is of no particular interest.

The tracking of the AV plane in an arbitrary time frame is not quite as stableas it is for the time frame corresponding to the time described above. However,in finding a starting curve for the advanced wall-searching algorithm, it ispossible to choose the time frame in which to start. In the following timeframes, the curve in the previous time frame can be used to find the newlocation of the walls. Finding the right time frame initially requires an ECGcurve.

The stability of the method for finding the points where the atrioventricularplane crosses the walls of the left ventricle depends on the stability of thetracking of the AV plane. Even if the AV plane is found correctly, there is arisk of finding one of the AV points at the mitral valve in the middle of the leftventricle instead of finding it at the heart wall. The reason for this is that thevalve gives rise to strong reflections in the amplitude image while the walls,that are parallel to the direction of propagation of the ultrasound beams, oftenreturn weak reflections. The method has shown a satisfactory result on 70-75% of the images that it has been tested on.

Approximation of the heart walls in the left ventricle, starting from the threedetected points, can be done in many ways. After first approximating anellipse to the heart walls it turned out that a better approximation would be the

59

fitting of a parabola to the three points. The result will probably approximatethe walls well enough for a wall-searching algorithm, based on active contoursalgorithms (see section 6.3), to work. However, the wall-searching algorithmwill require a closed curve to start with. Such a curve can easily be obtained bycombining the parabola with the curve approximating the atrioventricularplane.

6.2 Usefulness and possible improvementsThe methods developed can easily be used as they are. They will probably be agood basis for the further development of methods detecting the entire heartwall. However it must be stated that the developed methods are not minimizedin time consumption, since the objective of this work was only to findappropriate methods. Several adjustments will probably speed the methods upnoticeably. For instance the derivative of the images is taken in all methods.This derivative filter is applied to the whole image. By instead discerning thearea of interest before applying the filter, the process will probably be speededup. Another possible adjustment is to reduce the number of time frames usedwhen determining the location of the apex. The accuracy will probably not beworsened to a great extent by reducing the time resolution, since the largestapproximation is already done when assuming apex to be still during the heartcycle.

Another possible method of locating the three points in the heart wall is to usewhat is referred to as “learning systems” or Artificial Neural Networks (ANN).Computer systems can be trained with old ultrasound images to recognisecertain features in an image of the heart. The great benefit in using ANN isthat they are less sensitive to noise. After being trained with enough trainingdata they can be used to identify details in an image, even if noise is present.Large amounts of training data are available in the form of ultrasound images.

6.3 Further developmentsIn section 3, it was mentioned that the outcome of this project was originally todetect the entire inner wall of the heart. The task was later, because of thelimited time, restricted to finding only the apex and the crossings between theheart wall and the AV plane, and to, using the points found, estimate theposition of the wall. Consequently, the interest for developing a program thatcan detect the walls more exactly remains.

The basic idea is to start with a curve that estimates the wall and then toimprove the curve bit by bit using active contour algorithms. This is where theresults of this work are of interest. A combination of the AV plane and theparabola fitted to the three detected points produces a curve that should to begood enough to start with.

One method used to obtain a better curve is to rewrite the problem as anenergy minimizing process. An energy function is constructed and is used tocalculate the “energy” associated with an arbitrary curve. The energy functionis constructed so that the desired properties, such as smoothness, reduces theenergy and unwanted properties, such as deviations from areas in the imagewith large intensity gradients, increases it. With this method it is possible to

60

obtain a curve that follows the edge (i. e. the line where the absolute value ofthe gradient is at its maximum), at the same time as minor disturbances in theedge are ignored. For more details on this method see [24].

61

7 REFERENCES

[1] B. Sonesson and G. Sonesson, Människans anatomi och fysiologi, 2 ed.Falköping: Almqvist & Wiksell Förlag AB, 1993

[2] B. Jacobson, Medicin och Teknik, Lund: Studentlitteratur, 1995[3] RF Farr and PJ Allisy-Roberts, Physics for Medical Imaging, London:

Harcourt Brace and Company, 1998[4] J. T. Bushberg, J. A. Seibert, E. M. Leidholdt, JR, J. M. Boone, The

essential physics of medical imaging, Baltimore: Williams & Wilkins,1994

[5] G. Rizzatto, “Ultrasound transducers”, European Journal of Radiology,vol. 27, pp. 188-195, 1998

[6] M. Alam, C. Höglund and C. Thorstrand, ”Longitudinal systolicshortening of the left ventricle: an echocardiographic study in subjectswith and without preserved global function”, Clinical Physiology, vol.12, pp. 443-452, 1992

[7] A. Heimdal, A. Stoylen, H. Torp and T. Skjaerpe, “Real-Time StrainRate Imaging of the Left Ventricle by Ultrasound”, Journal of theAmerican Society of Echocardiography, vol. 11, pp. 1013-1019, 1998

[8] K. Miyatake, M. Yamagishi, N. Tanaka, M. Uematsu, N. Yamazaki, Y.Mine, A. Sano and M. Hirama, “New Method for Evaluating LeftVentricular Wall Motion by Color-Coded Tissue Doppler Imaging: InVitro and In Vivo Studies”, Journal of the American College ofCardiology, vol. 25, pp. 717-724, 1995

[9] M. Uematsu, K. Miyatake, N. Tanaka, H. Matsuda, A. Sano, N.Yamazaki, M. Hirama and M. Yamagishi, ”Myocardial VelocityGradient as a New Indicator of Regional Left Ventricular Contraction:Detection by a Two-Dimensional Tissue Doppler Imaging Technique”,Journal of the American College of Cardiology, vol. 26, pp. 217-223,1995

[10] S. Urheim, T. Edvardsen, H. Torp, B. Angelsen and O. A. Simseth,”Myocardial Strain by Doppler Echocardiography”, Circulation, vol.102, pp. 1158-1164, 2000

[11] V Metzler, M Puls, T Aach, “Restoration of Ultrasound Images byNonlinear Scale-Space Filtering”, Dougherty, Astola (Eds.), NonlinearImage Processing XI, Procs. SPIE 3961, pp. 69-80, 2000

[12] Jae K. Oh, “Echocardiography for the evaluation of systolic and diastolicfunctions”, ACC Current Journal Review, vol. 9, pp 74-76, 2000

[13] A. Pasquet, M. J. Garcia and J. D. Thomas, “New approaches to theDoppler echocardiographic assessment of diastolic function: fromresearch laboratory to clinical practice”, Progress in PediatricCardiology, vol. 10, pp 105-112, 1999

[14] E. O. Ofili and N. C. Nanda, “Color Doppler imaging of themyocardium: current status and potential clinical applications”,Ultrasound in Medicine & Biology, vol. 24, No 2, pp 177-185, 1998

[15] L-Å. Brodin, J. van der Linden and B. Olstad, ”EchocardiographicFunctional Images Based on Tissue Velocity Information”, Herz, vol. 23,pp. 491-498, 1998

62

[16] J. A. Jensen, Estimation of Blood Velocities Using Ultrasound,Cambridge: Cambridge University Press, 1996

[17] B. F. Byron, L. S. Rath, P. Stuhlmuller, H. E. Melton Jr and D. J.Skorton, “Estimation of Left Ventricular Cavity Area With On-Line,Semiautomated Echocardiographic Edge Detection System”,Circulation, vol. 86, pp. 159-166, 1992

[18] R. Sapra, B. Singh, D. Thatai, D. Prabhakaran, A. Malhotra and S. C.Manchanda, “Critical appraisal of left ventricular function assessment bythe automated border detection method on echocardiography. Is it goodenough?”, International Journal of Cardiology, vol. 65, pp. 193-199,1998

[19] J. E. Pérez, A. D. Waggoner, B. Barzilai, H. E. Melton, J. G. Miller andB. E. Sobel, ”On-Line Assessment of Ventricular Function by AutomaticBoundary Detection and Ultrasonic Backscatter Imaging”, Journal of theAmerican College of Cardiology, vol. 19, pp. 313-320, 1992

[20] E. Hammarström, Doppler Ekokardiografi, Bollnäs: EskilHammarström, 1996

[21] B. A. J. Angelsen, Waves, Signals, and Signal Processing, Vol I & Vol II,Trondheim: Emantec, 2000

[22] R. C. Gonzales and R. E. Woods, Digital Image Processing, USA:Addison-Wesley, 1993

[23] L. I. Rudin, S. O. Osher and E. Fatemi, “Nonlinear total variation basednoise removal algorithms”, Physica D, vol. 60, pp. 259-268, 1992

[24] B. Olstad and A. H. Torp, “Encoding of a priori Information in ActiveContour Models”, IEEE Transactions on Pattern Analysis and MachineIntelligence, vol. 18, pp. 863-872, 1996

63

8 APPENDIX 1: SOURCE FILES

64

9 APPENDIX 2: DIVIDING THE WORK

The demand on master projects performed by two students in the Division ofMedical Engineering is that the work can be divided into two separate parts.

In the beginning of the work, the purpose was to divide the work so that onepart would be focused on the use of TVI and the other on amplitudeinformation. During the work it turned out that the TVI didn’t contain enoughinformation to base wall-finding methods on. Therefore the work wasreorganized and divided into the following two parts:

1. Locating the apex and the AV plane (Annika)2. Determining the crossings between the AV plane and the heart walls

and evaluating methods of approximating the walls (Tove)

The theory and development tools are the same for both assignments and thewriting of these parts of the report have been divided. The report has beenwritten and divided as follows:

2-2.4 Annika2.5-6 Tove3.1-3.1.1 Annika3.1.2-3.2.3 Tove3.3 Annika4-4.1.1 Tove4.1.2-4.1.4 Annika4.1.5-5.1.2 Tove5.2-5.3 Annika5.4-5.5 Tove

65

10 APPENDIX 3: NOMENCLATURE

Apex The bottom of the heartAV plane Atrioventricular plane, valve plane between

ventricle and the atriumAV points The crossings between the AV plane and the heart

wallsComplex conjugate The complex conjugate of a is denoted a*Consequently QDiastole Relaxation phase of the heartECG Electrocardiography, monitoring of electrical

currents of the heartEchocardiography Ultrasound imaging of the heartFourier Transform Mathematical transformation to the frequency

domain. The fourier transform of f is denotedff ˆ)( =ℑ

GcMat Program developed by Vingmed, toolbox to MatlabSystole Contraction phase of the heartTVI Tissue Velocity Information