code: def make_bsa_2d(
      betas,
      theta=3.0,
      sigma=5.0,
      ths=0,
      thq=0.5,
      smin=3,
      algorithm="density",
  ):
      """
      Function for performing bayesian structural analysis on a set of images.
      """
      ref_dim = np.shape(betas[0])
      n_subj = betas.shape[0]
  
      # get the functional information
      lbeta = np.array([np.ravel(betas[k]) for k in range(n_subj)]).T
  
      # the voxel volume is 1.0
      dom = domain_from_binary_array(np.ones(ref_dim))
  
      AF, BF = compute_landmarks(
          dom,
          lbeta,
          sigma,
          thq,
          ths,
          theta,
          smin,
          algorithm=algorithm,
          n_iter=100,
          burnin=10,
      )
      return AF, BF
  
file_path: nipy/nipy/labs/spatial_models/tests/test_bsa.py
imports: import numpy
  import scipy.stats
  from nipy.testing import assert_array_equal
  from ...utils.simul_multisubject_fmri_dataset import surrogate_2d_dataset
  from ..bayesian_structural_analysis import _stat_to_proba, compute_landmarks
  from ..discrete_domain import domain_from_binary_array
label_desc: Use image node_id 1 for calling a global function with example usage: make_bsa_2d(betas, theta, sigma, ths, thq, smin, algorithm) and returns: AF,  BF