WASHINGTON UNIVERSITY JEE 498 Senior Design Ultrasound Elasticity Imaging Final Report Steven Goodwin Mark Green 12/16/28
ABSTRACT Within this report, we have developed a useful way of retrieving a strain image from an organic culture through compression and ultra sound imaging. Two signals, one before compression and then one afterwards, are used to produce a strain image. The two signals are compared, their differences are analyzed, a displacement image is formed, a clean up phase is introduced, and then the derivative of this signal is taken to produce the much needed strain image. A simulation of human tissue was formed in the use of tofu samples. Being able to develop these images can prove to be more beneficial to person who wants to shy away from having painful and sometimes unnecessary biopsies. INTRODUCTION Ultrasound imaging is a non-invasive medical test that helps doctors diagnose and treat a variety of medical conditions. An ultrasound scan involves exposing a part of the body to high-frequency sound waves to produce pictures of the inside of the body. These ultrasound images are captured in real-time. They show structure and movement of the body s internal organs, as well as blood flowing through blood vessels. Conventional ultrasounds display images in thin, flat sections of the body. The advancements in ultra sound technology include three-dimensional and four-dimensional imaging. 3-D ultra sounds format the sound wave data into 3-D images. 4-D ultra sound is simply 3-D in motion. Ultrasound imaging has helped many physicians to diagnose a variety of conditions and assess organ damage following any type of illness. Doctors are able to evaluate symptoms such as pain, swelling, and infection. Ultrasound is also useful in examining many of the body s internal organs such as the heart, blood vessels, liver, kidneys, uterus and unborn child in pregnant patients, just to name a few. Doctors can use ultrasound as a guide during procedures such as needle biopsies and to diagnose a variety of heart conditions as well as assess damage after a heart attack. Many ultra sound images can help doctors to see and evaluate tumors and other cancerous growths. With knowledge about the speed and volume of blood flow from some ultrasound images, a doctor can often determine whether a patient is a good candidate for a certain type of procedure. The procedure of ultrasound imaging is based on the same principles involved in sonar. When a sound wave strikes an object, it bounces back or echoes. By measuring the echo waves it is possible to determine how far away the object is and its size, shape and consistency. In the medical field, ultrasound is used to detect changes in the appearance of organs, tissues and vessels or detect abnormal masses such as tumors. In an ultrasound examination, a transducer sends the sound waves and records the echoing waves. When the transducer is pressed against the skin, it directs small pulses of inaudible, high frequency sound waves into the body. As the sound waves bounce off of internal organs, fluids, and tissues, the sensitive microphone in the transducer records tiny changes in the sound s pitch and direction. These signature waves are instantly measured and displayed by a computer, which in turn creates a real-time picture on the 2 Goodwin & Green
monitor. One or more frames of moving pictures are typically captured as still images. (The Radiology Information Resource for Patients) METHODOLOGY Our path to greatness started with learning and understanding the code of previous projects. Our initial step was to develop and recognize two signals. The first, before the compression and second, examining the tissue sample after compression. These two signals are placed on top of each other to compare their peaks and valleys. One looked for similarities and then how far off or shifted apart they were. This is better known as getting the displacement image. A cross correlation function was used to perform this in the algorithm. Now this developed the much wanted displacement image. A displacement plot will be generated. This will aid in detecting whether the compression and the displacement due to the compression was linear in nature. By taking the derivative of this signal, one can obtain the strain plot. If this plot is linear without and blips, then you have achieved a good strain image. 3 Goodwin & Green
Tfu2.mat results Figure1 2 15 1 5-5 -1-15 -2-25 2 4 6 8 1 12 14 16 18 2 This is a figure of (b_data) and (b_data2). We focused on column 177, and row 3 to 414. This shows that the displacement of the two signals is around 6. 2 x 18 Figure 2 1.5 1.5 -.5-1 -1.5-1 -8-6 -4-2 2 4 6 8 1 This is a figure of our cross-correlation. When we magnify the image, the peak value is located around 21. This is telling us that the variable shiftlocation is 21. 4 Goodwin & Green
Figure 3 2 15 1 5-5 -1-15 -2-25 2 4 6 8 1 12 14 16 18 2 This is a figure of the two signals with one of them shifted by the displacement amount found by cross-correlating. This figure is a check to see if the signals will line up on top of each other. 5 Goodwin & Green
Plot of Displacement Image 6 5 4 3 2 1 2 4 6 8 1 12 This is a displacement plot of one column of tfu2.mat. Plot of Strain Image 2 1.5 1.5 -.5-1 1 2 3 4 5 6 7 8 9 1 This is a plot of the strain. It is not a good picture because the strain is the derivative of the displacement image. This means that it is the slope of the line. Slope equals rise over run. So as you can see in the displacement image that as the line goes up it levels out and our strain sees this and goes back to zero. 6 Goodwin & Green
Displacement Image 1 1 2 3 4 5 6 7 8 9 1 11 5 1 15 2 25 9 8 7 6 5 4 3 2 1 This is one of the better displacement images of tfu2.mat. This image shows the compression of the tfu2. This image shows the displacement due to compression to be more or less in certain areas. The area from columns 15 to 225 shows an area of a hard compression. This can be determined from the uniform displacement seen in the circular region. 7 Goodwin & Green
Strain Image 4 1 2 3 4 5 6 7 8 9 1 11 3.5 3 2.5 2 1.5 1.5 5 1 15 2 25 This is our strain image. We get this when we take the derivative of our displacement image. You can see that where it gets a lighter blue area it is showing a harder surface, thus showing that this area has something in it making it not compress so easily. 8 Goodwin & Green
Tufu1.m results Figure 1 4 3 2 1-1 -2-3 -4 2 4 6 8 1 12 14 16 18 2 This is a figure of (b_data) and (b_data2). 5 x 16 Figure 2 4 3 2 1-1 -2-3 -1-8 -6-4 -2 2 4 6 8 1 This figure shows our cross-correlation. When we magnify the image, the peak value is located a little past zero. Figure 3 9 Goodwin & Green
4 3 2 1-1 -2-3 -4 5 1 15 2 25 3 35 4 This is a figure of the two signals with one of the signals shifted by the shift displacement amount found by cross-correlation. This is a check to see if the signals will line up on top of each other. As you can see these signals do not line up on top of each other. Our program was not compatible with tfu. 1 Goodwin & Green
Plot of Displacement 6 5 4 3 2 1 2 4 6 8 1 12 This is a displacement plot at one column of tfu1.mat. Plot of Strain 7 6 5 4 3 2 1-1 1 2 3 4 5 6 7 8 9 1 This is a plot of the strain. It is not a good picture because the strain is the derivative of the displacement image. This means that it is the slope of the line. Slope equals rise over run. So as you can see in the displacement image that as the line goes up it levels out and our strain sees this and goes back to zero. As again as in tfu2, tfu1 does not produce a good derivative of the strain image. 11 Goodwin & Green
Displacement Image 1 1 2 3 4 5 6 7 8 9 1 11 5 1 15 2 25 9 8 7 6 5 4 3 2 1 This is the displacement image from tfu1. It is one of our better images. Strain Image 4 1 2 3 4 5 6 7 8 9 1 11 3.5 3 2.5 2 1.5 1.5 5 1 15 2 25 This is the strain image. As you can see this strain image is not too good. 12 Goodwin & Green
ElasticitySimimages.mat 13 Goodwin & Green
ElasticitySimImages.mat results Figure 1 4 3 2 1-1 -2-3 -4-5 -6 2 4 6 8 1 12 14 16 18 2 This is a figure of the variables (impost) and (impre) that we set to signals. The signals show a displacement of maybe one if that. They seem to be right on top of each other. From where this picture of the figure is taken, I think this plot shows the beginning of the run of the program. At the beginning they start at the same time and then the start to separate. Figure 2 4 3 2 1-1 -2-3 -4-1 -8-6 -4-2 2 4 6 8 1 This is a figure of our cross-correlation. When we magnify the image, the peak value is located around, or maybe one. 14 Goodwin & Green
Figure 3 4 3 2 1-1 -2-3 -4-5 -6 5 1 15 2 25 3 35 4 This is a figure of the two signals with one of the signals shifted by the amount found by cross-correlating. The figure is a check to see if the signals will line up on top of each other. As you can see they are not. 15 Goodwin & Green
Plot of Displacement Image 6 5 4 3 2 1 2 4 6 8 1 12 This is a plot of our displacement image at one column of elasticitysimimages.mat. Plot of Strain Image 1.8.6.4.2 -.2 -.4 -.6 -.8-1 1 2 3 4 5 6 7 8 9 1 This is the plot of our derivative of our displacement image, which is our strain image. As you can see it is not a good strain. From our displacement image the slope of the line is rise over run. As our plot of our displacement image rises, it levels out then goes higher and levels out again. So our derivative sees this going back to zero and our line goes up and down. 16 Goodwin & Green
Displacement Image 2 1 2 3 4 5 6 7 8 18 16 14 12 1 8 6 4 9 2 5 1 15 2 25 This is one of our pictures of our displacement image. Strain Image.24 1 2 3 4 5 6 7 8 9 5 1 15 2 25.22.2.18.16.14.12.1.8.6.4 This is the strain of our displacement image. 17 Goodwin & Green
Matlab codes 1.) immagepractice.m 2.) elaasticitysimimagecode.m 18 Goodwin & Green
immagepractice.m The following matlab code is what we used to run tfu2.mat and tfu1.mat in matlab. We are calling in our immagepractice.m showplots =; for p = 1:256 % this for column 177. %columns 256 p for q =3:12; %:378); %rowsq = 378 qrange = q:q+36; y =(b_data(qrange,p)); %setting variable to signal y1 =(b_data15(qrange,p)); %setting variable to signal samplerate = 5; yup = resample(y,samplerate,1); y1up = resample(y1,samplerate,1); if (showplots) figure (1) clf plot(yup); %plotting both signals on to each other hold on plot (y1up,'g'); end maxlags = 2*samplerate; [c,lags] = xcorr(yup,y1up,maxlags); %give the shift and shift location of the two signals in question if (showplots) figure(2) clf plot(lags,c); end [maxcross, shiftlocation] = max(c); 19 Goodwin & Green
[shift(q,p)] = lags (shiftlocation); if shift(q,p) < shift(q-1,p)-1 shift(q,p) = shift(q-1,p); end if (showplots) figure(3) %want plot both signals with one of them shifted by the shift amount clf % this is a figure of two signals placed on top of each other % with one signal being shifted plot(1:37,y); hold on plot ([1:37]+shift(q,p),y1,'g'); end end end % for 3:1:12; put a new say shiftcut = shift of the range where shift % is actually asigned % shiftcut = shiftcut = shift(3:1:12,:) figure clf imagesc (shiftcut) figure windowsize = 25; average= filter(ones(1,windowsize)/windowsize,1,shift); imagesc (diff(average)) caxis([ 4]) colorbar 2 Goodwin & Green
ElasticitySimimages.mat The following code was run with elasticitysimimages.mat. It is called our elasticitysimimagecode.m it mirrors our imagingpractice.m code with changes to the parameters. % this is a code that is going to try to run some of the simulations from % the web site. showplots =; for p = 1:256 %1:256 % this for column 177. %columns 256 p for q =3:97; %:378); %rowsq = 378 qrange = q:q+36; y =impost(p,qrange); %setting variable to signal y1 =(impre(qrange,p)); %setting variable to signal samplerate = 5; yup = resample(y,samplerate,1); y1up = resample(y1,samplerate,1); if (showplots) figure (1) clf plot(yup); %plotting both signals on to each other hold on plot (y1up,'g'); end maxlags = 2*samplerate; [c,lags] = xcorr(yup,y1up,maxlags); %give the shift and shift location of the two signals in question if (showplots) figure(2) 21 Goodwin & Green
clf plot(lags,c); end [maxcross, shiftlocation] = max(c); [shift(q,p)] = lags (shiftlocation); if shift(q,p) < shift(q-1,p)-1 shift(q,p) = shift(q-1,p); end if (showplots) figure(3) %want plot both signals with one of them shifted by the shift amount clf % this is a figure of two signals placed on top of each other % with one signal being shifted plot(1:37,y); hold on plot ([1:37]+shift(q,p),y1,'g'); end end end % for 3:1:12; put a new say shiftcut = shift of the range where shift % is actually asigned % shiftcut = shiftcut = shift(3:1:97,:) figure clf imagesc (shiftcut) figure windowsize = 25; average= filter(ones(1,windowsize)/windowsize,1,shift); imagesc (diff(average)) %imagesc(diff(shiftcut)) %caxis([ 4]) colorbar 22 Goodwin & Green
Tfu2.mat results 1. The results did give us a good displacement image. 2. From the displacement image we were able to develop a derivative of our displacement image to get a strain image. 3. Our strain image did show where the elasticity on the tfu2 was hard or soft. 4. There were a lot of blips in the picture which were due to the algorithm we developed. Tfu1.mat results 1. Too many blips and areas of distortion. 2. Our displacement image was showing a lot of blips. 3. Therefore our strain image was not able to see the hard or soft tissue. 4. This had to do with our code. We did not develop a filter to smooth out the blips. ElasticitySimImage.mat results 1. Our displacement image was good. 2. From our color bar we were able to see where the compression of the object was hard or soft. 3. Our strain image was also good. We can see that the elasticity of the object while being compressed, as being hard or soft. 23 Goodwin & Green
Conclusion 1. Overall, the project was successful despite the fact the team had limited knowledge of matlab. 2. The code was the result of trail and error. With the help and suggestions of others, an algorithm was written. 3. Marginal results were achieved using the tfu1.mat and elesticitysimimage.mat. 4. Good results were produced from the tfu.2 mat. 5. Given more time, the use of different filters would have been used to clean up the blips while processing tfu1.mat and the elasticitysimimage.mat. 24 Goodwin & Green
Recommendations 1. To reduce on the errors in our code 2. To produce an algorithm that will have a program to filter out the blips. 3. To advance the algorithm to produce 3-D image in real time. 4. We really did not time our program, but it did take a log time to run, so somehow we could find a way to speed up our time. 25 Goodwin & Green
References The Radiology Information Resource for Patients (28) General Ultrasound Imaging. RadiologyInfo. Retrieved on 12148 from http://www.radiologyinfo.org/en/info.cfm?pg=genus JEE 498 Final Report George Michaels and Mary Watts spring of 28. http://classes.engineering.wustl.edu/jee498/ 26 Goodwin & Green