rockverse.region.Sphere#

class rockverse.region.Sphere(p, r, region='inside')[source]#

Defines spherical region of interest.

Note

For performance, region methods are dynamically created at class instantiation, and therefore the region parameters cannot be changed after the object is created.

Parameters:
  • p (3-element tuple, list, or Numpy array) – Point defining the spatial coordinates (in voxel units) for center of the sphere.

  • r (int or float) – Sphere radius in voxel units. Must be non-negative.

  • region ({'inside', 'outside'}, optional) – Whether to consider the region inside or outside the sphere surface. Defaults to ‘inside’.

Attributes#

Sphere.p

Point defining the center of the sphere.

Sphere.r

Sphere radius.

Sphere.region

Whether to consider the region inside or outside the cylinder surface.

Methods#

Sphere.contains_point(x, y, z)

Check if a point (x, y, z) belongs to the region.