<?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: KWaveArray - Creating a cylindrical surface area in 3D</title>
		<link>http://www.k-wave.org/forum/topic/kwavearray-creating-a-cylindrical-surface-area-in-3d</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 23:38:56 +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/kwavearray-creating-a-cylindrical-surface-area-in-3d" rel="self" type="application/rss+xml" />

		<item>
			<title>maximilian.s.bader@tum.de on "KWaveArray - Creating a cylindrical surface area in 3D"</title>
			<link>http://www.k-wave.org/forum/topic/kwavearray-creating-a-cylindrical-surface-area-in-3d#post-8676</link>
			<pubDate>Tue, 29 Nov 2022 11:24:28 +0000</pubDate>
			<dc:creator>maximilian.s.bader@tum.de</dc:creator>
			<guid isPermaLink="false">8676@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello Mr. Treeby,&#60;/p&#62;
&#60;p&#62;I'm terribly sorry. Instead of passing the transducer surface points to &#60;code&#62;addCustomelement&#60;/code&#62;, I passed the sensor mask with size of the Grid.&#60;/p&#62;
&#60;p&#62;Sorry for the inconvenience and your quick response!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "KWaveArray - Creating a cylindrical surface area in 3D"</title>
			<link>http://www.k-wave.org/forum/topic/kwavearray-creating-a-cylindrical-surface-area-in-3d#post-8674</link>
			<pubDate>Mon, 28 Nov 2022 16:25:32 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8674@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I was able to run your code snippet without errors (renaming &#60;code&#62;width_elem_half&#60;/code&#62; to &#60;code&#62;width_half_elem&#60;/code&#62; and adding &#60;code&#62;karray = kWaveArray&#60;/code&#62;). It adds a 2D element (&#60;code&#62;karray.elements{1}.dim&#60;/code&#62;) into a transducer for a 3D simulation (&#60;code&#62;karray.dim&#60;/code&#62;). Can you clarify which bit you're stuck on?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>maximilian.s.bader@tum.de on "KWaveArray - Creating a cylindrical surface area in 3D"</title>
			<link>http://www.k-wave.org/forum/topic/kwavearray-creating-a-cylindrical-surface-area-in-3d#post-8671</link>
			<pubDate>Sun, 27 Nov 2022 11:05:27 +0000</pubDate>
			<dc:creator>maximilian.s.bader@tum.de</dc:creator>
			<guid isPermaLink="false">8671@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Dear all,&#60;/p&#62;
&#60;p&#62;I just checked out the new kWaveArray class to model sensor surfaces without artifacts (new in version 1.4).&#60;br /&#62;
I intended to a cylindrical surface to a 3D simulation. As this does not match any of the predefined transducer shapes, I wanted to add a custom shape. However, when I try to add the surface as CustomElement, I cannot set the dimension to 2, because I pass 3D surface positions. In the implementation of kWaveArray, I can see that for bowls the dimension is still set to 2 and then a custom method to create the surface accordingly is called to return the grid points.  Is there any possibility to define such a transducer surface as kWaveArray in 3D or without major changes in the kWaveArray class?&#60;/p&#62;
&#60;p&#62;Thanks a lot for any help!&#60;/p&#62;
&#60;p&#62;Code&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;%% Define Transducer params
width_half_elem = 5e-4;
arclength_elem_half = 2e-3;
radius_single_elem = 1e-2;
res_min = 100e-6;
upsampling_factor = 2;

%% Discretize the transducer
size_integration_area = arclength_elem_half * width_elem_half * 4;
angle_step_max = asin(res_min/upsampling_factor/radius_single_elem);
num_angle_steps_half = round((arclength_elem_half/radius_single_elem/angle_step_max));
num_width_steps_half = round(width_half_elem/(res_min/upsampling_factor));
[width_surface_discr_transd,angles_surface_discr_transd] = ...
  meshgrid((-num_width_steps_half:num_width_steps_half)*(res_min/upsampling_factor),...
  (-num_angle_steps_half:num_angle_steps_half)*angle_step_max);
num_discr_points = numel(width_surface_discr_transd);
width_surface_discr_transd = reshape(width_surface_discr_transd,[1 num_discr_points]);
angles_surface_discr_transd = reshape(angles_surface_discr_transd,[1 num_discr_points]);
array_elems = [width_surface_discr_transd;
               radius_single_elem *sin(angles_surface_discr_transd);
               radius_single_elem *(1-cos(angles_surface_discr_transd))];
karray.addCustomElement(array_elems, size_integration_area, 2, &#38;#39;Custom_Transducer_Cyl&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Resulting error message:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;Error using addCustomElement
Expected input number 1, integration_points, to be two-dimensional.

Error in kWaveArray/addCustomElement (line 608)
            validateattributes(integration_points, {&#38;#39;numeric&#38;#39;}, {&#38;#39;finite&#38;#39;, &#38;#39;real&#38;#39;, &#38;#39;2d&#38;#39;},                          &#38;#39;addCustomElement&#38;#39;, &#38;#39;integration_points&#38;#39;,1);&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
