code: def test_parcel_feature_multi_subj():
      """Test parcellation feature 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
      msp = MultiSubjectParcellation(domain, u, v)
  
      # test a multi_dimensional feature
      # dimension 1
      msp.make_feature("data", np.random.randn(np.prod(shape), nb_subj))
      assert msp.get_feature("data").shape == (nb_parcel, nb_subj)
  
      # dimension>1
      dim = 4
      msp.make_feature(
          "data", np.random.randn(np.prod(shape), nb_subj, dim)
      )
      assert msp.get_feature("data").shape == (nb_parcel, nb_subj, dim)
  
      # msp.features['data'] has been overridden
      assert list(msp.features.keys()) == ["data"]
  
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 4 for calling a global function with example usage: test_parcel_feature_multi_subj() without return types