<?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: ultrasound reflection tomography, curved boundary with regular grid</title>
		<link>http://www.k-wave.org/forum/topic/ultrasound-reflection-tomography-curved-boundary-with-regular-grid</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 23:30:34 +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/ultrasound-reflection-tomography-curved-boundary-with-regular-grid" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "ultrasound reflection tomography, curved boundary with regular grid"</title>
			<link>http://www.k-wave.org/forum/topic/ultrasound-reflection-tomography-curved-boundary-with-regular-grid#post-5901</link>
			<pubDate>Wed, 26 Apr 2017 20:04:36 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">5901@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;The mathematical description of the ellipse results in a shape with hard boundaries (e.g., the grid points are either 0 or 1), which can lead to staircasing errors. Smoothing forces some of the grid points to take other values between 0 and 1, which can improve some of the problems encountered with staircasing.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ad000000 on "ultrasound reflection tomography, curved boundary with regular grid"</title>
			<link>http://www.k-wave.org/forum/topic/ultrasound-reflection-tomography-curved-boundary-with-regular-grid#post-5890</link>
			<pubDate>Tue, 11 Apr 2017 15:40:42 +0000</pubDate>
			<dc:creator>ad000000</dc:creator>
			<guid isPermaLink="false">5890@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I don't get it:   since the ellipse was defined mathematically, it already has the nearest approximation on the grid.  How would smoothing make it any smoother?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "ultrasound reflection tomography, curved boundary with regular grid"</title>
			<link>http://www.k-wave.org/forum/topic/ultrasound-reflection-tomography-curved-boundary-with-regular-grid#post-5228</link>
			<pubDate>Fri, 04 Sep 2015 16:51:31 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">5228@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi andrey.kuzmin.rus,&#60;/p&#62;
&#60;p&#62;I would suggest smoothing the material property maps. k-Wave automatically implements one type of smoothing (filtering in the spatial frequency domain). You can turn this on by setting the optional input &#60;code&#62;&#38;#39;Smooth&#38;#39;, true&#60;/code&#62;. Note that when you smooth the boundary, the high frequency reflection coefficients will also be affected.&#60;/p&#62;
&#60;p&#62;In terms of convergence for simple scattering problems, I've qualitatively found smoothing using an anti-aliasing filter to be the most effective. For example, define your ellipse at a higher resolution (e.g., 5 x higher), smooth this using an averaging filter, and then downsample back to the original resolution using nearest neighbour interpolation (e.g., using &#60;code&#62;resize&#60;/code&#62;).&#60;/p&#62;
&#60;p&#62;A couple of notes for your simulations (which you may have already observed). The simulations will be fastest for grid sizes which are powers of two (or have small prime factors). N = 512 will be much faster than N = 511 for example. Turning off the movie recording will also speed things up.&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>andrey.kuzmin.rus on "ultrasound reflection tomography, curved boundary with regular grid"</title>
			<link>http://www.k-wave.org/forum/topic/ultrasound-reflection-tomography-curved-boundary-with-regular-grid#post-5193</link>
			<pubDate>Wed, 05 Aug 2015 15:50:47 +0000</pubDate>
			<dc:creator>andrey.kuzmin.rus</dc:creator>
			<guid isPermaLink="false">5193@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I'm working on ultrasound reflection tomography. K-wave is used in order to generate reference data for a circular ring of sensors. There is an issue arising while trying to simulate an elliptic boundary with regular grid. &#60;/p&#62;
