Field_II是丹麦超声专家J. A. Jensen等利用线性声学原理设计的一个超声系统,封装成Matlab函数进行调用仿真。它可以仿真超声探头所形成的声场和超声图像等。还可以测试多种超声算法,比如变迹、稀疏孔径、合成孔径、多波束、波束矫正、平面波等。
本文介绍如何生成仿体,主要通过函数cyst_phantom实现,下面程序设计了两种仿体:包含18个靶点的仿体和包含一个实质囊肿、一个水性囊肿、两个强散射子的仿体。
代码片段:
function [positions, amp] = cyst_phantom (N)
% N仿体中散射子数量,值越大,仿体散射子密度越大,形成图像时间越长
if N == 18
positions = [-5 0 10;-5 0 20;-5 0 30; -5 0 40; -5 0 50; -5 0 60; -5 0 70; -5 0 80; -5 0 90; 5 0 10;5 0 20;5 0 30; 5 0 40; 5 0 50; 5 0 60; 5 0 70; 5 0 80; 5 0 90]/1000;
amp = ones(N,1)*20;
else
x_size = 50/1000; % Width of phantom [mm]
y_size = 10/1000; % Transverse width of phantom [mm]
z_size = 60/1000; % Height of phantom [mm]
z_start = 30/1000; % Start of phantom surface [mm];
% Create the general scatterers
x = (rand (N,1)-0.5)*x_size;
y = (rand (N,1)-0.5)*y_size;
z = rand (N,1)*z_size + z_start;
% Generate the amplitudes with a Gaussian distribution
amp=randn(N,1);
% Make the cyst and set the amplitudes to zero inside
% 6 mm cyst
r=6/2/1000; % Radius of cyst [mm]
xc=5/1000; % Place of cyst [mm]
% 5 mm cyst
r=15/2/1000; % Radius of cyst [mm]
zc=20/1000+z_start;
inside = ( ((x-xc).^2 + (z-zc).^2) < r^2);
amp = amp .* (1-inside);
% Make the high scattering region and set the amplitudes to 10 times inside
% 6 mm region
r=5/2/1000; % Radius of cyst [mm]
xc=-5/1000; % Place of cyst [mm]
% 5 mm region
r=15/2/1000; % Radius of cyst [mm]
zc=40/1000+z_start;
inside = ( ((x-xc).^2 + (z-zc).^2) < r^2) ;
amp = amp .* (1-inside) + 10*amp .* inside;
% Place the point scatterers in the phantom
x(N-1) = -10/1000;
y(N-1) = 0;
z(N-1) = 57/1000;
amp(N-1) = 20;
x(N) = 10/1000;
y(N) = 0;
z(N) = 64/1000;
amp(N) = 40;
% Return the variables
positions=[x y z];
end
最终的图像: