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

		<item>
			<title>elahehamini on "loading an external image for reconstruction"</title>
			<link>http://www.k-wave.org/forum/topic/loading-an-external-image-for-reconstruction#post-6914</link>
			<pubDate>Tue, 25 Jun 2019 08:48:38 +0000</pubDate>
			<dc:creator>elahehamini</dc:creator>
			<guid isPermaLink="false">6914@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I found out the problem and it was the name of my m-file which was c and the code tried to execute it as a function and that's why I got an error on line &#60;code&#62;p = c.^2 .* (rhox + rhoy)&#60;/code&#62; . Thank you so much for your time
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "loading an external image for reconstruction"</title>
			<link>http://www.k-wave.org/forum/topic/loading-an-external-image-for-reconstruction#post-6913</link>
			<pubDate>Tue, 25 Jun 2019 08:43:27 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6913@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;If I set&#60;/p&#62;
&#60;p&#62;&#60;code&#62;p0_image = rand(128, 128);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;the simulation runs without errors. Are the values in F real numbers in single/double precision?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>elahehamini on "loading an external image for reconstruction"</title>
			<link>http://www.k-wave.org/forum/topic/loading-an-external-image-for-reconstruction#post-6912</link>
			<pubDate>Tue, 25 Jun 2019 08:10:36 +0000</pubDate>
			<dc:creator>elahehamini</dc:creator>
			<guid isPermaLink="false">6912@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;yes, my image is the same size as the grid and I use it to define the source. the Image is 128*128 pixels. This is the code: &#60;/p&#62;
&#60;p&#62;    &#60;code&#62;p0_magnitude = 1;&#60;/code&#62;&#60;br /&#62;
    &#60;code&#62;load d1.mat&#60;/code&#62;&#60;br /&#62;
   &#60;code&#62;F =d1;&#60;/code&#62;&#60;br /&#62;
    &#60;code&#62;p0_image =p0_magnitude* F;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;    % assign the grid size and create the computational grid&#60;br /&#62;
    &#60;code&#62;PML_size = 20;              % size of the PML in grid points&#60;/code&#62;&#60;br /&#62;
   &#60;code&#62;Nx = 168 - 2 * PML_size;    % number of grid points in the x direction&#60;/code&#62;&#60;br /&#62;
    &#60;code&#62;Ny = 168 - 2 * PML_size;    % number of grid points in the y direction&#60;/code&#62;&#60;br /&#62;
   &#60;code&#62;x = 2.56e-3;                  % total grid size [m]&#60;/code&#62;&#60;br /&#62;
    &#60;code&#62;y = 2.56e-3;                  % total grid size [m]&#60;/code&#62;&#60;br /&#62;
   &#60;code&#62;dx = x / Nx;                % grid point spacing in the x direction [m]&#60;/code&#62;&#60;br /&#62;
   &#60;code&#62;dy = y / Ny;                % grid point spacing in the y direction [m]&#60;/code&#62;&#60;br /&#62;
    &#60;code&#62;kgrid = kWaveGrid(Nx, dx, Ny, dy);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;    % assign to the source structure&#60;br /&#62;
    &#60;code&#62;source.p0 = p0_image;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;    % define the properties of the propagation medium&#60;br /&#62;
    &#60;code&#62;medium.sound_speed = 1500;  % [m/s]&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;    % define a centered Cartesian circular sensor&#60;br /&#62;
    &#60;code&#62;sensor_radius = 1.26e-3;     % [m]&#60;/code&#62;&#60;br /&#62;
    &#60;code&#62;sensor_angle = pi;      % [rad]&#60;/code&#62;&#60;br /&#62;
   &#60;code&#62;sensor_pos = [0, 0];        % [m]&#60;/code&#62;&#60;br /&#62;
    &#60;code&#62;num_sensor_points = 70;&#60;/code&#62;&#60;br /&#62;
    &#60;code&#62;cart_sensor_mask = makeCartCircle(sensor_radius, num_sensor_points, sensor_pos, sensor_angle);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;    % assign to sensor structure&#60;br /&#62;
    &#60;code&#62;sensor.mask = cart_sensor_mask;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;    % create the time array&#60;br /&#62;
    &#60;code&#62;kgrid.makeTime(medium.sound_speed);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;    % set the input options&#60;br /&#62;
    &#60;code&#62;input_args = {&#38;#39;Smooth&#38;#39;, true, &#38;#39;PMLInside&#38;#39;, false, &#38;#39;PlotPML&#38;#39;, false, &#38;#39;PlotSim&#38;#39;, true, &#38;#39;DataCast&#38;#39;, &#38;#39;single&#38;#39;};&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;    % run the simulation&#60;br /&#62;
    &#60;code&#62;sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});&#60;/code&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "loading an external image for reconstruction"</title>
			<link>http://www.k-wave.org/forum/topic/loading-an-external-image-for-reconstruction#post-6906</link>
			<pubDate>Tue, 25 Jun 2019 05:50:11 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6906@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi elahehamini,&#60;/p&#62;
&#60;p&#62;It's hard to say without seeing more details. Is your image the same size as the grid (Nx, Ny)? Are you using it to define the source or the medium properties?&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>elahehamini on "loading an external image for reconstruction"</title>
			<link>http://www.k-wave.org/forum/topic/loading-an-external-image-for-reconstruction#post-6905</link>
			<pubDate>Mon, 24 Jun 2019 16:55:31 +0000</pubDate>
			<dc:creator>elahehamini</dc:creator>
			<guid isPermaLink="false">6905@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I have simulated an image using Monte Carlo simulation and saved it as a 2D array and when I load it as an external image to have it reconstructed I get an error in the acoustical forward simulation using kspaceFirstOrder2D which refers it to the line  p = c.^2 .* (rhox + rhoy) in the kspaceFirstOrder2D  code. what am I doing wrong?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
