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),
  ) -> 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
  
      See also:
          :py:meth:`~create_test_image_3d`
      """
      # Create image
      image = np.zeros(im_shape, dtype=np.int32)
      spy, spx, spz = np.ogrid[
          -centre[0] : im_shape[0] - centre[0],
          -centre[1] : im_shape[1] - centre[1],
          -centre[2] : im_shape[2] - centre[2],
      ]
      circle = (spx * spx + spy * spy + spz * spz) <= radius * radius
  
      image[circle] = 1
      image[~circle] = 0
      return image
  
file_path: MONAI/tests/test_handler_surface_distance.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from ignite.engine import Engine
  from monai.handlers import SurfaceDistance
  from tests.utils import assert_allclose
label_desc: Use image node_id 1 for calling a global function with example usage: create_spherical_seg_3d(radius, centre, im_shape) and returns: image