code: def test_random_seeds_from_mask(rng):
      mask = rng.integers(0, 1, size=(4, 6, 3))
      seeds = random_seeds_from_mask(
          mask, np.eye(4), seeds_count=24, seed_count_per_voxel=True
      )
      npt.assert_equal(mask.sum() * 24, len(seeds))
      seeds = random_seeds_from_mask(
          mask, np.eye(4), seeds_count=0, seed_count_per_voxel=True
      )
      npt.assert_equal(0, len(seeds))
  
      mask[:] = False
      mask[2, 2, 2] = True
      seeds = random_seeds_from_mask(
          mask, np.eye(4), seeds_count=8, seed_count_per_voxel=True
      )
      npt.assert_equal(mask.sum() * 8, len(seeds))
      assert_true(np.all((seeds > 1.5) & (seeds < 2.5)))
  
      seeds = random_seeds_from_mask(
          mask, np.eye(4), seeds_count=24, seed_count_per_voxel=False
      )
      npt.assert_equal(24, len(seeds))
      seeds = random_seeds_from_mask(
          mask, np.eye(4), seeds_count=0, seed_count_per_voxel=False
      )
      npt.assert_equal(0, len(seeds))
  
      mask[:] = False
      mask[2, 2, 2] = True
      seeds = random_seeds_from_mask(
          mask, np.eye(4), seeds_count=100, seed_count_per_voxel=False
      )
      npt.assert_equal(100, len(seeds))
      assert_true(np.all((seeds > 1.5) & (seeds < 2.5)))
  
      mask = np.zeros((15, 15, 15))
      mask[2:14, 2:14, 2:14] = 1
      seeds_npv_2 = random_seeds_from_mask(
          mask,
          np.eye(4),
          seeds_count=2,
          seed_count_per_voxel=True,
          random_seed=0,
      )[:150]
      seeds_npv_3 = random_seeds_from_mask(
          mask,
          np.eye(4),
          seeds_count=3,
          seed_count_per_voxel=True,
          random_seed=0,
      )[:150]
      assert_true(np.all(seeds_npv_2 == seeds_npv_3))
  
      seeds_nt_150 = random_seeds_from_mask(
          mask,
          np.eye(4),
          seeds_count=150,
          seed_count_per_voxel=False,
          random_seed=0,
      )[:150]
      seeds_nt_500 = random_seeds_from_mask(
          mask,
          np.eye(4),
          seeds_count=500,
          seed_count_per_voxel=False,
          random_seed=0,
      )[:150]
      assert_true(np.all(seeds_nt_150 == seeds_nt_500))
  
imports: import warnings
  import numpy
  import pytest
  from dipy.tracking import metrics
  from dipy.tracking.streamline import transform_streamlines
  from dipy.tracking.utils import connectivity_matrix, density_map, length, ndbincount, reduce_labels, seeds_from_mask, random_seeds_from_mask, target, target_line_based, unique_rows, near_roi, reduce_rois, path_length, _min_at, max_angle_from_curvature, min_radius_curvature_from_angle
  from dipy.tracking._utils import _to_voxel_coordinates
  from dipy.tracking.vox2track import streamline_mapping
  import numpy.testing
  from dipy.testing import assert_true
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 15 for calling a global function with example usage: test_random_seeds_from_mask(rng) without return types