code: def test_bdg_initial_direction():
      """This tests the number of initial directions." """
  
      hsph_updated = HemiSphere.from_sphere(unit_icosahedron).subdivide(
          2
      )
      vertices = hsph_updated.vertices
      bvecs = vertices
      bvals = np.ones(len(vertices)) * 1000
      bvecs = np.insert(bvecs, 0, np.array([0, 0, 0]), axis=0)
      bvals = np.insert(bvals, 0, 0)
      gtab = gradient_table(bvals, bvecs)
  
      # test that we get one direction when we have a single tensor
      sphere = HemiSphere.from_sphere(get_sphere("symmetric724"))
      voxel = single_tensor(gtab).reshape([1, 1, 1, -1])
      dti_model = dti.TensorModel(gtab)
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              message=shm.descoteaux07_legacy_msg,
              category=PendingDeprecationWarning,
          )
          boot_dg = BootDirectionGetter.from_data(
              voxel, dti_model, 30, sphere=sphere, sh_order=6
          )
      initial_direction = boot_dg.initial_direction(np.zeros(3))
      npt.assert_equal(len(initial_direction), 1)
      npt.assert_allclose(initial_direction[0], [1, 0, 0], atol=0.1)
  
      # test that we get multiple directions when we have a multi-tensor
      mevals = np.array([[1.5, 0.4, 0.4], [1.5, 0.4, 0.4]]) * 1e-3
      fracs = [60, 40]
      voxel, primary_evecs = multi_tensor(
          gtab, mevals, fractions=fracs, snr=None
      )
      voxel = voxel.reshape([1, 1, 1, -1])
      response = (np.array([0.0015, 0.0004, 0.0004]), 1)
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              message=shm.descoteaux07_legacy_msg,
              category=PendingDeprecationWarning,
          )
          csd_model = ConstrainedSphericalDeconvModel(
              gtab, response=response, sh_order=4
          )
          boot_dg = BootDirectionGetter.from_data(
              voxel,
              csd_model,
              30,
              sphere=sphere,
          )
          initial_direction = boot_dg.initial_direction(np.zeros(3))
  
      npt.assert_equal(len(initial_direction), 2)
      npt.assert_allclose(initial_direction, primary_evecs, atol=0.1)
  
file_path: dipy/dipy/direction/tests/test_bootstrap_direction_getter.py
imports: import warnings
  import numpy
  import numpy.testing
  from dipy.core.geometry import cart2sphere
  from dipy.core.gradients import gradient_table
  from dipy.core.sphere import HemiSphere, unit_icosahedron
  from dipy.data import get_sphere, get_fnames
  from dipy.direction.bootstrap_direction_getter import BootDirectionGetter
  from dipy.io.gradients import read_bvals_bvecs
  from dipy.reconst import dti, shm
  from dipy.reconst.csdeconv import ConstrainedSphericalDeconvModel, TensorModel
  from dipy.sims.voxel import multi_tensor, single_tensor
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 1 for calling a global function with example usage: test_bdg_initial_direction() without return types