class_docstr: Class for masking of Niimg-like objects.
  
  NiftiLabelsMasker is useful when data from non-overlapping volumes should
  be extracted (contrarily to :class:`nilearn.maskers.NiftiMapsMasker`).
  Use case: Summarize brain signals from clusters that were obtained by prior
  K-means or Ward clustering.
  
  Parameters
  ----------
  labels_img : Niimg-like object
      See :ref:`extracting_data`.
      Region definitions, as one image of labels.
  
  labels : :obj:`list` of :obj:`str`, optional
      Full labels corresponding to the labels image. This is used
      to improve reporting quality if provided.
      Warning: The labels must be consistent with the label
      values provided through `labels_img`.
  
  background_label : :obj:`int` or :obj:`float`, default=0
      Label used in labels_img to represent background.
      Warning: This value must be consistent with label values and
      image provided.
  
  mask_img : Niimg-like object, optional
      See :ref:`extracting_data`.
      Mask to apply to regions before extracting signals.
  %(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.
  
  resampling_target : {"data", "labels", None}, default="data"
      Gives which image gives the final shape/size. For example, if
      `resampling_target` is "data", the atlas is resampled to the
      shape of the data if needed. If it is "labels" then mask_img
      and images provided to fit() are resampled to the shape and
      affine of maps_img. "None" means no resampling: if shapes and
      affines do not match, a ValueError is raised.
  %(memory)s
  %(memory_level1)s
  %(verbose0)s
  strategy : :obj:`str`, default='mean'
      The name of a valid function to reduce the region with.
      Must be one of: sum, mean, median, minimum, maximum, variance,
      standard_deviation.
  %(keep_masked_labels)s
  reports : :obj:`bool`, default=True
      If set to True, data is saved in order to produce a report.
  
  %(masker_kwargs)s
  
  Attributes
  ----------
  mask_img_ : :obj:`nibabel.nifti1.Nifti1Image`
      The mask of the data, or the computed one.
  
  labels_img_ : :obj:`nibabel.nifti1.Nifti1Image`
      The labels image.
  
  n_elements_ : :obj:`int`
      The number of discrete values in the mask.
      This is equivalent to the number of unique values in the mask image,
      ignoring the background value.
  
      .. versionadded:: 0.9.2
  
  region_ids_ : dict
      A dictionary containing the region ids corresponding
      to each column in region_signal.
      The region id corresponding to ``region_signal[:,i]``
      is ``region_ids_[i]``.
      ``region_ids_['background']`` is the background label.
  
      .. versionadded:: 0.11.0.dev
  
  region_names_ : dict
      A dictionary containing the region names corresponding
      to each column in region_signal.
      The region names correspond to the labels provided
      in labels in input.
      The region name corresponding to ``region_signal[:,i]``
      is ``region_names_[i]``.
  
      .. versionadded:: 0.11.0.dev
  
  region_atlas_ : Niimg-like object
      Regions definition as labels.
      The labels correspond to the indices in ``region_ids_``.
      The region in ``region_atlas_`` that takes the value ``region_ids_[i]``
      is used to compute the signal in ``region_signal[:,i]``.
  
      .. versionadded:: 0.11.0.dev
  
  See Also
  --------
  nilearn.maskers.NiftiMasker
class_docstr_tok: ["Class","for","masking","of","Niimg-like","objects",".","NiftiLabelsMasker","is","useful","when","data","from","non-overlapping","volumes","should","be","extracted","(","contrarily","to",":","class",":","`","nilearn.maskers.NiftiMapsMasker","`",")",".","Use","case",":","Summarize","brain","signals","from","clusters","that","were","obtained","by","prior","K-means","or","Ward","clustering",".","Parameters","--","--","--","--","--","labels_img",":","Niimg-like","object","See",":","ref",":","`","extracting_data","`",".","Region","definitions",",","as","one","image","of","labels",".","labels",":",":","obj",":","`","list","`","of",":","obj",":","`","str","`",",","optional","Full","labels","corresponding","to","the","labels","image",".","This","is","used","to","improve","reporting","quality","if","provided",".","Warning",":","The","labels","must","be","consistent","with","the","label","values","provided","through","`","labels_img","`",".","background_label",":",":","obj",":","`","int","`","or",":","obj",":","`","float","`",",","default=0","Label","used","in","labels_img","to","represent","background",".","Warning",":","This","value","must","be","consistent","with","label","values","and","image","provided",".","mask_img",":","Niimg-like","object",",","optional","See",":","ref",":","`","extracting_data","`",".","Mask","to","apply","to","regions","before","extracting","signals",".","%","(","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",".","resampling_target",":","{","``","data","''",",","``","labels","''",",","None","}",",","default=","''","data","''","Gives","which","image","gives","the","final","shape\/size",".","For","example",",","if","`","resampling_target","`","is","``","data","''",",","the","atlas","is","resampled","to","the","shape","of","the","data","if","needed",".","If","it","is","``","labels","''","then","mask_img","and","images","provided","to","fit","(",")","are","resampled","to","the","shape","and","affine","of","maps_img",".","``","None","''","means","no","resampling",":","if","shapes","and","affines","do","not","match",",","a","ValueError","is","raised",".","%","(","memory",")","s","%","(","memory_level1",")","s","%","(","verbose0",")","s","strategy",":",":","obj",":","`","str","`",",","default='mean'","The","name","of","a","valid","function","to","reduce","the","region","with",".","Must","be","one","of",":","sum",",","mean",",","median",",","minimum",",","maximum",",","variance",",","standard_deviation",".","%","(","keep_masked_labels",")","s","reports",":",":","obj",":","`","bool","`",",","default=True","If","set","to","True",",","data","is","saved","in","order","to","produce","a","report",".","%","(","masker_kwargs",")","s","Attributes","--","--","--","--","--","mask_img_",":",":","obj",":","`","nibabel.nifti1.Nifti1Image","`","The","mask","of","the","data",",","or","the","computed","one",".","labels_img_",":",":","obj",":","`","nibabel.nifti1.Nifti1Image","`","The","labels","image",".","n_elements_",":",":","obj",":","`","int","`","The","number","of","discrete","values","in","the","mask",".","This","is","equivalent","to","the","number","of","unique","values","in","the","mask","image",",","ignoring","the","background","value",".","..","versionadded",":",":","0.9.2","region_ids_",":","dict","A","dictionary","containing","the","region","ids","corresponding","to","each","column","in","region_signal",".","The","region","id","corresponding","to","``","region_signal","[",":",",i","]","``","is","``","region_ids_","[","i","]","``",".","``","region_ids_","[","'background","'","]","``","is","the","background","label",".","..","versionadded",":",":","0.11.0.dev","region_names_",":","dict","A","dictionary","containing","the","region","names","corresponding","to","each","column","in","region_signal",".","The","region","names","correspond","to","the","labels","provided","in","labels","in","input",".","The","region","name","corresponding","to","``","region_signal","[",":",",i","]","``","is","``","region_names_","[","i","]","``",".","..","versionadded",":",":","0.11.0.dev","region_atlas_",":","Niimg-like","object","Regions","definition","as","labels",".","The","labels","correspond","to","the","indices","in","``","region_ids_","``",".","The","region","in","``","region_atlas_","``","that","takes","the","value","``","region_ids_","[","i","]","``","is","used","to","compute","the","signal","in","``","region_signal","[",":",",i","]","``",".","..","versionadded",":",":","0.11.0.dev","See","Also","--","--","--","--","nilearn.maskers.NiftiMasker"]
docstr: Generate a report.
docstr_tok: ["Generate","a","report","."]
code: def generate_report(self):
      """Generate a report."""
      from nilearn.reporting.html_report import generate_report
  
      return generate_report(self)
  
file_path: nilearn/nilearn/maskers/nifti_labels_masker.py
imports: import warnings
  import numpy
  from joblib import Memory
  from nilearn import _utils, image, masking
  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 NiftiLabelsMasker obj's underlying member method code with example usage: obj.generate_report() and returns: generate_report