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: Generate an HTML report for current ``NiftiSpheresMasker`` object.
  
  .. note::
      This functionality requires to have ``Matplotlib`` installed.
  
  Parameters
  ----------
  displayed_spheres : :obj:`int`, or :obj:`list`,                            or :class:`~numpy.ndarray`, or "all", default="all"
      Indicates which spheres will be displayed in the HTML report.
  
          - If "all": All spheres will be displayed in the report.
  
          .. code-block:: python
  
              masker.generate_report("all")
  
          .. warning::
  
              If there are too many spheres, this might be time and
              memory consuming, and will result in very heavy
              reports.
  
          - If a :obj:`list` or :class:`~numpy.ndarray`: This indicates
            the indices of the spheres to be displayed in the report.
            For example, the following code will generate a report with
            spheres 6, 3, and 12, displayed in this specific order:
  
          .. code-block:: python
  
              masker.generate_report([6, 3, 12])
  
          - If an :obj:`int`: This will only display the first n
            spheres, n being the value of the parameter. By default,
            the report will only contain the first 10 spheres.
            Example to display the first 16 spheres:
  
          .. code-block:: python
  
              masker.generate_report(16)
  
  Returns
  -------
  report : `nilearn.reporting.html_report.HTMLReport`
      HTML report for the masker.
docstr_tok: ["Generate","an","HTML","report","for","current","``","NiftiSpheresMasker","``","object",".","..","note",":",":","This","functionality","requires","to","have","``","Matplotlib","``","installed",".","Parameters","--","--","--","--","--","displayed_spheres",":",":","obj",":","`","int","`",",","or",":","obj",":","`","list","`",",","or",":","class",":","`","~numpy.ndarray","`",",","or","``","all","''",",","default=","''","all","''","Indicates","which","spheres","will","be","displayed","in","the","HTML","report",".","-","If","``","all","''",":","All","spheres","will","be","displayed","in","the","report",".","..","code-block",":",":","python","masker.generate_report","(","``","all","''",")","..","warning",":",":","If","there","are","too","many","spheres",",","this","might","be","time","and","memory","consuming",",","and","will","result","in","very","heavy","reports",".","-","If","a",":","obj",":","`","list","`","or",":","class",":","`","~numpy.ndarray","`",":","This","indicates","the","indices","of","the","spheres","to","be","displayed","in","the","report",".","For","example",",","the","following","code","will","generate","a","report","with","spheres","6",",","3",",","and","12",",","displayed","in","this","specific","order",":","..","code-block",":",":","python","masker.generate_report","(","[","6",",","3",",","12","]",")","-","If","an",":","obj",":","`","int","`",":","This","will","only","display","the","first","n","spheres",",","n","being","the","value","of","the","parameter",".","By","default",",","the","report","will","only","contain","the","first","10","spheres",".","Example","to","display","the","first","16","spheres",":","..","code-block",":",":","python","masker.generate_report","(","16",")","Returns","--","--","--","-","report",":","`","nilearn.reporting.html_report.HTMLReport","`","HTML","report","for","the","masker","."]
code: def generate_report(self, displayed_spheres="all"):
      """Generate an HTML report for current ``NiftiSpheresMasker`` object.
  
          .. note::
              This functionality requires to have ``Matplotlib`` installed.
  
          Parameters
          ----------
          displayed_spheres : :obj:`int`, or :obj:`list`,\
                              or :class:`~numpy.ndarray`, or "all", default="all"
              Indicates which spheres will be displayed in the HTML report.
  
                  - If "all": All spheres will be displayed in the report.
  
                  .. code-block:: python
  
                      masker.generate_report("all")
  
                  .. warning::
  
                      If there are too many spheres, this might be time and
                      memory consuming, and will result in very heavy
                      reports.
  
                  - If a :obj:`list` or :class:`~numpy.ndarray`: This indicates
                    the indices of the spheres to be displayed in the report.
                    For example, the following code will generate a report with
                    spheres 6, 3, and 12, displayed in this specific order:
  
                  .. code-block:: python
  
                      masker.generate_report([6, 3, 12])
  
                  - If an :obj:`int`: This will only display the first n
                    spheres, n being the value of the parameter. By default,
                    the report will only contain the first 10 spheres.
                    Example to display the first 16 spheres:
  
                  .. code-block:: python
  
                      masker.generate_report(16)
  
          Returns
          -------
          report : `nilearn.reporting.html_report.HTMLReport`
              HTML report for the masker.
          """
      try:
          from nilearn.reporting.html_report import generate_report
      except ImportError:
          with warnings.catch_warnings():
              mpl_unavail_msg = (
                  "Matplotlib is not imported! "
                  "No reports will be generated."
              )
              warnings.filterwarnings("always", message=mpl_unavail_msg)
              warnings.warn(
                  category=ImportWarning, message=mpl_unavail_msg
              )
              return [None]
  
      if displayed_spheres != "all" and not isinstance(
          displayed_spheres, (list, np.ndarray, int)
      ):
          raise TypeError(
              "Parameter ``displayed_spheres`` of "
              "``generate_report()`` should be either 'all' or "
              "an int, or a list/array of ints. You provided a "
              f"{type(displayed_spheres)}"
          )
      self.displayed_spheres = displayed_spheres
      self.report_id += 1
      return generate_report(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 2 for calling the NiftiSpheresMasker obj's underlying member method code with example usage: obj.generate_report(displayed_spheres) and returns: generate_report, list