code: def coord_bsa(
      domain,
      betas,
      theta=3.0,
      dmax=5.0,
      ths=0,
      thq=0.5,
      smin=0,
      afname=None,
  ):
      """main function for  performing bsa on a dataset
      where bsa =  nipy.labs.spatial_models.bayesian_structural_analysis
  
      Parameters
      ----------
      domain: image instance,
            referential- and domain-defining image
      betas: array of shape (nbnodes, subjects),
             the multi-subject statistical maps
      theta: float, optional
             first level threshold
      dmax: float>0, optional
            expected cluster std in the common space in units of coord
      ths: int, >=0), optional
           representatitivity threshold
      thq: float, optional,
           posterior significance threshold should be in [0,1]
      smin: int, optional,
            minimal size of the regions to validate them
      afname: string, optional
              path where intermediate results cam be pickled
  
      Returns
      -------
      afcoord array of shape(number_of_regions,3):
              coordinate of the found landmark regions
      """
      from ..spatial_models.bayesian_structural_analysis import (
          compute_BSA_quick,
      )
  
      crmap, AF, BF, p = compute_BSA_quick(
          domain, betas, dmax, thq, smin, ths, theta, verbose=0
      )
      if AF is None:
          return None
      if afname is not None:
          import pickle
  
          pickle.dump(AF, afname)
      afcoord = AF.discrete_to_roi_features("position")
      return afcoord
  
imports: import numpy
  from nipy.io.nibcompat import get_affine
  from nipy.labs.spatial_models.discrete_domain import grid_domain_from_binary_array
label_desc: Use image node_id 19 for calling a global function with example usage: coord_bsa(domain, betas, theta, dmax, ths, thq, smin, afname) and returns: afcoord, None