class_docstr: Base class for NiftiMaskers.
class_docstr_tok: ["Base","class","for","NiftiMaskers","."]
docstr: Apply mask, spatial and temporal preprocessing.
  
  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, 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
      shape: (number of scans - number of volumes removed, )
      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.
  
          .. versionadded:: 0.8.0
  
  Returns
  -------
  region_signals : 2D numpy.ndarray
      Signal for each element.
      shape: (number of scans, number of elements)
  
  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: ["Apply","mask",",","spatial","and","temporal","preprocessing",".","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",",","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","shape",":","(","number","of","scans","-","number","of","volumes","removed",",",")","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",".","..","versionadded",":",":","0.8.0","Returns","--","--","--","-","region_signals",":","2D","numpy.ndarray","Signal","for","each","element",".","shape",":","(","number","of","scans",",","number","of","elements",")","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(self, imgs, confounds=None, sample_mask=None):
      """Apply mask, spatial and temporal preprocessing.
  
      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, 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
          shape: (number of scans - number of volumes removed, )
          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.
  
              .. versionadded:: 0.8.0
  
      Returns
      -------
      region_signals : 2D numpy.ndarray
          Signal for each element.
          shape: (number of scans, number of elements)
  
      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()
  
      if confounds is None and not self.high_variance_confounds:
          return self.transform_single_imgs(
              imgs, confounds=confounds, sample_mask=sample_mask
          )
  
      # Compute high variance confounds if requested
      all_confounds = []
      if self.high_variance_confounds:
          hv_confounds = self._cache(high_variance_confounds)(imgs)
          all_confounds.append(hv_confounds)
      if confounds is not None:
          if isinstance(confounds, list):
              all_confounds += confounds
          else:
              all_confounds.append(confounds)
  
      return self.transform_single_imgs(
          imgs, confounds=all_confounds, sample_mask=sample_mask
      )
  
file_path: nilearn/nilearn/maskers/base_masker.py
imports: import abc
  import warnings
  import numpy
  from joblib import Memory
  from sklearn.base import BaseEstimator, TransformerMixin
  from nilearn.image import high_variance_confounds
  from ..None import _utils, image, masking, signal
  from .._utils import stringify_path
  from .._utils.cache_mixin import CacheMixin, cache
  from .._utils.class_inspect import enclosing_scope_name
label_desc: Use image node_id 2 for calling the BaseMasker obj's underlying member method code with example usage: obj.transform(imgs, confounds, sample_mask) and returns: self, self