code: def test_mask_parcel_multi_subj(in_tmp_path):
      """Test that mask parcellation performs correctly"""
      rng = np.random.RandomState(0)
      n_parcels = 20
      shape = (10, 10, 10)
      n_subjects = 5
      mask_images = []
      for subject in range(n_subjects):
          path = f"mask{subject}.nii"
          arr = rng.rand(*shape) > 0.1
          save(Nifti1Image(arr.astype("u1"), np.eye(4)), path)
          mask_images.append(path)
  
      wim = mask_parcellation(mask_images, n_parcels)
      assert_array_equal(
          np.unique(wim.get_fdata()), np.arange(n_parcels)
      )
  
file_path: nipy/nipy/labs/spatial_models/tests/test_parcel_io.py
imports: from os.path import exists
  import numpy
  from nibabel import Nifti1Image, save
  from numpy.testing import assert_array_equal
  from ...utils.simul_multisubject_fmri_dataset import surrogate_3d_dataset
  from ..discrete_domain import grid_domain_from_shape
  from ..hierarchical_parcellation import hparcel
  from ..parcel_io import fixed_parcellation, mask_parcellation, parcellation_based_analysis
label_desc: Use image node_id 2 for calling a global function with example usage: test_mask_parcel_multi_subj(in_tmp_path) without return types