class_docstr: Extract data from a SurfaceImage, averaging over atlas regions.
  
  Parameters
  ----------
  labels_img : SurfaceImage object
      Region definitions, as one image of labels.
  
  label_names : :obj:`list` of :obj:`str`, default=None
      Full labels corresponding to the labels image.
  
  Attributes
  ----------
  labels_data_ : :obj:`numpy.ndarray`
  
  labels_ : :obj:`numpy.ndarray`
  
  label_names_ : :obj:`numpy.ndarray`
class_docstr_tok: ["Extract","data","from","a","SurfaceImage",",","averaging","over","atlas","regions",".","Parameters","--","--","--","--","--","labels_img",":","SurfaceImage","object","Region","definitions",",","as","one","image","of","labels",".","label_names",":",":","obj",":","`","list","`","of",":","obj",":","`","str","`",",","default=None","Full","labels","corresponding","to","the","labels","image",".","Attributes","--","--","--","--","--","labels_data_",":",":","obj",":","`","numpy.ndarray","`","labels_",":",":","obj",":","`","numpy.ndarray","`","label_names_",":",":","obj",":","`","numpy.ndarray","`"]
docstr: Extract signals from fitted surface object.
  
  Parameters
  ----------
  img : SurfaceImage object
      Mesh and data for both hemispheres.
  
  Returns
  -------
  output : numpy.ndarray
      Signal for each element.
      shape: (img data shape, total number of vertices)
docstr_tok: ["Extract","signals","from","fitted","surface","object",".","Parameters","--","--","--","--","--","img",":","SurfaceImage","object","Mesh","and","data","for","both","hemispheres",".","Returns","--","--","--","-","output",":","numpy.ndarray","Signal","for","each","element",".","shape",":","(","img","data","shape",",","total","number","of","vertices",")"]
code: def transform(self, img: SurfaceImage) -> np.ndarray:
      """Extract signals from fitted surface object.
  
      Parameters
      ----------
      img : SurfaceImage object
          Mesh and data for both hemispheres.
  
      Returns
      -------
      output : numpy.ndarray
          Signal for each element.
          shape: (img data shape, total number of vertices)
      """
      check_same_n_vertices(self.labels_img.mesh, img.mesh)
      img_data = np.concatenate(list(img.data.values()), axis=-1)
      output = np.empty((*img_data.shape[:-1], len(self.labels_)))
      for i, label in enumerate(self.labels_):
          output[..., i] = img_data[
              ..., self.labels_data_ == label
          ].mean(axis=-1)
      return output
  
imports: from __future__ import annotations
  from typing import Any
  import numpy
  import pandas
  from joblib import Memory
  from sklearn.base import BaseEstimator, TransformerMixin
  from nilearn import signal
  from nilearn._utils.cache_mixin import CacheMixin, cache
  from nilearn._utils.class_inspect import get_params
  from nilearn.experimental.surface._surface_image import PolyMesh, SurfaceImage
label_desc: Use image node_id 3 for calling the SurfaceLabelsMasker obj's underlying member method code with example usage: obj.transform(img) and returns: output