k-Wave Toolbox |
![]() ![]() |
Create a binary map of filled ball within a 3D grid
ball = makeBall(Nx, Ny, Nz, cx, cy, cz, radius)
makeBall
creates a binary map of a filled ball within a three-dimensional grid (the ball position is denoted by 1's in the matrix with 0's elsewhere). A single pixel is taken as the disc centre thus the total diameter of the ball will always be an odd number of pixels. A visualisation of the 3D grid returned by calling makeBall(64, 64, 64, 32, 32, 32, 20)
is given below.
|
size of the 3D grid [number of pixels] |
|
centre of the ball [pixel coordinates] |
|
ball radius [number of pixels] |
|
3D binary map of a filled ball |
makeCircle
, makeDisc
, makeSphere
![]() |
loadImage | makeCartCircle | ![]() |
© 2009 Bradley Treeby and Ben Cox.