<?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: Slightly different results between kspaceFirstOrder2D and kspaceFirstOrder2DG</title>
		<link>http://www.k-wave.org/forum/topic/slightly-different-results-between-kspacefirstorder2d-and-kspacefirstorder2dg</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 01:49:48 +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/slightly-different-results-between-kspacefirstorder2d-and-kspacefirstorder2dg" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "Slightly different results between kspaceFirstOrder2D and kspaceFirstOrder2DG"</title>
			<link>http://www.k-wave.org/forum/topic/slightly-different-results-between-kspacefirstorder2d-and-kspacefirstorder2dg#post-8249</link>
			<pubDate>Wed, 21 Jul 2021 14:31:14 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8249@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Neo,&#60;/p&#62;
&#60;p&#62;If you normalise to the maximum value in the grid, the differences between the C++ and MATLAB codes should be on the order of single precision (e.g., 1e-5 to 1e-6). We have a test code that runs a large number of comparisons under different scenarios.&#60;/p&#62;
&#60;p&#62;There are a number of options that aren't supported in the C++/CUDA codes, and unfortunately there is no currently no warning that these are being ignored. I will address this with the next release.&#60;/p&#62;
&#60;p&#62;In the interim, some of the non-supported options are:&#60;br /&#62;
- Anything related to display or movies (there is no display)&#60;br /&#62;
- Cartesian sensor mask&#60;br /&#62;
- &#60;code&#62;medium.alpha_mode&#60;/code&#62;&#60;br /&#62;
- &#60;code&#62;medium.alpha_filter&#60;/code&#62;&#60;br /&#62;
- &#60;code&#62;medium.alpha_sign&#60;/code&#62;&#60;br /&#62;
- &#60;code&#62;sensor.directivity_angle&#60;/code&#62;&#60;br /&#62;
- &#60;code&#62;sensor.directivity_size&#60;/code&#62;&#60;br /&#62;
- &#60;code&#62;sensor.directivity_pattern&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Neo on "Slightly different results between kspaceFirstOrder2D and kspaceFirstOrder2DG"</title>
			<link>http://www.k-wave.org/forum/topic/slightly-different-results-between-kspacefirstorder2d-and-kspacefirstorder2dg#post-8223</link>
			<pubDate>Wed, 23 Jun 2021 16:13:14 +0000</pubDate>
			<dc:creator>Neo</dc:creator>
			<guid isPermaLink="false">8223@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I have uploaded some Matlab Files so that you can easily check these differences yourself.&#60;br /&#62;
You can download these files here:&#60;br /&#62;
&#60;a href=&#34;https://ruhr-uni-bochum.sciebo.de/s/LxtleUpNbREHSWi&#34; rel=&#34;nofollow&#34;&#62;https://ruhr-uni-bochum.sciebo.de/s/LxtleUpNbREHSWi&#60;/a&#62;&#60;br /&#62;
The password is: kwave13&#60;/p&#62;
&#60;p&#62;Just download the folder &#34;kWave_OptimizedSimFct_Debugging&#34;, add all subfolders to the active Matlab path and run the script &#34;MainScript_SimFctDebugging.m&#34;. The Script automatically loads the already simulated data that is stored in the folder &#34;SimulationData&#34; and visualizes the RF data.&#60;/p&#62;
&#60;p&#62;I suspect that the difference is caused by numerical inaccuracies/noise, that is different for the optimized and non-optimized functions. Or is the simulation in the optimized simulation functions implemented differently than in the Matlab version? I would really like to know if these differences are normal or not and what actually causes them.&#60;/p&#62;
&#60;p&#62;The manual says on page 58:&#60;br /&#62;
&#34;To test whether the CPU/GPU codes are working correctly, open the “Diagnostic Ultrasound Simultion, Simulating Ultrasound Beam Patterns Example”, replace kspaceFirstOrder3D&#60;br /&#62;
with kspaceFirstOrder3DC or kspaceFirstOrder3DG, then run the simulation and verify&#60;br /&#62;
the outputs are the same.&#34;&#60;br /&#62;
If the difference in simulation results is normal, this section of text causes some confusion
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Neo on "Slightly different results between kspaceFirstOrder2D and kspaceFirstOrder2DG"</title>
			<link>http://www.k-wave.org/forum/topic/slightly-different-results-between-kspacefirstorder2d-and-kspacefirstorder2dg#post-8222</link>
			<pubDate>Mon, 21 Jun 2021 16:28:19 +0000</pubDate>
			<dc:creator>Neo</dc:creator>
			<guid isPermaLink="false">8222@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi,&#60;br /&#62;
I have a quick question about the new kspaceFirstOrder2DG Function which was published with the 1.3 release of kwave. Until now I used kspaceFirstOrder2D with DataCast set to gpuArray-single. To speed up simulations I want to switch to the optimized simulation function and thus tried the kspaceFirstOrder2DG function. I downloaded the compiled binary fdiles and put them into the binary folder of the kwave toolbox.&#60;br /&#62;
I wanted to be sure, that both functions return the same simulation result but actually this is not the case. When I compare the simulation results, I get and RMSE of 0.0379 and a global maximum absolut difference of 0.3797.&#60;br /&#62;
The deviation is small and the reconstructed b-Mode images look the same, but I wonder if this difference between the simulation results is normal?&#60;/p&#62;
&#60;p&#62;The manual says that &#34;not all simulation options are currently supported by the CPU/GPU code. The sensor mask must be given as either a binary matrix or (...). All display parameters are ignored&#34;. Are there other restrictions which one should know, when using the optimized code?&#60;/p&#62;
&#60;p&#62;(I get the same difference in data when I use kspaceFirstOrder2D with DataCast set to Single and kspaceFirstOrder2DC)
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
