code: def test_mask_parcel():
      """Test that mask parcellation performs correctly"""
      n_parcels = 20
      shape = (10, 10, 10)
      mask_image = Nifti1Image(np.ones(shape).astype("u1"), np.eye(4))
      wim = mask_parcellation(mask_image, 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 1 for calling a global function with example usage: test_mask_parcel() without return types