<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>k-Wave User Forum &#187; Topic: 2D time-of-flight reconstructions</title>
		<link>http://www.k-wave.org/forum/topic/2d-time-of-flight-reconstructions</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 23:10:33 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.k-wave.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.k-wave.org/forum/rss/topic/2d-time-of-flight-reconstructions" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "2D time-of-flight reconstructions"</title>
			<link>http://www.k-wave.org/forum/topic/2d-time-of-flight-reconstructions#post-7279</link>
			<pubDate>Fri, 06 Mar 2020 14:08:26 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">7279@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Panos,&#60;/p&#62;
&#60;p&#62;If you use &#60;code&#62;makeMultiArc&#60;/code&#62;, you can also return an indexed matrix, where the indices correspond to the physical elements. If you collapse this to 1D vector and remove zeros, e.g., &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;mask = arcs_labelled(:);
mask(mask == 0) = [];&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;you will then have an index mask you can use to extract the appropriate elements of the &#60;code&#62;sensor_data&#60;/code&#62;, and then average, e.g.,&#60;/p&#62;
&#60;p&#62;&#60;code&#62;sensor_data_element_1 = sensor_data(mask == 1, :);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Brad
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Panos on "2D time-of-flight reconstructions"</title>
			<link>http://www.k-wave.org/forum/topic/2d-time-of-flight-reconstructions#post-7240</link>
			<pubDate>Tue, 25 Feb 2020 17:57:28 +0000</pubDate>
			<dc:creator>Panos</dc:creator>
			<guid isPermaLink="false">7240@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi there,&#60;/p&#62;
&#60;p&#62;First of all many congratulations on this very helpful toolbox.&#60;/p&#62;
&#60;p&#62;I am working on travel-time ultrasound tomography. I am using frequency domain kernels (banana-doughnut kernels) to reconstruct sound speed profiles. I am building 2D simulations here to validate my experimental data and eventually to optimize them. My target is to create simulations data which could provide better reconstructions than the experimental ones (using the same system matrix - in a back-projection concept). At first, I used point-sensors but the results weren't that good. Now I am trying to give dimensions to my sensors (defining every sensor as a number of points(nodes of the grid)). The problem that I am facing is that I cannot completely understand in which order the sensor_data structure is created. As I am using all the massive data (coming from the point-sensors) to average them in order to create an averaged signal for every actual sensor.&#60;br /&#62;
For instance, in the attached example the amount of sensor_data is 368, while I have to link them to 32 actual sensors.&#60;/p&#62;
&#60;p&#62;Can you help me with?&#60;/p&#62;
&#60;p&#62;I put my code here:&#60;br /&#62;
%----%&#60;br /&#62;
clear all;&#60;br /&#62;
close all;&#60;br /&#62;
clc;&#60;/p&#62;
&#60;p&#62;%% GRID - Centre Frequency&#60;br /&#62;
figure();&#60;br /&#62;
% computational grid&#60;br /&#62;
Nx = 256;           % number of grid points in the x (row) direction&#60;br /&#62;
Ny = 256;           % number of grid points in the y (column) direction&#60;br /&#62;
spacing=370/Nx;&#60;br /&#62;
dx = spacing*0.001;        % grid point spacing in the x direction [m]&#60;br /&#62;
dy = spacing*0.001;        % grid point spacing in the y direction [m]&#60;br /&#62;
pxl_mm=dx*1000;&#60;br /&#62;
kgrid = kWaveGrid(Nx, dx, Ny, dy);&#60;/p&#62;
&#60;p&#62;%% Define a centered circular sensor&#60;br /&#62;
sensor_radius = (329/2)*0.001;   % [m]&#60;br /&#62;
num_sensor_points = 32;&#60;br /&#62;
sensor.mask = makeCartCircle(sensor_radius, num_sensor_points);&#60;br /&#62;
% Sensors (grid)&#60;br /&#62;
a=(sensor.mask./dx)+(Nx/2);&#60;/p&#62;
&#60;p&#62;%% Medium Porperties&#60;br /&#62;
% DEFINE MEDIUM  &#60;/p&#62;
&#60;p&#62;% WATER&#60;br /&#62;
medium.sound_speed = 1480 *  ones(Nx, Ny);      % [m/s]&#60;br /&#62;
medium.density = 9980 * ones(Nx, Ny);           % [kg/m^3]&#60;/p&#62;
&#60;p&#62;% INCLUSION&#60;br /&#62;
% Small_Inclusion&#60;br /&#62;
inc_centre_x=min(min(a))+(225/pxl_mm);&#60;br /&#62;
inc_centre_y=Nx-(min(min(a))+(275/pxl_mm));&#60;br /&#62;
radius=(14/pxl_mm);&#60;br /&#62;
%&#60;br /&#62;
plot(inc_centre_x,inc_centre_y,'*black');hold on;&#60;br /&#62;
[columnsInImage rowsInImage] = meshgrid(1:Nx, 1:Nx);&#60;br /&#62;
circlePixels = (rowsInImage - inc_centre_y).^2 ...&#60;br /&#62;
    + (columnsInImage - inc_centre_x).^2 &#38;lt;= radius.^2;&#60;br /&#62;
