<?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: Image reconstruction with kspaceFirstOrder2D.</title>
		<link>http://www.k-wave.org/forum/topic/image-reconstruction-with-kspacefirstorder2d</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 03:10:09 +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/image-reconstruction-with-kspacefirstorder2d" rel="self" type="application/rss+xml" />

		<item>
			<title>uhultrasound on "Image reconstruction with kspaceFirstOrder2D."</title>
			<link>http://www.k-wave.org/forum/topic/image-reconstruction-with-kspacefirstorder2d#post-6554</link>
			<pubDate>Thu, 16 Aug 2018 20:21:02 +0000</pubDate>
			<dc:creator>uhultrasound</dc:creator>
			<guid isPermaLink="false">6554@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Ben,&#60;/p&#62;
&#60;p&#62;Thank you very much for your reply and I got it. Have a good day!&#60;/p&#62;
&#60;p&#62;John
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bencox on "Image reconstruction with kspaceFirstOrder2D."</title>
			<link>http://www.k-wave.org/forum/topic/image-reconstruction-with-kspacefirstorder2d#post-6550</link>
			<pubDate>Thu, 16 Aug 2018 14:29:32 +0000</pubDate>
			<dc:creator>bencox</dc:creator>
			<guid isPermaLink="false">6550@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi John, &#60;/p&#62;
&#60;p&#62;What are you trying to do here? Time reversal imaging is used to reconstruct an image of an initial acoustic pressure distribution, ie. a p0 source as found in photoacoustic imaging. It is not designed to reconstruct images of medium properties such as density or sound speed from a scattered field.&#60;/p&#62;
&#60;p&#62;Best wishes,&#60;br /&#62;
Ben
&#60;/p&#62;</description>
		</item>
		<item>
			<title>uhultrasound on "Image reconstruction with kspaceFirstOrder2D."</title>
			<link>http://www.k-wave.org/forum/topic/image-reconstruction-with-kspacefirstorder2d#post-6525</link>
			<pubDate>Sat, 14 Jul 2018 14:51:26 +0000</pubDate>
			<dc:creator>uhultrasound</dc:creator>
			<guid isPermaLink="false">6525@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Brad.,&#60;/p&#62;
&#60;p&#62;Thank you for your reply and I appreciate it very much. Yes, I intend to simulate a driving pressure signal of a top-hat shape with controllable frequency and duration. My goal is to reconstruct the original disc medium density model with time reversal backward modeling.&#60;/p&#62;
&#60;p&#62;Regarding &#34;to control when to stop the time-reversal simulation. For example, this might be offset by the half the length of the source.&#34;, I was wondering if you could please help let me know how to offset by the half the length of the source to control when to stop the time-reversal simulation? for example...&#60;/p&#62;
&#60;p&#62;In addition, it seems even I stop time-reversal simulation at &#34;a proper wave-field focusing time point&#34;, the position of the reconstructed disc medium will not be the same as that of the original disc medium (offset by a certain distance)? I was wondering if you have some idea about the possible reason?&#60;/p&#62;
&#60;p&#62;Thank you very much for your help and best regards,&#60;/p&#62;
&#60;p&#62;John
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Image reconstruction with kspaceFirstOrder2D."</title>
			<link>http://www.k-wave.org/forum/topic/image-reconstruction-with-kspacefirstorder2d#post-6523</link>
			<pubDate>Fri, 13 Jul 2018 22:15:24 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6523@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi John,&#60;/p&#62;
&#60;p&#62;It looks like your driving pressure signal is a top-hat that is 16 us long. Is that what you intended? If you are not modelling an initial value problem, you will need to control when to stop the time-reversal simulation. For example, this might be offset by the half the length of the source. &#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>uhultrasound on "Image reconstruction with kspaceFirstOrder2D."</title>
			<link>http://www.k-wave.org/forum/topic/image-reconstruction-with-kspacefirstorder2d#post-6511</link>
			<pubDate>Fri, 29 Jun 2018 16:21:13 +0000</pubDate>
			<dc:creator>uhultrasound</dc:creator>
			<guid isPermaLink="false">6511@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Dear Bradley:&#60;/p&#62;
