class_docstr: Shared options for several AFNI commands.
docstr: Generate a filename based on the given parameters.
  
  The filename will take the form: cwd/basename<suffix><ext>.
  If change_ext is True, it will use the extensions specified in
  <instance>inputs.output_type.
  
  Parameters
  ----------
  basename : str
      Filename to base the new filename on.
  cwd : str
      Path to prefix to the new filename. (default is os.getcwd())
  suffix : str
      Suffix to add to the `basename`.  (defaults is '' )
  change_ext : bool
      Flag to change the filename extension to the FSL output type.
      (default True)
  
  Returns
  -------
  fname : str
      New filename based on given parameters.
code: def _gen_fname(
      self, basename, cwd=None, suffix=None, change_ext=True, ext=None
  ):
      """
      Generate a filename based on the given parameters.
  
      The filename will take the form: cwd/basename<suffix><ext>.
      If change_ext is True, it will use the extensions specified in
      <instance>inputs.output_type.
  
      Parameters
      ----------
      basename : str
          Filename to base the new filename on.
      cwd : str
          Path to prefix to the new filename. (default is os.getcwd())
      suffix : str
          Suffix to add to the `basename`.  (defaults is '' )
      change_ext : bool
          Flag to change the filename extension to the FSL output type.
          (default True)
  
      Returns
      -------
      fname : str
          New filename based on given parameters.
  
      """
      if not 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()
      if ext is None:
          ext = Info.output_type_to_ext(self.inputs.outputtype)
      if change_ext:
          suffix = "".join((suffix, ext)) if suffix else ext
  
      if suffix is None:
          suffix = ""
      fname = fname_presuffix(
          basename, suffix=suffix, use_ext=False, newpath=cwd
      )
      return fname
  
imports: import os
  from sys import platform
  import shutil
  from looseversion import LooseVersion
  from ...None import logging
  from ...utils.filemanip import split_filename, fname_presuffix
  from ..base import CommandLine, traits, CommandLineInputSpec, isdefined, File, TraitedSpec, PackageInfo
  from ...external.due import BibTeX
label_desc: Use image node_id 9 for calling the AFNICommand obj's underlying member method code with example usage: obj._gen_fname(basename, cwd, suffix, change_ext, ext) and returns: fname