<?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: how to generate a cylindrical transducer in 3D Space</title>
		<link>http://www.k-wave.org/forum/topic/how-to-generate-a-cylindrical-transducer-in-3d-space</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 23:32:12 +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/how-to-generate-a-cylindrical-transducer-in-3d-space" rel="self" type="application/rss+xml" />

		<item>
			<title>peiliu on "how to generate a cylindrical transducer in 3D Space"</title>
			<link>http://www.k-wave.org/forum/topic/how-to-generate-a-cylindrical-transducer-in-3d-space#post-6659</link>
			<pubDate>Sat, 24 Nov 2018 15:33:48 +0000</pubDate>
			<dc:creator>peiliu</dc:creator>
			<guid isPermaLink="false">6659@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;oh,thank you very much!For some reason I didn't see your reply until now.I have solved the problem.But thank you all the same.Your suggestion has given me a lot of inspiration,thank you a lot~
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Anthony on "how to generate a cylindrical transducer in 3D Space"</title>
			<link>http://www.k-wave.org/forum/topic/how-to-generate-a-cylindrical-transducer-in-3d-space#post-6653</link>
			<pubDate>Fri, 16 Nov 2018 11:33:50 +0000</pubDate>
			<dc:creator>Anthony</dc:creator>
			<guid isPermaLink="false">6653@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;PS : By the way I made the code easy to read but, of course, the use of bsxfun() is much more elegant than repmat() ;-)&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;%% Axis permutation (I assume a main propagation axis along Z and a main cylinder axis along Y)
arcMask = reshape(arcMask,[Nx,1,Nz]);
extrusionVector = [zeros(1,(Ny-L)/2),ones(1,L),zeros(1,(Ny-L)/2)];
source.p_mask = bsxfun(@times,arcMask,extrusionVector);&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Anthony on "how to generate a cylindrical transducer in 3D Space"</title>
			<link>http://www.k-wave.org/forum/topic/how-to-generate-a-cylindrical-transducer-in-3d-space#post-6652</link>
			<pubDate>Fri, 16 Nov 2018 11:27:26 +0000</pubDate>
			<dc:creator>Anthony</dc:creator>
			<guid isPermaLink="false">6652@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi, &#60;/p&#62;
&#60;p&#62;I am using k-Wave since a few years, so there might be quicker ways to do it now, but you can define transducers of arbitrary shape by making a binary mask. &#60;/p&#62;
&#60;p&#62;See the example entitled &#34;Simulating Transducer Field Patterns Example&#34;.&#60;/p&#62;
&#60;p&#62;A simple way of making a cylinder is, for example, to use makeArc and then extrude the arc:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;clearvars
close all
clc

% Transducers parameters
R = 11; % curvature radius (unit: grid points)
L = 21; % cylinder length (unit: grid points)
diameter = 15; % aperture diameter (length of line connecting arc endpoints) (unit: grid points)

% Binary mask initialisation
Nx = 25; % my example only works properly if it is odd
Ny = 25; % my example only works properly if it is odd
Nz = 35; 

%% Arc in 2D
arcMask = makeArc([Nx, Nz], [ceil(Nx/2) 2], R, diameter, [ceil(Nx/2) Nz]);

figure(1)
clf
imagesc(arcMask);
axis image

%% Axis permutation (I assume a main propagation axis along Z and a main cylinder axis along Y)
arcMask = reshape(arcMask,[Nx,1,Nz]);
source.p_mask = repmat(arcMask,[1 Ny 1]); % extrusion
source.p_mask(:,1:(Ny-L)/2,:) = 0; % crop the left border
source.p_mask(:,Ny-(Ny-L)/2+1:Ny,:) = 0; % crop the right border

%% 3D display
voxelPlot(source.p_mask); % just for fun&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>peiliu on "how to generate a cylindrical transducer in 3D Space"</title>
			<link>http://www.k-wave.org/forum/topic/how-to-generate-a-cylindrical-transducer-in-3d-space#post-6649</link>
			<pubDate>Thu, 15 Nov 2018 15:48:17 +0000</pubDate>
			<dc:creator>peiliu</dc:creator>
			<guid isPermaLink="false">6649@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello，&#60;br /&#62;
Thank you for your toolbox.And I'm a student in high school.I'm confusing how to generate a cylinfrical in 3D Kgrid? Itry to refer the planar transducer but failed.Can you help me.&#60;br /&#62;
Thanks in advance!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
