class_docstr: The contrast class handles the estimation     of statistical :term:`contrasts<contrast>`     on a given model: student (t) or Fisher (F).
  
  The important feature is that it supports addition,
  thus opening the possibility of fixed-effects models.
  
  The current implementation is meant to be simple,
  and could be enhanced in the future on the computational side
  (high-dimensional F :term:`contrasts<contrast>`
  may lead to memory breakage).
class_docstr_tok: ["The","contrast","class","handles","the","estimation","of","statistical",":","term",":","`","contrasts","<","contrast",">","`","on","a","given","model",":","student","(","t",")","or","Fisher","(","F",")",".","The","important","feature","is","that","it","supports","addition",",","thus","opening","the","possibility","of","fixed-effects","models",".","The","current","implementation","is","meant","to","be","simple",",","and","could","be","enhanced","in","the","future","on","the","computational","side","(","high-dimensional","F",":","term",":","`","contrasts","<","contrast",">","`","may","lead","to","memory","breakage",")","."]
docstr: Construct instance.
  
  Parameters
  ----------
  effect : array of shape (contrast_dim, n_voxels)
      The effects related to the :term:`contrast`.
  
  variance : array of shape (n_voxels)
      The associated variance estimate.
  
  dim : int or None, optional
      The dimension of the :term:`contrast`.
  
  dof : scalar, default=DEF_DOFMAX
      The degrees of freedom of the residuals.
  
  stat_type : {'t', 'F'}, default='t'
      Specification of the :term:`contrast` type.
  
  contrast_type :
  
      .. deprecated:: 0.11.0
  
          Use ``stat_type`` instead (see above).
  
  tiny : float, default=DEF_TINY
      Small quantity used to avoid numerical underflows.
  
  dofmax : scalar, default=DEF_DOFMAX
      The maximum degrees of freedom of the residuals.
docstr_tok: ["Construct","instance",".","Parameters","--","--","--","--","--","effect",":","array","of","shape","(","contrast_dim",",","n_voxels",")","The","effects","related","to","the",":","term",":","`","contrast","`",".","variance",":","array","of","shape","(","n_voxels",")","The","associated","variance","estimate",".","dim",":","int","or","None",",","optional","The","dimension","of","the",":","term",":","`","contrast","`",".","dof",":","scalar",",","default=DEF_DOFMAX","The","degrees","of","freedom","of","the","residuals",".","stat_type",":","{","'t","'",",","'","F","'","}",",","default='t'","Specification","of","the",":","term",":","`","contrast","`","type",".","contrast_type",":","..","deprecated",":",":","0.11.0","Use","``","stat_type","``","instead","(","see","above",")",".","tiny",":","float",",","default=DEF_TINY","Small","quantity","used","to","avoid","numerical","underflows",".","dofmax",":","scalar",",","default=DEF_DOFMAX","The","maximum","degrees","of","freedom","of","the","residuals","."]
code: def __init__(
      self,
      effect,
      variance,
      dim=None,
      dof=DEF_DOFMAX,
      stat_type="t",
      tiny=DEF_TINY,
      dofmax=DEF_DOFMAX,
  ):
      """Construct instance.
  
      Parameters
      ----------
      effect : array of shape (contrast_dim, n_voxels)
          The effects related to the :term:`contrast`.
  
      variance : array of shape (n_voxels)
          The associated variance estimate.
  
      dim : int or None, optional
          The dimension of the :term:`contrast`.
  
      dof : scalar, default=DEF_DOFMAX
          The degrees of freedom of the residuals.
  
      stat_type : {'t', 'F'}, default='t'
          Specification of the :term:`contrast` type.
  
      contrast_type :
  
          .. deprecated:: 0.11.0
  
              Use ``stat_type`` instead (see above).
  
      tiny : float, default=DEF_TINY
          Small quantity used to avoid numerical underflows.
  
      dofmax : scalar, default=DEF_DOFMAX
          The maximum degrees of freedom of the residuals.
  
      """
      if variance.ndim != 1:
          raise ValueError("Variance array should have 1 dimension")
      if effect.ndim != 2:
          raise ValueError("Effect array should have 2 dimensions")
  
      self.effect = effect
      self.variance = variance
      self.dof = float(dof)
      self.dim = effect.shape[0] if dim is None else dim
      if self.dim > 1 and stat_type == "t":
          print(
              "Automatically converted multi-dimensional t to F contrast"
          )
          stat_type = "F"
      if stat_type not in ["t", "F"]:
          raise ValueError(
              f"{stat_type} is not a valid stat_type. "
              "Should be t or F"
          )
      self.stat_type = stat_type
      self.stat_ = None
      self.p_value_ = None
      self.one_minus_pvalue_ = None
      self.baseline = 0
      self.tiny = tiny
      self.dofmax = dofmax
  
imports: from warnings import warn
  import numpy
  import pandas
  import scipy.stats
  from nilearn._utils import rename_parameters
  from nilearn.glm._utils import pad_contrast, z_score
  from nilearn.maskers import NiftiMasker
label_desc: Use image node_id 1 to create a new Contrast object  with example: obj = Contrast(effect, variance, dim, dof, stat_type, tiny, dofmax)