diff options
Diffstat (limited to 'fg21sim')
-rw-r--r-- | fg21sim/utils/draw.py | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/fg21sim/utils/draw.py b/fg21sim/utils/draw.py index a80e301..3213fa8 100644 --- a/fg21sim/utils/draw.py +++ b/fg21sim/utils/draw.py @@ -154,45 +154,3 @@ def ellipse(r, c, r_radius, c_radius, shape): rr += upper_left[0] cc += upper_left[1] return (rr, cc) - - -def circle(r, c, radius, shape): - """Generate coordinates of pixels within the circle. - - Parameters - ---------- - r, c : int - Center coordinate of the circle. - radius : int - Radius of the circle. - shape : tuple - Image shape which is used to determine the maximum extent of output - pixel coordinates. This is useful for circles that exceed the image - size. If None, the full extent of the circle is used. - - Returns - ------- - rr, cc : integer `~numpy.ndarray` - Pixel coordinates of the circle. - May be used to directly index into an array, e.g. - ``img[rr, cc] = 1``. - - Examples - -------- - >>> from fg21sim.utils.draw import circle - >>> img = np.zeros((10, 10), dtype=np.uint8) - >>> rr, cc = circle(4, 4, 5) - >>> img[rr, cc] = 1 - >>> img - array([[0, 0, 1, 1, 1, 1, 1, 0, 0, 0], - [0, 1, 1, 1, 1, 1, 1, 1, 0, 0], - [1, 1, 1, 1, 1, 1, 1, 1, 1, 0], - [1, 1, 1, 1, 1, 1, 1, 1, 1, 0], - [1, 1, 1, 1, 1, 1, 1, 1, 1, 0], - [1, 1, 1, 1, 1, 1, 1, 1, 1, 0], - [1, 1, 1, 1, 1, 1, 1, 1, 1, 0], - [0, 1, 1, 1, 1, 1, 1, 1, 0, 0], - [0, 0, 1, 1, 1, 1, 1, 0, 0, 0], - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], dtype=uint8) - """ - return ellipse(r, c, radius, radius, shape) |