k-Wave Toolbox |
![]() ![]() |
Create a binary map of a sphere segment within a 3D grid
ss = makeSphericalSection(radius, height) ss = makeSphericalSection(radius, height, width) ss = makeSphericalSection(radius, height, width, plot_transducer) ss = makeSphericalSection(radius, height, [], plot_transducer) [ss, dist_map] = makeSphericalSection(radius, height) [ss, dist_map] = makeSphericalSection(radius, height, width) [ss, dist_map] = makeSphericalSection(radius, height, [], plot_transducer) [ss, dist_map] = makeSphericalSection(radius, height, width, plot_transducer)
makeSphericalSection
creates a binary map of a section of a spherical surface within a three-dimensional matrix. The sphere is created using an extension of the midpoint circle alogirhm. A single grid point is taken as the sphere center so the total diameter will always be an odd number of grid points. The sphere is then truncated based on the values for height and width. The face of the spherical section faces in the positive x-direction and the optional width parameter truncates the size in the y-direction.
The average distance between each grid point in the spherical section and it's contiguous neighbours can also be returned. This is given as a ratio compared to the average neighbour distance for a flat surface.
makeSphericalSection(25, 6, 15, true);
makeSphericalSection(50, 20, [], true);
|
radius of curvature [grid points] |
|
transducer height [grid points] |
|
section width (must be specified as an odd number) [grid points] |
|
Boolean controlling whether the spherical section is plotted using |
|
binary matrix containing spherical section |
|
ratio of average neighbour distance for each grid point within the spherical section compared to a flat surface |
makeBall
, makeSphere
![]() |
makeSphere | makeTime | ![]() |
© 2009-2012 Bradley Treeby and Ben Cox.