&#60;p&#62;A reflective region of elliptic shape in the centre of 512x512 grid is surrounded by the ring of 1500 sensors. Each sensor emits the pulse and records the reflection from the boundary of the ellipse. Thus we get an array of 1500 signals which we combine into 2d image:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;https://www.dropbox.com/s/k7o8052xogaoexi/ellipse_reflection_data_full.png?dl=0&#34; rel=&#34;nofollow&#34;&#62;https://www.dropbox.com/s/k7o8052xogaoexi/ellipse_reflection_data_full.png?dl=0&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;The problem is that the boundary visible on the image is not smooth and consists of disconnected curve segments:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;https://www.dropbox.com/s/j8fbvbf6zn3k3pw/ellipse_reflection_data.png?dl=0&#34; rel=&#34;nofollow&#34;&#62;https://www.dropbox.com/s/j8fbvbf6zn3k3pw/ellipse_reflection_data.png?dl=0&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;The issue remains even if the grid of size 1024x1024 is used (~50 hours of computation on CPU for 1500 sensors). How can I get a nice continuous boundary? Are there any options for smoothing while keeping the simulation physically reasonable? The code I use is cited below.&#60;/p&#62;
&#60;p&#62;clc; clearvars all; close all;&#60;/p&#62;
&#60;p&#62;nSource = 1500;&#60;/p&#62;
&#60;p&#62;N = 512-1;&#60;br /&#62;
speed = zeros(N,N);&#60;br /&#62;
density = zeros(N,N);&#60;br /&#62;
alpha_power = zeros(N,N);&#60;br /&#62;
alpha_coeff = zeros(N,N);&#60;br /&#62;
BonA = zeros(N,N);&#60;/p&#62;
&#60;p&#62;S = zeros(N,N);&#60;/p&#62;
&#60;p&#62;r_h = round(N/4);&#60;br /&#62;
r_w = round(N/3);&#60;br /&#62;
c_h = floor(N/2)+1;&#60;br /&#62;
c_w = floor(N/2)+1;    &#60;/p&#62;
&#60;p&#62;[IH,IW] = ndgrid(1:N,1:N);&#60;/p&#62;
&#60;p&#62;d = ((IH-c_h)./r_h).^2 + ((IW-c_w)./r_w).^2;&#60;/p&#62;
&#60;p&#62;ellipse = d &#38;lt; 1.0;&#60;/p&#62;
&#60;p&#62;figure, imagesc(ellipse);&#60;/p&#62;
&#60;p&#62;water = ~ellipse;&#60;/p&#62;
&#60;p&#62;medium = [];&#60;br /&#62;
sensor = [];&#60;br /&#62;
source = [];&#60;/p&#62;
&#60;p&#62;for i=1:nSource&#60;br /&#62;
    speed(water) = 1509;&#60;br /&#62;
    speed(ellipse) = 1800;&#60;/p&#62;
&#60;p&#62;    density(water) = 995;&#60;br /&#62;
    density(ellipse) = 1700;&#60;/p&#62;
&#60;p&#62;    alpha_coeff(water) = 0.002;&#60;br /&#62;
    alpha_coeff(ellipse) = 5.0;&#60;/p&#62;
&#60;p&#62;    alpha_power(water) = 1.2;&#60;br /&#62;
    alpha_power(ellipse) = 1.5;&#60;/p&#62;
&#60;p&#62;    BonA(water) = 6.0;&#60;br /&#62;
    BonA(ellipse) = 8.0;&#60;/p&#62;
&#60;p&#62;    medium.sound_speed = reshape(speed,[N N]);&#60;br /&#62;
    medium.sound_speed_ref = 1460;&#60;br /&#62;
    medium.density = reshape(density,[N N]);&#60;br /&#62;
    medium.alpha_coeff = reshape(alpha_coeff,[N N]);&#60;br /&#62;
    medium.alpha_power = 1.5;&#60;br /&#62;
    medium.BonA = reshape(BonA,[N N]);&#60;br /&#62;
    %medium.alpha_mode = 'no_dispersion';&#60;/p&#62;
&#60;p&#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(N, dx, N, dy);&#60;/p&#62;
&#60;p&#62;    sensors = makeCartCircle((N/2-22)*dx,nSource);&#60;br /&#62;
    sensor.mask = sensors;&#60;/p&#62;
&#60;p&#62;    source.p0 = cart2grid(kgrid, sensors(:,i));&#60;/p&#62;
&#60;p&#62;    [t_array, dt] = makeTime(kgrid, 2000);&#60;/p&#62;
&#60;p&#62;    % set the input arguments&#60;br /&#62;
    kgrid.t_array = t_array;&#60;br /&#62;
      input_args = {'PlotLayout',false, 'PMLInside', true, 'PlotScale', [0 0.05],...&#60;br /&#62;
          'RecordMovie', true, 'MovieArgs', {'compression','None'}, 'MovieType', 'image', 'MovieName', ['~/tmp/example_movie' num2str(i)]};&#60;br /&#62;
    % run the simulation&#60;br /&#62;
    sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;    if (i==1)&#60;br /&#62;
        num_t_steps = numel(t_array);&#60;br /&#62;
        data = zeros(num_t_steps,nSource);&#60;br /&#62;
    end&#60;/p&#62;
&#60;p&#62;    data(:,i) = sensor_data(i,:);&#60;br /&#62;
end &#60;/p&#62;
&#60;p&#62;figure, imagesc(abs(data)), caxis([0 0.025]);
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
