class_docstr: Base support interface for NiftyReg commands.
class_docstr_tok: ["Base","support","interface","for","NiftyReg","commands","."]
code: def _gen_fname(self, basename, out_dir=None, suffix=None, ext=None):
      if basename == "":
          msg = (
              "Unable to generate filename for command %s. " % self.cmd
          )
          msg += "basename is not set!"
          raise ValueError(msg)
      _, final_bn, final_ext = split_filename(basename)
      if out_dir is None:
          out_dir = os.getcwd()
      if ext is not None:
          final_ext = ext
      if suffix is not None:
          final_bn = "".join((final_bn, suffix))
      return os.path.abspath(
          os.path.join(out_dir, final_bn + final_ext)
      )
  
imports: import os
  from packaging.version import Version
  from ...None import logging
  from ..base import CommandLine, CommandLineInputSpec, traits, Undefined, PackageInfo
  from ...utils.filemanip import split_filename
label_desc: Use image node_id 8 for calling the NiftyRegCommand obj's underlying member method code with example usage: obj._gen_fname(basename, out_dir, suffix, ext) and returns: os