irtk.sampling.sample_sphere

irtk.sampling.sample_sphere(batch: int, radius: float, method: Literal['uniform', 'fibonacci'] = 'uniform', axis: int = 1, phi_min: float = 0, phi_max: float = 3.141592653589793, theta_min: float = 0, theta_max: float = 6.283185307179586) torch.Tensor

Sample points on a sphere.

Parameters:
  • batch – Number of points to sample.

  • radius – Radius of the sphere.

  • method – Sampling method, either ‘uniform’ or ‘fibonacci’.

  • axis – Axis to use as up direction (0 for x, 1 for y, 2 for z).

  • phi_min – Minimum polar angle in radians.

  • phi_max – Maximum polar angle in radians.

  • theta_min – Minimum azimuthal angle in radians.

  • theta_max – Maximum azimuthal angle in radians.

Returns:

Sampled points on the sphere with shape (batch, 3).

Return type:

torch.Tensor

Raises:

ValueError – If an invalid sampling method is provided.