k-Wave Toolbox |

# makeDisc

Create a binary map of a filled disc within a 2D grid

## Syntax

    disc = makeDisc(Nx, Nz, cx, cz, radius)
    disc = makeDisc(Nx, Nz, cx, cz, radius, plot_disc)

## Description

`makeDisc` creates a binary map of a filled disc within a two-dimensional grid (the disc 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 disc will always be an odd number of pixels. As the returned disc has a constant pixel radius, if used within a k-space grid where dx and dz are not equal, the disc will appear oval shaped. If part of the disc overlaps the grid edge, the rest of the disc will wrap to the grid edge on the opposite side. The plot that is displayed after calling `makeDisc(128, 128, 64, 64, 30, true)` is given below.

## Inputs

`Nx, Ny` | size of the 2D grid [number of pixels]
`cx, cy` | centre of the disc [pixel coordinates]
`radius` | disc radius [number of pixels]

## Optional Inputs

`plot_circle` | Boolean controlling whether the disc is plotted using `imagesc` (default = false)

## Outputs

`disc` | 2D binary map of a filled disc

## Examples

- Homogeneous Propagation Medium
- Using A Binary Sensor Mask
- Heterogeneous Propagation Medium
- Saving Movie Files
- Modelling A Focussed Detector
- 2D FFT Reconstruction For A Line Sensor Example
- 2D Time Reversal Reconstruction For A Line Sensor Example
- 2D Time Reversal Reconstruction Using Directional Sensors

## See Also

`makeCircle`, `makeBall`

© 2009, 2010 Bradley Treeby and Ben Cox.