code: def subdomain_from_array(labels, affine=None, nn=0):
      """Return a SubDomain from an n-d int array
  
      Parameters
      ----------
      label: np.array instance
        A supposedly boolean array that yields the regions.
      affine: np.array, optional
        Affine transform that maps the array coordinates
        to some embedding space by default, this is np.eye(dim+1, dim+1).
      nn: int,
        Neighboring system considered.
        Unused at the moment.
  
      Notes
      -----
      Only labels > -1 are considered.
  
      """
      dom = ddom.grid_domain_from_binary_array(
          np.ones(labels.shape), affine=affine, nn=nn
      )
      return SubDomains(dom, labels.astype(np.int_))
  
imports: import numpy
  from nibabel import Nifti1Image, load
  from nipy.io.nibcompat import get_affine, get_header
  from .None import discrete_domain
label_desc: Use image node_id 1 for calling a global function with example usage: subdomain_from_array(labels, affine, nn) and returns: SubDomains