&#60;p&#62;Thank you for your help. I am trying to reconstruct a disc medium density model with two steps: 1. forward modeling (a. with disc density model, b. without disc density model, c. data is a-b), and 2. time reversal to reconstruct the medium density model. I tried to use a pulse source with the Mexican hat wavelet. I modified the 2D Time Reversal Reconstruction For A Line Sensor Example as below. I keep all the timing parameters same in forward and reversal modeling. However, the reconstructed image is not same as the disc density model (it seems reconstructed time is a little longer than it should be). I was wondering if you could please help with my questions?&#60;/p&#62;
&#60;p&#62;My questions are as follows:&#60;br /&#62;
1. The time parameters in reconstruction are kept same as those in the forward modeling, could you please help with the possible reason why the reconstructed image is not the same as the medium disc2? How to restore the exact the original medium disc2 shape (e.g. do I need to control the timing)?&#60;/p&#62;
&#60;p&#62;2. the reconstructed image 'density_recon' values have both positive and negative values,&#60;br /&#62;
why there are negative image values (the medium disc2 are postive values as medium density? Why the original disc values can't be restored?&#60;br /&#62;
&#34;density_recon = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:}); % inverted medium parameters&#34;&#60;/p&#62;
&#60;p&#62;Thank you very much for your help in advance and best regards,&#60;/p&#62;
&#60;p&#62;John&#60;br /&#62;
p.s. the Matlab script is as below:&#60;/p&#62;
&#60;p&#62;--------------------------------------------------------------------------------&#60;br /&#62;
clear all;&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% SET UP THE SIMULATION&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% create the computational grid&#60;br /&#62;
PML_size = 20;          % size of the PML in grid points&#60;br /&#62;
Nx = 128 - 2*PML_size;  % number of grid points in the x (row) direction&#60;br /&#62;
Ny = 256 - 2*PML_size;  % number of grid points in the y (column) direction&#60;br /&#62;
dx = 0.1e-3;            % grid point spacing in the x direction [m]&#60;br /&#62;
dy = 0.1e-3;            % grid point spacing in the y direction [m]&#60;br /&#62;
kgrid = makeGrid(Nx, dx, Ny, dy);&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
[kgrid.t_array, dt] = makeTime(kgrid, 1500);&#60;/p&#62;
&#60;p&#62;% create initial pressure distribution using makeDisc&#60;br /&#62;
disc_magnitude = 5; % [au]&#60;br /&#62;
disc_x_pos = 10;    % [grid points]&#60;br /&#62;
disc_y_pos = floor(Ny/2); 	% [grid points]&#60;br /&#62;
disc_radius = 5;    % [grid points]&#60;br /&#62;
disc_1 = disc_magnitude*makeDisc(Nx, Ny, disc_x_pos, disc_y_pos, disc_radius);&#60;/p&#62;
&#60;p&#62;% smooth the initial pressure distribution and restore the magnitude&#60;br /&#62;
% scale the initial pressure distribution&#60;br /&#62;
p0_magnitude = 1;&#60;br /&#62;
p0 = smooth(kgrid, disc_1, true);&#60;/p&#62;
&#60;p&#62;% assign to the source structure&#60;br /&#62;
source_freq = 10;&#60;br /&#62;
source.p_mask = disc_1;&#60;br /&#62;
source.p = p0_magnitude .* (1 - 2 * pi^2 * source_freq^2 .* (kgrid.t_array).^2)...&#60;br /&#62;
                .* exp(-pi^2 * source_freq^2 .* (kgrid.t_array).^2); % Ricker wavelet&#60;/p&#62;
&#60;p&#62;% define the properties of the propagation medium&#60;br /&#62;
disc_x_pos = floor(Nx/2);    % [grid points]&#60;br /&#62;
disc_y_pos = floor(Ny/2); 	% [grid points]&#60;br /&#62;
disc_radius = 5;    % [grid points]&#60;br /&#62;
disc_2 = makeDisc(Nx, Ny, disc_x_pos, disc_y_pos, disc_radius);&#60;br /&#62;
p3 = smooth(kgrid, disc_2, true);&#60;/p&#62;
&#60;p&#62;density_input     = 1000*ones(Nx, Ny); % [kg/m^3]&#60;br /&#62;
medium.sound_speed = 1500 ;	% [m/s]&#60;br /&#62;
medium.density = density_input + 1000 * disc_2;	% [m/s]&#60;/p&#62;
&#60;p&#62;% set the input arguements: force the PML to be outside the computational&#60;br /&#62;
% grid; switch off p0 smoothing within kspaceFirstOrder2D&#60;br /&#62;
input_args = {'PMLInside', false, 'PMLSize', PML_size, 'Smooth', false, 'PlotPML', false};&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% DEFINE SENSOR INDICES FOR LATER USE&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% define a four-sided box array and find the indices of the sensors&#60;br /&#62;
sensor.mask = zeros(Nx, Ny);&#60;br /&#62;
sensor.mask(1,:) = 1;&#60;br /&#62;
sensor.mask(:,1) = 1;&#60;br /&#62;
sensor.mask(end,:) = 1;&#60;br /&#62;
sensor.mask(:,end) = 1;&#60;br /&#62;
sensor_indices = find(sensor.mask==1);&#60;/p&#62;
&#60;p&#62;% find the indices along two sides, with respect to sensor_indices&#60;br /&#62;
sensor.mask = zeros(Nx, Ny);&#60;br /&#62;
sensor.mask(end,:) = 1;&#60;br /&#62;
sensor.mask(:,end) = 1;&#60;br /&#62;
sensor_box_indices1 = find(sensor.mask(sensor_indices)==1);&#60;/p&#62;
&#60;p&#62;% define an L-shaped array used for the measurements, find the sensor&#60;br /&#62;
% indices, and their indices with respect to sensor_indices&#60;br /&#62;
sensor.mask = zeros(Nx, Ny);&#60;br /&#62;
sensor.mask(1,:) = 1;&#60;br /&#62;
sensor.mask(:,1) = 1;&#60;br /&#62;
original_sensor_indices = find(sensor.mask == 1);&#60;br /&#62;
sensor_box_indices2 = find(sensor.mask(sensor_indices)==1);&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% RUN THE SIMULATION AND RECORD THE DATA OVER THE L-SHAPED ARRAY&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;sensor_data_object = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;medium.density = density_input;	% [m/s]&#60;br /&#62;
sensor_data_no_object = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;sensor_data = sensor_data_object - sensor_data_no_object;&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% RECONSTRUCT AN IMAGE USING TIME REVERSAL AND LINE ARRAY DATA&#60;br /&#62;
% =========================================================================&#60;br /&#62;
% define a line array of sensors&#60;br /&#62;
sensor.mask = zeros(Nx, Ny);&#60;br /&#62;
sensor.mask(1, :) = 1;&#60;/p&#62;
&#60;p&#62;% assign the time reversal data&#60;br /&#62;
sensor_data = sensor_data; % - sensor_data_no_object;&#60;/p&#62;
&#60;p&#62;sensor.time_reversal_boundary_data = 1 * sensor_data((sensor.mask(original_sensor_indices) == 1),:);&#60;/p&#62;
&#60;p&#62;% set the initial pressure to be zero&#60;br /&#62;
source.p = source.p * 0;&#60;/p&#62;
&#60;p&#62;% run the time reversal reconstruction&#60;br /&#62;
density_recon = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:}); % inverted medium parameters&#60;/p&#62;
&#60;p&#62;figure;&#60;br /&#62;
imagesc(disc_2)&#60;br /&#62;
title('medium density');&#60;br /&#62;
colorbar;&#60;/p&#62;
&#60;p&#62;figure;&#60;br /&#62;
imagesc(sensor_data)&#60;br /&#62;
title('sensor_data');&#60;br /&#62;
colorbar;&#60;/p&#62;
&#60;p&#62;figure;&#60;br /&#62;
imagesc(density_recon)&#60;br /&#62;
title('density_recon');&#60;br /&#62;
colorbar;
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
