original_docstring: 
      Takes a brain data object and computes a 1 sample t-test across it's first axis. If a list is provided will compute difference between brain data objects in list (i.e. paired samples t-test).
      Args:
          objIn:(list/Brain_Data) if list will compute difference map first
          how: (list) whether to plot a glass brain 'glass', 3 view-multi-slice mni 'mni', or both 'full'
          thr: (str) what method to use for multiple comparisons correction unc, fdr, or tfce
          alpha: (float) p-value threshold
          nperm: (int) number of permutations for tcfe; default 1000
          cut_coords: (list) x,y,z coords to plot brain slice
          kwargs: optionals args to nilearn plot functions (e.g. vmax)
  
      
docstring: Takes a brain data object and computes a 1 sample t-test across it's first axis. If a list is provided will compute difference between brain data objects in list .
docstring_tokens: Takes a brain data object and computes a 1 sample t - test across it ' s first axis . If a list is provided will compute difference between brain data objects in list .
code: def plot_t_brain(
      objIn, how="full", thr="unc", alpha=None, nperm=None, cut_coords=[], **kwargs
  ):
      """
      Takes a brain data object and computes a 1 sample t-test across it's first axis. If a list is provided will compute difference between brain data objects in list (i.e. paired samples t-test).
      Args:
          objIn:(list/Brain_Data) if list will compute difference map first
          how: (list) whether to plot a glass brain 'glass', 3 view-multi-slice mni 'mni', or both 'full'
          thr: (str) what method to use for multiple comparisons correction unc, fdr, or tfce
          alpha: (float) p-value threshold
          nperm: (int) number of permutations for tcfe; default 1000
          cut_coords: (list) x,y,z coords to plot brain slice
          kwargs: optionals args to nilearn plot functions (e.g. vmax)
  
      """
      if thr not in ["unc", "fdr", "tfce"]:
          raise ValueError("Acceptable threshold methods are 'unc','fdr','tfce'")
      views = ["x", "y", "z"]
      if len(cut_coords) == 0:
          cut_coords = [
              range(-40, 50, 10),
              [-88, -72, -58, -38, -26, 8, 20, 34, 46],
              [-34, -22, -10, 0, 16, 34, 46, 56, 66],
          ]
      else:
          if len(cut_coords) != 3:
              raise ValueError(
                  "cut_coords must be a list of coordinates like [[xs],[ys],[zs]]"
              )
      cmap = "RdBu_r"
  
      if isinstance(objIn, list):
          if len(objIn) == 2:
              obj = objIn[0] - objIn[1]
          else:
              raise ValueError("Contrasts should contain only 2 list items!")
  
      thrDict = {}
      if thr == "tfce":
          thrDict["permutation"] = thr
          if nperm is None:
              nperm = 1000
          thrDict["n_permutations"] = nperm
          print("1-sample t-test corrected using: TFCE w/ %s permutations" % nperm)
      else:
          if thr == "unc":
              if alpha is None:
                  alpha = 0.001
              thrDict[thr] = alpha
              print("1-sample t-test uncorrected at p < %.3f " % alpha)
          elif thr == "fdr":
              if alpha is None:
                  alpha = 0.05
              thrDict[thr] = alpha
              print("1-sample t-test corrected at q < %.3f " % alpha)
          else:
              thrDict = None
              print("1-sample test unthresholded")
  
      out = objIn.ttest(threshold_dict=thrDict)
      if thrDict is not None:
          obj = out["thr_t"]
      else:
          obj = out["t"]
  
      if how == "full":
          plot_glass_brain(
              obj.to_nifti(),
              display_mode="lzry",
              colorbar=True,
              cmap=cmap,
              plot_abs=False,
              **kwargs,
          )
          for v, c in zip(views, cut_coords):
              plot_stat_map(
                  obj.to_nifti(),
                  cut_coords=c,
                  display_mode=v,
                  cmap=cmap,
                  bg_img=resolve_mni_path(MNI_Template)["brain"],
                  **kwargs,
              )
      elif how == "glass":
          plot_glass_brain(
              obj.to_nifti(),
              display_mode="lzry",
              colorbar=True,
              cmap=cmap,
              plot_abs=False,
              **kwargs,
          )
      elif how == "mni":
          for v, c in zip(views, cut_coords):
              plot_stat_map(
                  obj.to_nifti(),
                  cut_coords=c,
                  display_mode=v,
                  cmap=cmap,
                  bg_img=resolve_mni_path(MNI_Template)["brain"],
                  **kwargs,
              )
      del obj
      del out
      return
code_tokens: def plot_t_brain ( objIn , how = "full" , thr = "unc" , alpha = None , nperm = None , cut_coords = [ ] , ** kwargs ) : if thr not in [ "unc" , "fdr" , "tfce" ] : raise ValueError ( "Acceptable threshold methods are 'unc','fdr','tfce'" ) views = [ "x" , "y" , "z" ] if len ( cut_coords ) == 0 : cut_coords = [ range ( - 40 , 50 , 10 ) , [ - 88 , - 72 , - 58 , - 38 , - 26 , 8 , 20 , 34 , 46 ] , [ - 34 , - 22 , - 10 , 0 , 16 , 34 , 46 , 56 , 66 ] , ] else : if len ( cut_coords ) != 3 : raise ValueError ( "cut_coords must be a list of coordinates like [[xs],[ys],[zs]]" ) cmap = "RdBu_r" if isinstance ( objIn , list ) : if len ( objIn ) == 2 : obj = objIn [ 0 ] - objIn [ 1 ] else : raise ValueError ( "Contrasts should contain only 2 list items!" ) thrDict = { } if thr == "tfce" : thrDict [ "permutation" ] = thr if nperm is None : nperm = 1000 thrDict [ "n_permutations" ] = nperm print ( "1-sample t-test corrected using: TFCE w/ %s permutations" % nperm ) else : if thr == "unc" : if alpha is None : alpha = 0.001 thrDict [ thr ] = alpha print ( "1-sample t-test uncorrected at p < %.3f " % alpha ) elif thr == "fdr" : if alpha is None : alpha = 0.05 thrDict [ thr ] = alpha print ( "1-sample t-test corrected at q < %.3f " % alpha ) else : thrDict = None print ( "1-sample test unthresholded" ) out = objIn . ttest ( threshold_dict = thrDict ) if thrDict is not None : obj = out [ "thr_t" ] else : obj = out [ "t" ] if how == "full" : plot_glass_brain ( obj . to_nifti ( ) , display_mode = "lzry" , colorbar = True , cmap = cmap , plot_abs = False , ** kwargs , ) for v , c in zip ( views , cut_coords ) : plot_stat_map ( obj . to_nifti ( ) , cut_coords = c , display_mode = v , cmap = cmap , bg_img = resolve_mni_path ( MNI_Template ) [ "brain" ] , ** kwargs , ) elif how == "glass" : plot_glass_brain ( obj . to_nifti ( ) , display_mode = "lzry" , colorbar = True , cmap = cmap , plot_abs = False , ** kwargs , ) elif how == "mni" : for v , c in zip ( views , cut_coords ) : plot_stat_map ( obj . to_nifti ( ) , cut_coords = c , display_mode = v , cmap = cmap , bg_img = resolve_mni_path ( MNI_Template ) [ "brain" ] , ** kwargs , ) del obj del out return
short_docstring: Takes a brain data object and computes a 1 sample t-test across it's first axis.
short_docstring_tokens: Takes a brain data object and computes a 1 sample t - test across it ' s first axis .
comment: """
      Takes a brain data object and computes a 1 sample t-test across it's first axis. If a list is provided will compute difference between brain data objects in list (i.e. paired samples t-test).
      Args:
          objIn:(list/Brain_Data) if list will compute difference map first
          how: (list) whether to plot a glass brain 'glass', 3 view-multi-slice mni 'mni', or both 'full'
          thr: (str) what method to use for multiple comparisons correction unc, fdr, or tfce
          alpha: (float) p-value threshold
          nperm: (int) number of permutations for tcfe; default 1000
          cut_coords: (list) x,y,z coords to plot brain slice
          kwargs: optionals args to nilearn plot functions (e.g. vmax)
  
      """