📄 bft_user_guide.tex.bak
字号:
%%tth:\begin{html}<hr>\end{html}%%tth:\subsection*{bft\_init}%%tth:\begin{html}<hr>\end{html}\funlnk{bft_init}Initialize the BeamForming Toolbox. This command must be executed first in order to set some parameters and allocate the the necessary memory \begin{tabular}[t]{lp{14cm}} USAGE:& {\tt bft\_init}\\INPUT:& None \\OUTPUT:& None\end{tabular}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5\headline{bft\_linear\_array}%%tth:\vspace{2cm}%%tth:\begin{html}<hr>\end{html}%%tth:\subsection*{bft\_linear\_array}%%tth:\begin{html}<hr>\end{html}\funlnk{bft_linear_array} Create a linear array aperture. \begin{tabular}[t]{lp{14cm}} USAGE: & {\tt xdc = bft\_linear\_array(no\_elements, width, kerf)} \\ & {\tt xdc = bft\_linear\_array(no\_elements, pitch)} \\ INPUT:& \begin{tabular}[t]{lp{11cm}} {\sl no\_elements} & Number of elelements in the array \\ {\sl pitch} & Distance between the centers of two elements [m] \\ {\sl width} & Width in x-direction [m]\\ {\sl kerf} & Distance between two elements [m] \end{tabular} \\ & The function assumes that {\sl kerf + width = pitch} \\ OUTPUT:& {\sl xdc} - Pointer to the allocated aperture.\end{tabular}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5\headline{bft\_no\_lines}%%tth:\vspace{2cm}%%tth:\begin{html}<hr>\end{html}%%tth:\subsection*{bft\_no\_lines}%%tth:\begin{html}<hr>\end{html}\funlnk{bft_no_lines}Set the number of lines that will be beamformed in parallel. After calling \hyperlink{bft_init}{bft\_init}, the number of lines that are beamformed in parallel is 1. If the user wants to beamforma whole image in one command, he/she must set the number of lines,and then specify the focal zones for each of the lines.\begin{tabular}[t]{lp{14cm}} USAGE: & {\tt bft\_no\_lines(no\_lines)}\\ INPUT:& {\sl no\_lines} ~~Number of lines beamformed in parallel \\ OUTPUT: & None\end{tabular}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5\headline{bft\_param}%%tth:\vspace{2cm}%%tth:\begin{html}<hr>\end{html} %%tth:\subsection*{bft\_param}%%tth:\begin{html}<hr>\end{html}\funlnk{bft_param}Set a paramater of the BeamForming Toolbox\begin{tabular}[t]{lp{14cm}} USAGE: & {\tt bft\_param(name, value)}\\ INPUT: & \begin{tabular}[t]{lp{11cm}} {\sl name} & Name of the parameter (string). Currently supported:\\ & \begin{tabular}[t]{c|c|c|c} \hline name & Meaning & Default value & Unit \\ \hline 'c' & Speed of sound. & 1540 & m/s \\ 'fs'& Sampling frequency & 40,000,000 & Hz \\ \hline \end{tabular} \\\\ {\sl value} & New value for the parameter. Must be scalar. \end{tabular} \\ OUTPUT: & None\end{tabular}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5\headline{bft\_sub\_image}%%tth:\vspace{2cm}%%tth:\begin{html}<hr>\end{html} %%tth:\subsection*{bft\_sub\_image}%%tth:\begin{html}<hr>\end{html}\funlnk{bft_sub_image}Subtract one low-res image from high-res one.\begin{tabular}[t]{lp{14cm}} USAGE: & {\tt [hi\_res] = bft\_sub\_image(hi\_res, lo\_res, element, start\_time)} \\ INPUT:& \begin{tabular}[t]{lp{11cm}} {\sl hi\_res} & High resolution RF image. One column per scan line.\\ {\sl lo\_res} & Low resolution RF image. One column per scan line.\\ {\sl element} & Number of element, used to acquire the low resolution image. \\ {\sl start\_time} & Arrival time of the first sample of the RF lines. \end{tabular} \\ OUTPUT:& hi\_res - The high resolution image.\end{tabular}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5\headline{bft\_sum\_apodization}%%tth:\vspace{2cm}%%tth:\begin{html}<hr>\end{html} %%tth:\subsection*{bft\_sum\_apodization}%%tth:\begin{html}<hr>\end{html}\funlnk{bft_sum_apodization}Create a summation apodization time line. This function is used in the case that the individual low resolution images must be weighted during the summation\begin{tabular}[t]{lp{14cm}} USAGE: & {\tt bft\_sum\_apodization(xdc, times, values, line\_no)} \\ INPUT: & \begin{tabular}[t]{lp{14cm}} {\sl xdc} & Pointer to a transducer aperture.\\ {\sl times} & Timea after which the associated apodization is valid.\\ {\sl values} & Apodization values. Matrix with one row for each time value and a number of columns equal to the number of physical elements in the aperture. \\ {\sl line\_no} & Number of line. If skipped, {\sl line\_no} is assumed to be equal to '1'. \end{tabular}\\ OUTPUT: & None \end{tabular}\headline{bft\_sum\_images}%%tth:\vspace{2cm}%%tth:\begin{html}<hr>\end{html} %%tth:\subsection*{bft\_sum\_images}%%tth:\begin{html}<hr>\end{html}\funlnk{bft_sum_images} Sum 2 low resolution images in 1 high resolution.\begin{tabular}[t]{lp{14cm}} USAGE : {\tt [hi\_res] = bft\_sum\_images(image1, ele1, image2, ele2, time) }\\ INPUT : \begin{tabular}[t]{lp{141cm}} {\sl image1} & Matrix with the RF data for the image. The number of columns corresponds to the number of lines \\ {\sl ele1} & Number of emitting element used to obtain the image.\\ {\sl image2} & Matrix with the RF data for the image. The number of columns corresponding to the number of lines \\ {\sl ele2} & Number of emitting element used to obtain the image.\\ {\sl time} & The arrival time of the first samples. The two images must be aligned in time \end{tabular} OUTPUT : hi\_res - Higher resolution image\end{tabular}\headline{bft\_transducer}%%tth:\vspace{2cm}%%tth:\begin{html}<hr>\end{html} %%tth:\subsection*{bft\_transducer}%%tth:\begin{html}<hr>\end{html}\funlnk{bft_transducer} Create a new transducer definition. The transducer definition is necessary for the calculation of the delays.\begin{tabular}[t]{lp{14cm}} USAGE: & {\tt xdc = bft\_transducer(centers)}\\ INPUT: & \begin{tabular}[t]{lp{11cm}} {\sl centers} & Matrix with the coordinates of the centers of the elements. It has 3 columns (x,y,z) and a number of rows equal to the number of elements. The coordinates are specified in [m] \end{tabular}\\ OUTPUT: & \begin{tabular}[t]{lp{11cm}} xdc & Pointer to the memory location with the transducer definition. Do not alter this value !!! \end{tabular}\end{tabular}%%tth:\begin{html}<hr>\end{html}\chapter{Examples}\label{chap_examples}%%tth:\begin{html}<hr>\end{html}\section{Using Field II simulations}\headline{Phased array B-mode image}%%tth:\vspace{2cm}%%tth:\begin{html}<hr>\end{html} %%tth:\subsection*{phased array B-mode image}%%tth:\begin{html}<hr>\end{html}\funlnk{phased_bmode}{\footnotesize\begin{verbatim}%PHASED_IMAGE Create phased array B-mode image with BFT.% This script creates a B-mode PSF line by line. Each line is % calculated using CALC_SCAT and CALC_SCAT_MULTY. The rf_data% from CALC_SCAT_MULTI is passed to the beamforming toolbox,% and in the end the results are compared.%% The function calls XDC_FOCUS, and BFT_FOCUS in order to set the% the delays. % VERSION 1.0, 29 Feb. 2000, Svetoslav Nikolovf0 = 4e6; % Central frequency [Hz]fs = 100e6; % Sampling frequency [Hz]c = 1540; % Speed of sound [m/s]no_elements = 64; % Number of elements in the transducerlambda = c / f0; % Wavelength [m]pitch = lambda / 2; % Pitch - center-to-center [m]width = .95*pitch; % Width of the element [m]kerf = pitch - width; % Inter-element spacing [m]height = 10/1000; % Size in the Y direction [m] % Define the impulse response of the transducerimpulse_response = sin(2*pi*f0*(0:1/fs:2/f0));impulse_response = impulse_response.*hanning(length(impulse_response))';excitation = impulse_response;% Define the phantompht_pos = [0 0 20; 0 0 30; 0 0 40; 0 0 50; 0 0 60; 0 0 70; 0 0 80; 0 0 90; ] / 1000; % The position of the phantompht_amp = 20*ones(8,1); % The amplitude of the back-scatter% Define the focus focus_r = [20;30;40;50;60;70;80;90] / 1000;T = (focus_r-5/1000)/c *2;% Initialize the programfield_init(0);bft_init;% Set some paramtersset_field('c', c);bft_param('c', c);set_field('fs', fs);bft_param('fs', fs);% Create some apertures.xmt = xdc_linear_array(no_elements,width,height,kerf,1,1,[0 0 0]);rcv = xdc_linear_array(no_elements,width,height,kerf,1,1,[0 0 0]);xdc = bft_linear_array(no_elements, width, kerf);% Set the impulse responsesxdc_impulse(rcv, impulse_response);xdc_impulse(xmt, impulse_response);xdc_excitation(xmt, excitation);% Define and create the imagesector = 30 * pi / 180;no_lines = 32;d_theta = sector / (no_lines-1);theta = -(no_lines-1) / 2 * d_theta;Rmax = max(sqrt(pht_pos(:,1).^2 + pht_pos(:,2).^2 + pht_pos(:,3).^2)) + 15/1000;no_rf_samples = ceil(2*Rmax/c * fs);rf_line = zeros(no_rf_samples, 1);bf_line = zeros(no_rf_samples, 1);env_line = zeros(no_rf_samples, no_lines);env_bf = zeros(no_rf_samples, no_lines);xmt_r = (max(focus_r) + min(focus_r) )/2;for i = 1 : no_lines rf_line(:) = 0; disp(['Line no ' num2str(i)]) focus = [sin(theta)*focus_r, zeros(length(focus_r),1), cos(theta)*focus_r]; xmt_f = [sin(theta)*xmt_r, zeros(length(xmt_r),1), cos(theta)*xmt_r]; xdc_center_focus(xmt,[0 0 0]) xdc_center_focus(rcv,[0 0 0]) bft_center_focus([0 0 0]); xdc_focus(xmt, 0, xmt_f); xdc_focus(rcv, T, focus); bft_focus(xdc, T, focus); % Beamform with Field II [rf_temp, t(i)] = calc_scat(xmt,rcv, pht_pos, pht_amp); % Beamform with BFT xdc_focus_times(rcv, 0, zeros(1,no_elements)); [rf_data, start_t] = calc_scat_multi(xmt,rcv, pht_pos, pht_amp); rf_data = [zeros(300,no_elements); rf_data; zeros(300,no_elements)]; start_t = start_t - 300 / fs; bf_temp = bft_beamform(start_t, rf_data); start_sample = t(i)*fs; no_temp_samples = length(rf_temp); rf_line(start_sample:start_sample+no_temp_samples-1) = rf_temp(1:no_temp_samples); env_line(:,i) = abs(hilbert(rf_line(:))); start_sample = floor(start_t*fs); no_temp_samples = length(bf_temp); bf_line(start_sample:start_sample+no_temp_samples-1) = bf_temp(1:no_temp_samples); env_bf(:,i) = abs(hilbert(bf_line(:))); theta = theta + d_theta;end% Release the allocated memoryfield_endbft_endenv_line = env_line / max(max(abs(env_line)));env_bf = env_bf / max(max(abs(env_bf)));figure;subplot(1,2,1)imagesc([-sector/2 sector/2]*180/pi,[0 Rmax]*1000,20*log10(env_line + 0.001))axis('image')xlabel('Angle [deg]');ylabel('Axial distance [mm]')title('Beamformed by Field II ');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -