📄 make_image.m
字号:
% Compress the data to show 60 dB of% dynamic range for the cyst phantom image%% version 1.3 by Joergen Arendt Jensen, April 1, 1998.% version 1.4 by Joergen Arendt Jensen, August 14, 2007.% Calibrated 50 dB display madef0=3.5e6; % Transducer center frequency [Hz]fs=100e6; % Sampling frequency [Hz]c=1540; % Speed of sound [m/s]no_lines=50; % Number of lines in imageimage_width=40/1000; % Size of image sectord_x=image_width/no_lines; % Increment for image% Read the data and adjust it in time min_sample=0;for i=1:no_lines % Load the result cmd=['load rf_data/rf_ln',num2str(i),'.mat']; disp(cmd) eval(cmd) % Find the envelope rf_env=abs(hilbert([zeros(round(tstart*fs-min_sample),1); rf_data])); env(1:max(size(rf_env)),i)=rf_env; end% Do logarithmic compressionD=10; % Sampling frequency decimation factordB_range=50; % Dynamic range for display in dBdisp('Finding the envelope')log_env=env(1:D:max(size(env)),:)/max(max(env));log_env=20*log10(log_env);log_env=127/dB_range*(log_env+dB_range);% Make an interpolated imagedisp('Doing interpolation')ID=20;[n,m]=size(log_env);new_env=zeros(n,m*ID);for i=1:n new_env(i,:)=interp(log_env(i,:),ID); end[n,m]=size(new_env); fn=fs/D;clfimage(((1:(ID*no_lines-1))*d_x/ID-no_lines*d_x/2)*1000,((1:n)/fn+min_sample/fs)*1540/2*1000,new_env)xlabel('Lateral distance [mm]')ylabel('Axial distance [mm]')colormap(gray(128))axis('image')axis([-20 20 35 90])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -