class_docstr: Class for masking of Niimg-like objects using seeds.
  
  NiftiSpheresMasker is useful when data from given seeds should be
  extracted. Use case: Summarize brain signals from seeds that were
  obtained from prior knowledge.
  
  Parameters
  ----------
  seeds : :obj:`list` of triplet of coordinates in native space
      Seed definitions. List of coordinates of the seeds in the same space
      as the images (typically MNI or TAL).
  
  radius : :obj:`float`, default=None
      Indicates, in millimeters, the radius for the sphere around the seed.
      By default signal is extracted on a single voxel.
  
  mask_img : Niimg-like object, default=None
      See :ref:`extracting_data`.
      Mask to apply to regions before extracting signals.
  
  allow_overlap : :obj:`bool`, default=False
      If False, an error is raised if the maps overlaps (ie at least two
      maps have a non-zero value for the same voxel).
  %(smoothing_fwhm)s
  %(standardize_maskers)s
  %(standardize_confounds)s
  high_variance_confounds : :obj:`bool`, default=False
      If True, high variance confounds are computed on provided image with
      :func:`nilearn.image.high_variance_confounds` and default parameters
      and regressed out.
  %(detrend)s
  %(low_pass)s
  %(high_pass)s
  %(t_r)s
  dtype : {dtype, "auto"}, optional
      Data type toward which the data should be converted. If "auto", the
      data will be converted to int32 if dtype is discrete and float32 if it
      is continuous.
  %(memory)s
  %(memory_level1)s
  %(verbose0)s
  %(masker_kwargs)s
  
  Attributes
  ----------
  n_elements_ : :obj:`int`
      The number of seeds in the masker.
  
      .. versionadded:: 0.9.2
  
  seeds_ : :obj:`list` of :obj:`list`
      The coordinates of the seeds in the masker.
  
  reports : boolean, default=True
       If set to True, data is saved in order to produce a report.
  
  See Also
  --------
  nilearn.maskers.NiftiMasker
docstr: Prepare signal extraction from regions.
  
  All parameters are unused; they are for scikit-learn compatibility.
docstr_tok: ["Prepare","signal","extraction","from","regions",".","All","parameters","are","unused",";","they","are","for","scikit-learn","compatibility","."]
code: def fit(self, X=None, y=None):
      """Prepare signal extraction from regions.
  
      All parameters are unused; they are for scikit-learn compatibility.
  
      """
      if hasattr(self, "seeds_"):
          return self
  
      error = (
          "Seeds must be a list of triplets of coordinates in "
          "native space.\n"
      )
  
      if self.mask_img is not None:
          self.mask_img_ = check_niimg_3d(self.mask_img)
      else:
          self.mask_img_ = None
  
      if self.reports:
          if X is not None:
              if self.mask_img_ is not None:
                  resampl_imgs = self._cache(image.resample_img)(
                      X,
                      target_affine=self.mask_img_.affine,
                      copy=False,
                      interpolation="nearest",
                  )
              else:
                  resampl_imgs = X
              # Store 1 timepoint to pass to reporter
              resampl_imgs, _ = compute_middle_image(resampl_imgs)
          else:  # imgs not provided to fit
              resampl_imgs = None
  
      if not hasattr(self.seeds, "__iter__"):
          raise ValueError(
              f"{error}Given seed list is of type: {type(self.seeds)}"
          )
  
      self.seeds_ = []
      # Check seeds and convert them to lists if needed
      for i, seed in enumerate(self.seeds):
          # Check the type first
          if not hasattr(seed, "__len__"):
              raise ValueError(
                  f"{error}Seed #{i} is not a valid triplet of coordinates. "
                  f"It is of type {type(seed)}."
              )
          # Convert to list because it is easier to process
          if isinstance(seed, np.ndarray):
              seed = seed.tolist()
          else:
              # in case of tuple
              seed = list(seed)
  
          # Check the length
          if len(seed) != 3:
              raise ValueError(
                  f"{error}Seed #{i} is of length {len(seed)} instead of 3."
              )
  
          self.seeds_.append(seed)
  
      self._reporting_data = None
      if self.reports:
          self._reporting_data = {
              "seeds": self.seeds_,
              "mask": self.mask_img_,
              "img": resampl_imgs,
          }
  
      self.n_elements_ = len(self.seeds_)
  
      return self
  
imports: import warnings
  import numpy
  from joblib import Memory
  from scipy import sparse
  from sklearn import neighbors
  from nilearn import image, masking
  from nilearn._utils import CacheMixin, fill_doc, logger
  from nilearn._utils.class_inspect import get_params
  from nilearn._utils.niimg import img_data_dtype
  from nilearn._utils.niimg_conversions import check_niimg_3d, check_niimg_4d, safe_get_data
  from nilearn.datasets import load_mni152_template
  from nilearn.maskers._utils import compute_middle_image
  from nilearn.maskers.base_masker import BaseMasker, _filter_and_extract
label_desc: Use image node_id 4 for calling the NiftiSpheresMasker obj's underlying member method code with example usage: obj.fit(X, y) and returns: self, self