Académique Documents
Professionnel Documents
Culture Documents
Jose J. Velez-Colon
Dr. Won
EE 454
*There are 2 documents: (1) Transformations on B-Mode 2-D Images and (2) Doppler.
Page 1 of 20
Velez-Colon | EE 454
The ‘bcmode_rf ' variable should be the image because it is the only variable that is 2
dimensional.
3. View the image by typing image(bmode_rf). How well are you able to make out any
structures?
200
400
600
800
1000
1200
1400
1600
1800
50 100 150 200 250 300
It is nearly impossible to see the structures. Perhaps, a trained eye could see them.
Page 2 of 20
Velez-Colon | EE 454
4. Obtain the envelope of the raw image data by constructing the analytic signal img. Remember,
this signal contains the Hilbert transform of the raw data. Use the command hilbert, and pay
attention to what the output of this function is.
After using Hilbert and taking the magnitude of the result we get:
Hilbert without normalization
200
400
600
800
1000
1200
1400
1600
1800
50 100 150 200 250 300
200
400
600
800
1000
1200
1400
1600
1800
50 100 150 200 250 300
Page 3 of 20
Velez-Colon | EE 454
200
400
600
800
1000
1200
1400
1600
1800
50 100 150 200 250 300
1600
1400
1200
Pixel Values
1000
800
600
400
200
0
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5
Gaussian Distribution without logarithmic compression.
Page 4 of 20
Velez-Colon | EE 454
1600
1400
1200
1000
800
600
400
200
0
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5
Page 5 of 20
Velez-Colon | EE 454
spatial map
10
15
20
25
30
35
40
0.0376 0.0378 0.038 0.0382 0.0384 0.0386 0.0388
10
15
20
25
30
35
40
1.125 1.13 1.135 1.14 1.145 1.15 1.155 1.16 1.165 1.17
-4
x 10
Page 6 of 20
Velez-Colon | EE 454
0.6
0.7
0.8
0.9
1.1
1.2
1.3
1.4
1.5
20 40 60 80 100 120 140
0.6
0.7
0.8
0.9
1.1
1.2
1.3
1.4
1.5
20 40 60 80 100 120 140
Page 7 of 20
Velez-Colon | EE 454
200
400
600
800
1000
1200
1400
1600
1800
50 100 150 200 250 300
200
400
600
800
1000
1200
1400
1600
1800
50 100 150 200 250 300
Page 8 of 20
Velez-Colon | EE 454
200
400
600
800
1000
1200
1400
1600
1800
50 100 150 200 250 300
Histogram
1800
1600
1400
1200
Pixel Values
1000
800
600
400
200
0
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5
Gaussian Distribution without logarithmic compression.
Page 9 of 20
Velez-Colon | EE 454
10
15
20
25
30
35
40
0.04 0.041 0.042 0.043 0.044 0.045 0.046 0.047
Page 10 of 20
Velez-Colon | EE 454
10
15
20
25
30
35
40
2 2.05 2.1 2.15 2.2 2.25 2.3 2.35 2.4
-4
x 10
1600
1400
1200
1000
800
600
400
200
0
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5
Page 11 of 20
Velez-Colon | EE 454
0.6
0.7
0.8
0.9
1.1
1.2
1.3
1.4
1.5
20 40 60 80 100 120 140
0.6
0.7
0.8
0.9
1.1
1.2
1.3
1.4
1.5
20 40 60 80 100 120 140
Page 12 of 20
Velez-Colon | EE 454
MATLAB CODE
clc; clear; close all;
load('carotid5') % just change this to carotid9 to get the other results for
% part 2 Didn’t want to waste paper
figure(1)
image(bmode_rf);
%Obtain the envelope of the raw image data by constructing the analytic
signal img. Remember,
%this signal contains the Hilbert transform of the raw data. Use the command
hilbert, and
%pay attention to what the output of this function is.
x = hilbert(bmode_rf);
figure(2)
a=abs(x);
imagesc(a)
title('Hilbert without normalization')
% normalization
amax = max(max(a));
amin = min(min(a));
figure(4)
hist(normalizeImage, bins)
axis([-.5 .5 0 1850]);
xlabel('Gaussian Distribution without logarithmic compression.');
ylabel('Pixel Values');
title('Histogram');
figure(5)
hist(logcompression, bins)
axis([-.5 .5 0 1850]);
title('Histogram after Logarithmic Compression');
% Axial Distance
% lambda = c/f where c is velocity and f is frequency and lambda is axial
% distance.
c= 1580;%m/s
f=40e6;
Page 13 of 20
Velez-Colon | EE 454
lambda=c/f
% spatial map
c=c*100;%cm/s
T=1/f;%sampling period
spatialMap = a(1,:) * c*T/2;
figure(6)
imagesc(spatialMap,posx_bmode,a)
title('spatial map')
figure(7)
spatialMap2 = logcompression(1,:) * c*T/2;
imagesc(spatialMap2,posx_bmode,a)
title('Spatial Map usign logarithmic compression')
figure(8)
imagesc(a(.5:.1:15));
title('range .5 to 15 without logarithmic compression')
figure(9)
imagesc(logcompression(.5:.1:15))
title('range .5 to 15 with logarithmic compression')
Page 14 of 20
Velez-Colon | EE 454
DOPLER EFFECT
Questions.
2. Envelope Detection:
200
400
600
800
1000
1200
1400
1600
1800
20 40 60 80 100 120 140 160 180
Page 15 of 20
Velez-Colon | EE 454
200
400
600
800
1000
1200
1400
1600
1800
20 40 60 80 100 120 140 160 180
0.5
0.6
0.7
0.8
0.9
1.1
1.2
1.3
1.4
1.5
2 4 6 8 10 12 14
Doppler Images:
3. Look through the images over time. Do you see any difference?
Page 16 of 20
Velez-Colon | EE 454
1 2 3
200 200 200
4 5 6
200 200 200
1200 1200
1200
1400 1400
1400
1600 1600
1600
1800 1800
10 20 30 40 50 60 70 80 90 10 20 30 40 50 60 70 80 90 1800
10 20 30 40 50 60 70 80 90
After the filter was applied I looked though the image to get:
0.6
0.7
0.8
0.9
1.1
1.2
1.3
1.4
1.5
2 4 6 8 10 12 14
Page 17 of 20
Velez-Colon | EE 454
dopplerPower 2.3325e+007
8
x 10 Doppler Power
3
2.5
1.5
0.5
0
0 20 40 60 80 100 120 140 160 180 200
-30
-20
-10
10
20
30
40
50
60
70
Page 18 of 20
Velez-Colon | EE 454
MATLAB CODE
clc;clear; close all;
load('carotid9.mat');
x = hilbert(bmode_rf);
x = abs(x);
figure(1)
imagesc(x)
title('Image after taking the hilbert and magnitude');
% envelope detection
xmax = max(max(x));
xmin = min(min(x));
normalizeImage = abs(( x / (xmax - xmin) ) - xmin);
figure(2)
imagesc(normalizeImage)
title('envelope detector')
colormap bone;
% Logarithmic Compression
figure(3)
k = 20;
c = .1;
logCompression = k * exp( log (normalizeImage ) );
imagesc((logCompression))
figure(4)
imagesc(logCompression(.5:15))
%I only used this code to view the images of the doppler once, then I
%commented it out.
% for j=3:15
% figure(j)
% copyDopler=[];
% copy1Dopler=doppler_rf(:,:,j);
% imagesc(copy1Dopler)
%
% end
Page 19 of 20
Velez-Colon | EE 454
analyticalSignal1=hilbert(bmode_rf(:,i));
analyticalSignal2=conj(hilbert(bmode_rf(:,i+1)));
computation = analyticalSignal1 .* analyticalSignal2;
result=[result computation];% store all the computations to calculate
the phase later.
end
% angle returns the phase angle in radians
imaginary = imag(result);
realPart = real(result);
phaseSum = sum(atan(imaginary/realPart));
% doppler velocity
v = (c * fc / (4*pi*fc_dop)) .* phaseSum;
% doppler power
result2=[];
for i=1:187,
analyticalSignal1=[];% erase the data
analyticalSignal2=[];% erase the data
analyticalSignal1=hilbert(bmode_rf(:,i));
analyticalSignal2=conj(hilbert(bmode_rf(:,i)));
computation = analyticalSignal1 .* analyticalSignal2;
result2=[result2 computation];% store all the computations to calculate
the phase later.
end
% doppler power addition
dopplerPower2 =cumsum(result2);
dopplerPower2 =dopplerPower2(end);
Thank you Dr Won. I have learned more in the past quarters with you than in the past 5 years!
I hope you have a good “vacation.”
Page 20 of 20