original_docstring: 
      More complete brain plotting of a Brain_Data instance
      Args:
          obj: (Brain_Data) object to plot
          how: (str) whether to plot a glass brain 'glass', 3 view-multi-slice mni 'mni', or both 'full'
          thr_upper: (str/float) thresholding of image. Can be string for percentage, or float for data units (see Brain_Data.threshold()
          thr_lower: (str/float) thresholding of image. Can be string for percentage, or float for data units (see Brain_Data.threshold()
          save (str): if a string file name or path is provided plots will be saved into this directory appended with the orientation they belong to
          kwargs: optionals args to nilearn plot functions (e.g. vmax)
  
      
docstring: More complete brain plotting of a Brain_Data instance
docstring_tokens: More complete brain plotting of a Brain_Data instance
code: def plot_brain(objIn, how="full", thr_upper=None, thr_lower=None, save=False, **kwargs):
      """
      More complete brain plotting of a Brain_Data instance
      Args:
          obj: (Brain_Data) object to plot
          how: (str) whether to plot a glass brain 'glass', 3 view-multi-slice mni 'mni', or both 'full'
          thr_upper: (str/float) thresholding of image. Can be string for percentage, or float for data units (see Brain_Data.threshold()
          thr_lower: (str/float) thresholding of image. Can be string for percentage, or float for data units (see Brain_Data.threshold()
          save (str): if a string file name or path is provided plots will be saved into this directory appended with the orientation they belong to
          kwargs: optionals args to nilearn plot functions (e.g. vmax)
  
      """
      if thr_upper or thr_lower:
          obj = objIn.threshold(upper=thr_upper, lower=thr_lower)
      else:
          obj = objIn.copy()
  
      views = ["x", "y", "z"]
      coords = [
          range(-50, 51, 8),
          range(-80, 50, 10),
          range(-40, 71, 9),
      ]  # [-88,-72,-58,-38,-26,8,20,34,46]
      cmap = "RdBu_r"
  
      if thr_upper is None and thr_lower is None:
          print("Plotting unthresholded image")
      else:
          if isinstance(thr_upper, str):
              print("Plotting top %s of voxels" % thr_upper)
          elif isinstance(thr_upper, (float, int)):
              print("Plotting voxels with stat value >= %s" % thr_upper)
          if isinstance(thr_lower, str):
              print("Plotting lower %s of voxels" % thr_lower)
          elif isinstance(thr_lower, (float, int)):
              print("Plotting voxels with stat value <= %s" % thr_lower)
  
      if save:
          path, filename = os.path.split(save)
          filename, extension = filename.split(".")
          glass_save = os.path.join(path, filename + "_glass." + extension)
          x_save = os.path.join(path, filename + "_x." + extension)
          y_save = os.path.join(path, filename + "_y." + extension)
          z_save = os.path.join(path, filename + "_z." + extension)
      else:
          glass_save, x_save, y_save, z_save = None, None, None, None
  
      saves = [x_save, y_save, z_save]
  
      if how == "full":
          plot_glass_brain(
              obj.to_nifti(),
              display_mode="lzry",
              colorbar=True,
              cmap=cmap,
              plot_abs=False,
              **kwargs,
          )
          if save:
              plt.savefig(glass_save, bbox_inches="tight")
          for v, c, savefile in zip(views, coords, saves):
              plot_stat_map(
                  obj.to_nifti(),
                  cut_coords=c,
                  display_mode=v,
                  cmap=cmap,
                  bg_img=resolve_mni_path(MNI_Template)["brain"],
                  **kwargs,
              )
              if save:
                  plt.savefig(savefile, bbox_inches="tight")
      elif how == "glass":
          plot_glass_brain(
              obj.to_nifti(),
              display_mode="lzry",
              colorbar=True,
              cmap=cmap,
              plot_abs=False,
              **kwargs,
          )
          if save:
              plt.savefig(glass_save, bbox_inches="tight")
      elif how == "mni":
          for v, c, savefile in zip(views, coords, saves):
              plot_stat_map(
                  obj.to_nifti(),
                  cut_coords=c,
                  display_mode=v,
                  cmap=cmap,
                  bg_img=resolve_mni_path(MNI_Template)["brain"],
                  **kwargs,
              )
              if save:
                  plt.savefig(savefile, bbox_inches="tight")
      del obj  # save memory
      return
code_tokens: def plot_brain ( objIn , how = "full" , thr_upper = None , thr_lower = None , save = False , ** kwargs ) : if thr_upper or thr_lower : obj = objIn . threshold ( upper = thr_upper , lower = thr_lower ) else : obj = objIn . copy ( ) views = [ "x" , "y" , "z" ] coords = [ range ( - 50 , 51 , 8 ) , range ( - 80 , 50 , 10 ) , range ( - 40 , 71 , 9 ) , ] cmap = "RdBu_r" if thr_upper is None and thr_lower is None : print ( "Plotting unthresholded image" ) else : if isinstance ( thr_upper , str ) : print ( "Plotting top %s of voxels" % thr_upper ) elif isinstance ( thr_upper , ( float , int ) ) : print ( "Plotting voxels with stat value >= %s" % thr_upper ) if isinstance ( thr_lower , str ) : print ( "Plotting lower %s of voxels" % thr_lower ) elif isinstance ( thr_lower , ( float , int ) ) : print ( "Plotting voxels with stat value <= %s" % thr_lower ) if save : path , filename = os . path . split ( save ) filename , extension = filename . split ( "." ) glass_save = os . path . join ( path , filename + "_glass." + extension ) x_save = os . path . join ( path , filename + "_x." + extension ) y_save = os . path . join ( path , filename + "_y." + extension ) z_save = os . path . join ( path , filename + "_z." + extension ) else : glass_save , x_save , y_save , z_save = None , None , None , None saves = [ x_save , y_save , z_save ] if how == "full" : plot_glass_brain ( obj . to_nifti ( ) , display_mode = "lzry" , colorbar = True , cmap = cmap , plot_abs = False , ** kwargs , ) if save : plt . savefig ( glass_save , bbox_inches = "tight" ) for v , c , savefile in zip ( views , coords , saves ) : plot_stat_map ( obj . to_nifti ( ) , cut_coords = c , display_mode = v , cmap = cmap , bg_img = resolve_mni_path ( MNI_Template ) [ "brain" ] , ** kwargs , ) if save : plt . savefig ( savefile , bbox_inches = "tight" ) elif how == "glass" : plot_glass_brain ( obj . to_nifti ( ) , display_mode = "lzry" , colorbar = True , cmap = cmap , plot_abs = False , ** kwargs , ) if save : plt . savefig ( glass_save , bbox_inches = "tight" ) elif how == "mni" : for v , c , savefile in zip ( views , coords , saves ) : plot_stat_map ( obj . to_nifti ( ) , cut_coords = c , display_mode = v , cmap = cmap , bg_img = resolve_mni_path ( MNI_Template ) [ "brain" ] , ** kwargs , ) if save : plt . savefig ( savefile , bbox_inches = "tight" ) del obj return
short_docstring: More complete brain plotting of a Brain_Data instance
short_docstring_tokens: More complete brain plotting of a Brain_Data instance
comment: """
      More complete brain plotting of a Brain_Data instance
      Args:
          obj: (Brain_Data) object to plot
          how: (str) whether to plot a glass brain 'glass', 3 view-multi-slice mni 'mni', or both 'full'
          thr_upper: (str/float) thresholding of image. Can be string for percentage, or float for data units (see Brain_Data.threshold()
          thr_lower: (str/float) thresholding of image. Can be string for percentage, or float for data units (see Brain_Data.threshold()
          save (str): if a string file name or path is provided plots will be saved into this directory appended with the orientation they belong to
          kwargs: optionals args to nilearn plot functions (e.g. vmax)
  
      """$SEP$# [-88,-72,-58,-38,-26,8,20,34,46]$SEP$# save memory