class_docstr: General support for FreeSurfer commands.
  
  Every FS command accepts 'subjects_dir' input.
class_docstr_tok: ["General","support","for","FreeSurfer","commands",".","Every","FS","command","accepts","'subjects_dir","'","input","."]
docstr: Define a generic mapping for a single outfile
  
  The filename is potentially autogenerated by suffixing inputs.infile
  
  Parameters
  ----------
  basename : string (required)
      filename to base the new filename on
  fname : string
      if not None, just use this fname
  cwd : string
      prefix paths with cwd, otherwise os.getcwd()
  suffix : string
      default suffix
docstr_tok: ["Define","a","generic","mapping","for","a","single","outfile","The","filename","is","potentially","autogenerated","by","suffixing","inputs.infile","Parameters","--","--","--","--","--","basename",":","string","(","required",")","filename","to","base","the","new","filename","on","fname",":","string","if","not","None",",","just","use","this","fname","cwd",":","string","prefix","paths","with","cwd",",","otherwise","os.getcwd","(",")","suffix",":","string","default","suffix"]
code: def _gen_fname(
      self, basename, fname=None, cwd=None, suffix="_fs", use_ext=True
  ):
      """Define a generic mapping for a single outfile
  
      The filename is potentially autogenerated by suffixing inputs.infile
  
      Parameters
      ----------
      basename : string (required)
          filename to base the new filename on
      fname : string
          if not None, just use this fname
      cwd : string
          prefix paths with cwd, otherwise os.getcwd()
      suffix : string
          default suffix
      """
      if basename == "":
          msg = (
              "Unable to generate filename for command %s. " % self.cmd
          )
          msg += "basename is not set!"
          raise ValueError(msg)
      if cwd is None:
          cwd = os.getcwd()
      fname = fname_presuffix(
          basename, suffix=suffix, use_ext=use_ext, newpath=cwd
      )
      return fname
  
imports: import os
  from looseversion import LooseVersion
  from ...utils.filemanip import fname_presuffix
  from ..base import CommandLine, Directory, CommandLineInputSpec, isdefined, traits, TraitedSpec, File, PackageInfo
label_desc: Use image node_id 5 for calling the FSCommand obj's underlying member method code with example usage: obj._gen_fname(basename, fname, cwd, suffix, use_ext) and returns: fname