code: def test_closest_peak_tracker():
      """This tests that the Closest Peak Direction Getter plays nice
      LocalTracking and produces reasonable streamlines in a simple example.
      """
      sphere = HemiSphere.from_sphere(unit_octahedron)
  
      # A simple image with three possible configurations, a vertical tract,
      # a horizontal tract and a crossing
      pmf_lookup = np.array(
          [
              [0.0, 0.0, 1.0],
              [1.0, 0.0, 0.0],
              [0.0, 1.0, 0.0],
              [0.5, 0.5, 0.0],
          ]
      )
      simple_image = np.array(
          [
              [0, 1, 0, 0, 0, 0],
              [0, 1, 0, 0, 0, 0],
              [2, 3, 2, 2, 2, 0],
              [0, 1, 0, 0, 0, 0],
              [0, 1, 0, 0, 0, 0],
          ]
      )
  
      simple_image = simple_image[..., None]
      pmf = pmf_lookup[simple_image]
  
      seeds = [np.array([1.0, 1.0, 0.0]), np.array([2.0, 4.0, 0.0])]
  
      mask = (simple_image > 0).astype(float)
      sc = BinaryStoppingCriterion(mask)
  
      dg = ClosestPeakDirectionGetter.from_pmf(
          pmf, 90, sphere, pmf_threshold=0.1
      )
      streamlines = Streamlines(
          LocalTracking(dg, sc, seeds, np.eye(4), 1.0)
      )
  
      expected = [
          np.array(
              [
                  [0.0, 1.0, 0.0],
                  [1.0, 1.0, 0.0],
                  [2.0, 1.0, 0.0],
                  [3.0, 1.0, 0.0],
                  [4.0, 1.0, 0.0],
              ]
          ),
          np.array(
              [
                  [2.0, 0.0, 0.0],
                  [2.0, 1.0, 0.0],
                  [2.0, 2.0, 0.0],
                  [2.0, 3.0, 0.0],
                  [2.0, 4.0, 0.0],
              ]
          ),
      ]
  
      if not allclose(streamlines[0], expected[0]):
          raise AssertionError()
      if not allclose(streamlines[1], expected[1]):
          raise AssertionError()
  
imports: from logging import warn
  import warnings
  import nibabel
  import numpy
  import numpy.testing
  from dipy.core.gradients import gradient_table
  from dipy.core.sphere import HemiSphere, unit_octahedron
  from dipy.data import get_fnames, get_sphere
  from dipy.direction import BootDirectionGetter, ClosestPeakDirectionGetter, DeterministicMaximumDirectionGetter, PeaksAndMetrics, ProbabilisticDirectionGetter, PTTDirectionGetter
  from dipy.reconst.csdeconv import ConstrainedSphericalDeconvModel
  from dipy.reconst.shm import descoteaux07_legacy_msg
  from dipy.tracking.local_tracking import LocalTracking, ParticleFilteringTracking
  from dipy.tracking.streamline import Streamlines
  from dipy.tracking.stopping_criterion import ActStoppingCriterion, BinaryStoppingCriterion, ThresholdStoppingCriterion, StreamlineStatus
  from dipy.tracking.utils import random_seeds_from_mask, seeds_from_mask
  from dipy.sims.voxel import single_tensor, multi_tensor
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 9 for calling a global function with example usage: test_closest_peak_tracker() without return types