code: def _dpmm(
      coords,
      alpha,
      null_density,
      dof,
      prior_precision,
      prior_h0,
      subjects,
      sampling_coords=None,
      n_iter=1000,
      burnin=100,
      co_clust=False,
  ):
      """Apply the dpmm analysis to compute clusters from regions coordinates"""
      from nipy.algorithms.clustering.imm import MixedIMM
  
      dim = coords.shape[1]
      migmm = MixedIMM(alpha, dim)
      migmm.set_priors(coords)
      migmm.set_constant_densities(
          null_dens=null_density, prior_dens=null_density
      )
      migmm._prior_dof = dof
      migmm._prior_scale = np.diag(prior_precision[0] / dof)
      migmm._inv_prior_scale_ = [
          np.diag(dof * 1.0 / (prior_precision[0]))
      ]
      migmm.sample(
          coords,
          null_class_proba=prior_h0,
          niter=burnin,
          init=False,
          kfold=subjects,
      )
  
      # sampling
      like, pproba, co_clustering = migmm.sample(
          coords,
          null_class_proba=prior_h0,
          niter=n_iter,
          kfold=subjects,
          sampling_points=sampling_coords,
          co_clustering=True,
      )
  
      if co_clust:
          return like, 1 - pproba, co_clustering
      else:
          return like, 1 - pproba
  
file_path: nipy/nipy/labs/spatial_models/bayesian_structural_analysis.py
imports: import numpy
  import scipy.stats
  from nipy.algorithms.graph import wgraph_from_coo_matrix
  from ...algorithms.statistics.empirical_pvalue import NormalEmpiricalNull, gamma_gaussian_fit, three_classes_GMM_fit
  from .hroi import HROI_as_discrete_domain_blobs
  from .structural_bfls import build_landmarks
label_desc: Use image node_id 3 for calling a global function with example usage: _dpmm(coords, alpha, null_density, dof, prior_precision, prior_h0, subjects, sampling_coords, n_iter, burnin, co_clust) and returns: like,  unknown,  co_clustering, like,  unknown