code: def test_threshold_stats_img(
      data_norm_isf, img_3d_ones_eye, affine_eye
  ):
      data = data_norm_isf
      data[2:4, 5:7, 6:8] = 5.0
      stat_img = Nifti1Image(data, affine_eye)
  
      th_map, _ = threshold_stats_img(
          stat_img,
          mask_img=img_3d_ones_eye,
          alpha=0.001,
          height_control="fpr",
          cluster_threshold=0,
      )
      vals = get_data(th_map)
  
      assert np.sum(vals > 0) == 8
  
      # excessive size threshold
      th_map, z_th = threshold_stats_img(
          stat_img,
          mask_img=img_3d_ones_eye,
          alpha=0.001,
          height_control="fpr",
          cluster_threshold=10,
      )
      vals = get_data(th_map)
  
      assert np.sum(vals > 0) == 0
      assert z_th == norm.isf(0.0005)
  
      # dr threshold + bonferroni
      for control in ["fdr", "bonferroni"]:
          th_map, _ = threshold_stats_img(
              stat_img,
              mask_img=img_3d_ones_eye,
              alpha=0.05,
              height_control=control,
              cluster_threshold=5,
          )
          vals = get_data(th_map)
  
          assert np.sum(vals > 0) == 8
  
      # without a map or mask
      th_map, threshold = threshold_stats_img(
          None,
          None,
          alpha=0.05,
          height_control="fpr",
          cluster_threshold=0,
      )
  
      assert threshold > 1.64
      assert th_map is None
  
imports: import numpy
  import pytest
  from nibabel import Nifti1Image
  from numpy.testing import assert_almost_equal, assert_equal
  from scipy.stats import norm
  from nilearn.conftest import _shape_3d_default
  from nilearn.glm import cluster_level_inference, fdr_threshold, threshold_stats_img
  from nilearn.glm.thresholding import _compute_hommel_value
  from nilearn.image import get_data
label_desc: Use image node_id 5 for calling a global function with example usage: test_threshold_stats_img(data_norm_isf, img_3d_ones_eye, affine_eye) without return types