insert_sphere#
- insert_sphere(im, c, r, v=True, overwrite=True)[source]#
Inserts a sphere of a specified radius into a given image
- Parameters:
im (array_like) – Image into which the sphere should be inserted
c (array_like) – The [x, y, z] coordinate indicating the center of the sphere
r (int) – The radius of sphere to insert
v (int) – The value to put into the sphere voxels. The default is
True
which corresponds to inserting spheres into a Boolean image. If a numerical value is given,im
is converted to the same type asv
.overwrite (boolean) – If
True
(default) then the sphere overwrites whatever values are present inim
. IfFalse
then the sphere values are only inserted into locations that are 0 orFalse
.
- Returns:
image – The original image with a sphere inerted at the specified location
- Return type:
ndarray
Examples
Click here to view online example.