code: def test_sd_from_ball():
      dom = domain_from_binary_array(np.ones((10, 10)))
      radii = np.array([2, 2, 2])
      positions = np.array([[3, 3], [3, 7], [7, 7]])
      subdomain = subdomain_from_balls(dom, positions, radii)
      assert subdomain.k == 3
      assert_array_equal(subdomain.get_size(), np.array([9, 9, 9]))
  
imports: from os.path import dirname
  from os.path import join
  import numpy
  from nibabel import Nifti1Image, load
  from numpy.testing import assert_almost_equal, assert_array_equal
  from nipy.io.nibcompat import get_affine
  from ..discrete_domain import domain_from_binary_array, grid_domain_from_image
  from ..hroi import HROI_as_discrete_domain_blobs
  from ..mroi import subdomain_from_array, subdomain_from_balls
label_desc: Use image node_id 11 for calling a global function with example usage: test_sd_from_ball() without return types