[posx,posy]=find((circlePixels)~=0);&#60;br /&#62;
%&#60;br /&#62;
% Air bottle&#60;br /&#62;
for i=1:length(posx)&#60;br /&#62;
    medium.sound_speed(posx(i), posy(i)) =343;  %343;&#60;br /&#62;
    medium.density(posx(i), posy(i)) =18;       %1.2;&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;%% Sources&#60;br /&#62;
mask=zeros(Nx);&#60;br /&#62;
for i=1:32&#60;br /&#62;
    masks{i}=zeros(Nx);&#60;br /&#62;
end&#60;br /&#62;
mask3=zeros(Nx);&#60;br /&#62;
for i=1:32&#60;br /&#62;
    source_x(i)=sensor.mask(2,i);&#60;br /&#62;
    source_y(i)=sensor.mask(1,i);&#60;br /&#62;
    %&#60;br /&#62;
    disc_x_pos =(floor(source_x(i)/dx)+(Nx/2));     % [grid points]&#60;br /&#62;
    disc_y_pos =(floor(source_y(i)/dy)+(Nx/2));     % [grid points]&#60;br /&#62;
    %&#60;br /&#62;
    masks{i}(disc_x_pos,disc_y_pos)=1;&#60;br /&#62;
    %&#60;br /&#62;
    arc_pos = [disc_x_pos, disc_y_pos];             % [grid points]&#60;br /&#62;
    radius = 25;                                    % [grid points]&#60;br /&#62;
    diameter = 13;                                  % [grid points]&#60;br /&#62;
    focus_pos = [Nx/2, Nx/2];                       % [grid points]&#60;br /&#62;
%   source.p_mask = makeArc([Nx, Ny], arc_pos, radius, diameter, focus_pos);&#60;br /&#62;
    masks{i} = makeArc([Nx, Ny], arc_pos, radius, diameter, focus_pos);&#60;br /&#62;
    %&#60;br /&#62;
    sensor_node_num{i}=sum(masks{i}(:) == 1);&#60;br /&#62;
    %&#60;br /&#62;
    mask3=mask3+masks{i};&#60;br /&#62;
    mask1=mask3;&#60;br /&#62;
    mask1(mask1==1)=-1200;&#60;br /&#62;
end&#60;br /&#62;
%% Display&#60;br /&#62;
mask1=mask1+medium.sound_speed;&#60;br /&#62;
mask2=mask1;&#60;br /&#62;
mask2(mask2==280)=1480;&#60;br /&#62;
sensor1.mask=mask3;&#60;br /&#62;
medium.sound_speed=mask2;&#60;/p&#62;
&#60;p&#62;%% Displays&#60;br /&#62;
imagesc(mask2);colorbar; view(0,-90); title('Domain');&#60;br /&#62;
figure;&#60;br /&#62;
imagesc(mask1); hold on; plot(a(1,:),a(2,:),'*r'); title('Geometry');&#60;br /&#62;
figure;&#60;br /&#62;
imagesc(mask3); hold on; plot(a(1,:),a(2,:),'*r'); title('Sensors');&#60;/p&#62;
&#60;p&#62;%%&#60;br /&#62;
pause; figure();&#60;/p&#62;
&#60;p&#62;% --- SIMULATION ---&#60;/p&#62;
&#60;p&#62;% Running the Tomographic scenario&#60;br /&#62;
for i=1:length(sensor.mask)&#60;br /&#62;
    % Sources&#60;br /&#62;
    source_x(i)=sensor.mask(2,i);&#60;br /&#62;
    source_y(i)=sensor.mask(1,i);&#60;br /&#62;
    source.p_mask=masks{i};&#60;br /&#62;
    % Source_Excitation_ToneBurst&#60;br /&#62;
    tone_burst_freq=480e3;&#60;br /&#62;
    sampling_freq=40 *tone_burst_freq;&#60;br /&#62;
    tone_burst_cycles=3;&#60;br /&#62;
    k = toneBurst(sampling_freq,tone_burst_freq,tone_burst_cycles,'Plot', true);&#60;br /&#62;
    source.p=30*k;&#60;br /&#62;
    figure();&#60;br /&#62;
    % source.p_mode='dirichlet';&#60;/p&#62;
&#60;p&#62;    % run the simulation&#60;br /&#62;
    kgrid.t_array = makeTime(kgrid, 1480, 0.3, 0.00042 );       %recording time 0.5 msec (0.5e-3) - auto t_end=0.005 (increasing t_end one decreases the recording time)&#60;br /&#62;
    sensor_data{i} = kspaceFirstOrder2D(kgrid, medium,  source, sensor1,'PMLInside',true);&#60;br /&#62;
    % &#60;/p&#62;
&#60;p&#62;    % plot the simulated sensor data&#60;br /&#62;
    figure;&#60;br /&#62;
    imagesc(sensor_data{i}, [-1, 1]);&#60;br /&#62;
    colormap(getColorMap);&#60;br /&#62;
    ylabel('Sensor Position');&#60;br /&#62;
    xlabel('Time Step');&#60;br /&#62;
    colorbar; &#60;/p&#62;
&#60;p&#62;end&#60;br /&#62;
%----%
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
