code: def test_mapmri_odf(radial_order=6):
      gtab = get_gtab_taiwan_dsi()
  
      # load repulsion 724 sphere
      sphere = default_sphere
  
      # load icosahedron sphere
      l1, l2, l3 = [0.0015, 0.0003, 0.0003]
      data, golden_directions = generate_signal_crossing(
          gtab, l1, l2, l3, angle2=90
      )
      mapmod = MapmriModel(
          gtab,
          radial_order=radial_order,
          laplacian_regularization=True,
          laplacian_weighting=0.01,
      )
      # repulsion724
      sphere2 = create_unit_sphere(5)
      mapfit = mapmod.fit(data)
      odf = mapfit.odf(sphere)
  
      directions, _, _ = peak_directions(odf, sphere, 0.35, 25)
      assert_equal(len(directions), 2)
      assert_almost_equal(
          angular_similarity(directions, golden_directions), 2, 1
      )
  
      # 5 subdivisions
      odf = mapfit.odf(sphere2)
      directions, _, _ = peak_directions(odf, sphere2, 0.35, 25)
      assert_equal(len(directions), 2)
      assert_almost_equal(
          angular_similarity(directions, golden_directions), 2, 1
      )
  
      sb_dummies = sticks_and_ball_dummies(gtab)
      for sbd in sb_dummies:
          data, golden_directions = sb_dummies[sbd]
          asmfit = mapmod.fit(data)
          odf = asmfit.odf(sphere2)
          directions, _, _ = peak_directions(odf, sphere2, 0.35, 25)
          if len(directions) <= 3:
              assert_equal(len(directions), len(golden_directions))
          if len(directions) > 3:
              assert_equal(gfa(odf) < 0.1, True)
  
      # for the isotropic implementation check if the odf spherical harmonics
      # actually represent the discrete sphere function.
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              message=descoteaux07_legacy_msg,
              category=PendingDeprecationWarning,
          )
          mapmod = MapmriModel(
              gtab,
              radial_order=radial_order,
              laplacian_regularization=True,
              laplacian_weighting=0.01,
              anisotropic_scaling=False,
          )
      mapfit = mapmod.fit(data)
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              message=descoteaux07_legacy_msg,
              category=PendingDeprecationWarning,
          )
          odf = mapfit.odf(sphere)
      odf_sh = mapfit.odf_sh()
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              message=descoteaux07_legacy_msg,
              category=PendingDeprecationWarning,
          )
          odf_from_sh = sh_to_sf(
              odf_sh, sphere, radial_order, basis_type=None, legacy=True
          )
      assert_almost_equal(odf, odf_from_sh, 10)
  
imports: import platform
  import time
  from math import factorial
  from scipy.special import gamma
  import scipy.integrate
  import warnings
  import numpy
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_equal, assert_, assert_raises
  import pytest
  from dipy.core.sphere_stats import angular_similarity
  from dipy.core.subdivide_octahedron import create_unit_sphere
  from dipy.data import get_gtab_taiwan_dsi, default_sphere
  from dipy.direction.peaks import peak_directions
  from dipy.reconst.mapmri import MapmriModel, mapmri_index_matrix
  from dipy.reconst import dti, mapmri
  from dipy.reconst.odf import gfa
  from dipy.reconst.tests.test_dsi import sticks_and_ball_dummies
  from dipy.reconst.shm import sh_to_sf, descoteaux07_legacy_msg
  from dipy.sims.voxel import multi_tensor, multi_tensor_pdf, add_noise, single_tensor, cylinders_and_ball_soderman
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 23 for calling a global function with example usage: test_mapmri_odf(radial_order) without return types