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: Extract signals from a single 4D niimg.
  
  Parameters
  ----------
  imgs : 3D/4D Niimg-like object
      See :ref:`extracting_data`.
      Images to process.
      If a 3D niimg is provided, a singleton dimension will be added to
      the output to represent the single scan in the niimg.
  
  confounds : CSV file or array-like or :obj:`pandas.DataFrame`, optional
      This parameter is passed to signal.clean. Please see the related
      documentation for details.
      shape: (number of scans, number of confounds)
  
  sample_mask : Any type compatible with numpy-array indexing, optional
      Masks the niimgs along time/fourth dimension to perform scrubbing
      (remove volumes with high motion) and/or non-steady-state volumes.
      This parameter is passed to signal.clean.
      shape: (number of scans - number of volumes removed, )
  
          .. versionadded:: 0.8.0
  
  Returns
  -------
  region_signals : 2D :obj:`numpy.ndarray`
      Signal for each sphere.
      shape: (number of scans, number of spheres)
  
  Warns
  -----
  DeprecationWarning
      If a 3D niimg input is provided, the current behavior
      (adding a singleton dimension to produce a 2D array) is deprecated.
      Starting in version 0.12, a 1D array will be returned for 3D
      inputs.
docstr_tok: ["Extract","signals","from","a","single","4D","niimg",".","Parameters","--","--","--","--","--","imgs",":","3D\/4D","Niimg-like","object","See",":","ref",":","`","extracting_data","`",".","Images","to","process",".","If","a","3D","niimg","is","provided",",","a","singleton","dimension","will","be","added","to","the","output","to","represent","the","single","scan","in","the","niimg",".","confounds",":","CSV","file","or","array-like","or",":","obj",":","`","pandas.DataFrame","`",",","optional","This","parameter","is","passed","to","signal.clean",".","Please","see","the","related","documentation","for","details",".","shape",":","(","number","of","scans",",","number","of","confounds",")","sample_mask",":","Any","type","compatible","with","numpy-array","indexing",",","optional","Masks","the","niimgs","along","time\/fourth","dimension","to","perform","scrubbing","(","remove","volumes","with","high","motion",")","and\/or","non-steady-state","volumes",".","This","parameter","is","passed","to","signal.clean",".","shape",":","(","number","of","scans","-","number","of","volumes","removed",",",")","..","versionadded",":",":","0.8.0","Returns","--","--","--","-","region_signals",":","2D",":","obj",":","`","numpy.ndarray","`","Signal","for","each","sphere",".","shape",":","(","number","of","scans",",","number","of","spheres",")","Warns","--","--","-","DeprecationWarning","If","a","3D","niimg","input","is","provided",",","the","current","behavior","(","adding","a","singleton","dimension","to","produce","a","2D","array",")","is","deprecated",".","Starting","in","version","0.12",",","a","1D","array","will","be","returned","for","3D","inputs","."]
code: def transform_single_imgs(
      self, imgs, confounds=None, sample_mask=None
  ):
      """Extract signals from a single 4D niimg.
  
      Parameters
      ----------
      imgs : 3D/4D Niimg-like object
          See :ref:`extracting_data`.
          Images to process.
          If a 3D niimg is provided, a singleton dimension will be added to
          the output to represent the single scan in the niimg.
  
      confounds : CSV file or array-like or :obj:`pandas.DataFrame`, optional
          This parameter is passed to signal.clean. Please see the related
          documentation for details.
          shape: (number of scans, number of confounds)
  
      sample_mask : Any type compatible with numpy-array indexing, optional
          Masks the niimgs along time/fourth dimension to perform scrubbing
          (remove volumes with high motion) and/or non-steady-state volumes.
          This parameter is passed to signal.clean.
          shape: (number of scans - number of volumes removed, )
  
              .. versionadded:: 0.8.0
  
      Returns
      -------
      region_signals : 2D :obj:`numpy.ndarray`
          Signal for each sphere.
          shape: (number of scans, number of spheres)
  
      Warns
      -----
      DeprecationWarning
          If a 3D niimg input is provided, the current behavior
          (adding a singleton dimension to produce a 2D array) is deprecated.
          Starting in version 0.12, a 1D array will be returned for 3D
          inputs.
  
      """
      self._check_fitted()
  
      params = get_params(NiftiSpheresMasker, self)
      params["clean_kwargs"] = self.clean_kwargs
  
      signals, _ = self._cache(
          _filter_and_extract,
          ignore=["verbose", "memory", "memory_level"],
      )(
          imgs,
          _ExtractionFunctor(
              self.seeds_,
              self.radius,
              self.mask_img,
              self.allow_overlap,
              self.dtype,
          ),
          # Pre-processing
          params,
          confounds=confounds,
          sample_mask=sample_mask,
          dtype=self.dtype,
          # Caching
          memory=self.memory,
          memory_level=self.memory_level,
          # kwargs
          verbose=self.verbose,
      )
      return signals
  
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 7 for calling the NiftiSpheresMasker obj's underlying member method code with example usage: obj.transform_single_imgs(imgs, confounds, sample_mask) and returns: signals