class_docstr: Extract data from a SurfaceImage.
class_docstr_tok: ["Extract","data","from","a","SurfaceImage","."]
docstr: Prepare signal extraction from regions.
  
  Parameters
  ----------
  img : SurfaceImage object
      Mesh and data for both hemispheres.
  
  y : None
      This parameter is unused. It is solely included for scikit-learn
      compatibility.
  
  Returns
  -------
  SurfaceMasker object
docstr_tok: ["Prepare","signal","extraction","from","regions",".","Parameters","--","--","--","--","--","img",":","SurfaceImage","object","Mesh","and","data","for","both","hemispheres",".","y",":","None","This","parameter","is","unused",".","It","is","solely","included","for","scikit-learn","compatibility",".","Returns","--","--","--","-","SurfaceMasker","object"]
code: def fit(
      self, img: SurfaceImage | None = None, y: Any = None
  ) -> SurfaceMasker:
      """Prepare signal extraction from regions.
  
      Parameters
      ----------
      img : SurfaceImage object
          Mesh and data for both hemispheres.
  
      y : None
          This parameter is unused. It is solely included for scikit-learn
          compatibility.
  
      Returns
      -------
      SurfaceMasker object
      """
      del y
      self._fit_mask_img(img)
      assert self.mask_img_ is not None
      start, stop = 0, 0
      self.slices = {}
      for part_name, mask in self.mask_img_.data.items():
          assert isinstance(mask, np.ndarray)
          stop = start + mask.sum()
          self.slices[part_name] = start, stop
          start = stop
      self.output_dimension_ = stop
      return self
  
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 SurfaceMasker obj's underlying member method code with example usage: obj.fit(img, y) and returns: self