code: def create_spherical_seg_3d(
      radius: float = 20.0,
      centre: tuple[int, int, int] = (49, 49, 49),
      im_shape: tuple[int, int, int] = (99, 99, 99),
      im_spacing: tuple[float, float, float] = (1.0, 1.0, 1.0),
  ) -> np.ndarray:
      """
      Return a 3D image with a sphere inside. Voxel values will be
      1 inside the sphere, and 0 elsewhere.
  
      Args:
          radius: radius of sphere (in terms of number of voxels, can be partial)
          centre: location of sphere centre.
          im_shape: shape of image to create.
          im_spacing: spacing of image to create.
  
      See also:
          :py:meth:`~create_test_image_3d`
      """
      # Create image
      image = np.zeros(im_shape, dtype=np.int32)
      spy, spx, spz = np.ogrid[
          : im_shape[0], : im_shape[1], : im_shape[2]
      ]
  
      spy = spy.astype(float) * im_spacing[0]
      spx = spx.astype(float) * im_spacing[1]
      spz = spz.astype(float) * im_spacing[2]
  
      spy -= centre[0]
      spx -= centre[1]
      spz -= centre[2]
  
      circle = (spx * spx + spy * spy + spz * spz) <= radius * radius
  
      image[circle] = 1
      image[~circle] = 0
      return image
  
file_path: MONAI/tests/test_surface_distance.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from parameterized import parameterized
  from monai.metrics import SurfaceDistanceMetric
label_desc: Use image node_id 1 for calling a global function with example usage: create_spherical_seg_3d(radius, centre, im_shape, im_spacing) and returns: image