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_section) ss = makeSphericalSection(radius, height, [], plot_section) ss = makeSphericalSection(radius, height, width, plot_section, binary) ss = makeSphericalSection(radius, height, [], [] binary) [ss, dist_map] = makeSphericalSection(radius, height) [ss, dist_map] = makeSphericalSection(radius, height, width) [ss, dist_map] = makeSphericalSection(radius, height, [], plot_section) [ss, dist_map] = makeSphericalSection(radius, height, width, plot_section) [ss, dist_map] = makeSphericalSection(radius, height, width, plot_section, binary) [ss, dist_map] = makeSphericalSection(radius, height, [], [] binary)
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 algorithm. 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 (a diagram of the input sizes is given below). The face of the spherical section faces in the positive x-direction and the optional width parameter truncates the size in the y-direction.
If the optional input parameter binary
is set to false
(the default), the section map is returned as a double precision matrix. If it is set to true
, the map is returned as a logical matrix. The average distance between each grid point in the spherical section and its 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 |
|
Boolean controlling whether the spherical section is returned as a double precision matrix ( |
|
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-2014 Bradley Treeby and Ben Cox.