code: def test_parcel_interface_multi_subj():
      """test parcellation interface, with multiple subjects"""
      # prepare some data
      shape = (5, 5, 5)
      nb_parcel = 10
      nb_subj = 5
      v = []
      for s in range(nb_subj):
          data = np.random.randn(np.prod(shape))
          domain = grid_domain_from_binary_array(np.ones(shape))
          g = field_from_coo_matrix_and_data(domain.topology, data)
          u, J0 = g.ward(nb_parcel)
          v.append(u)
  
      v = np.array(v).T
      tmp = np.array([np.sum(v == k, 0) for k in range(nb_parcel)])
  
      # instantiate a parcellation
      msp = MultiSubjectParcellation(domain, u, v)
      assert msp.nb_parcel == nb_parcel
      assert msp.nb_subj == nb_subj
      assert (msp.population() == tmp).all()
  
file_path: nipy/nipy/labs/spatial_models/tests/test_parcel.py
imports: import numpy
  from nipy.algorithms.graph.field import field_from_coo_matrix_and_data
  from ...utils.simul_multisubject_fmri_dataset import surrogate_2d_dataset
  from ..discrete_domain import grid_domain_from_binary_array
  from ..hierarchical_parcellation import hparcel
  from ..parcellation import MultiSubjectParcellation
label_desc: Use image node_id 2 for calling a global function with example usage: test_parcel_interface_multi_subj() without return types