code: def test_region_extractor_strategy_percentile(maps_and_mask):
      maps, mask_img = maps_and_mask
  
      extractor = RegionExtractor(
          maps,
          threshold=30,
          thresholding_strategy="percentile",
          mask_img=mask_img,
      )
      extractor.fit()
  
      assert extractor.index_, np.ndarray
      assert extractor.regions_img_ != ""
      assert extractor.regions_img_.shape[-1] >= N_REGIONS
  
      n_regions_extracted = extractor.regions_img_.shape[-1]
      shape = (91, 109, 91, 7)
      expected_signal_shape = (7, n_regions_extracted)
      n_subjects = 3
      for _ in range(n_subjects):
          # smoke test NiftiMapsMasker transform inherited in Region Extractor
          signal = extractor.transform(_img_4d_zeros(shape=shape))
  
          assert expected_signal_shape == signal.shape
  
imports: import numpy
  import pytest
  from nibabel import Nifti1Image
  from scipy.ndimage import label
  from nilearn._utils.data_gen import generate_labeled_regions, generate_maps
  from nilearn._utils.exceptions import DimensionError
  from nilearn.conftest import _affine_eye, _img_4d_zeros, _shape_3d_default
  from nilearn.image import get_data
  from nilearn.regions import RegionExtractor, connected_label_regions, connected_regions
  from nilearn.regions.region_extractor import _remove_small_regions, _threshold_maps_ratio
label_desc: Use image node_id 18 for calling a global function with example usage: test_region_extractor_strategy_percentile(maps_and_mask) without return types