class_docstr: Use PETPVC for partial volume correction of PET images.
  
  PETPVC ([1]_, [2]_) is a software from the Nuclear Medicine Department
  of the UCL University Hospital, London, UK.
  
  Examples
  --------
  >>> from ..testing import example_data
  >>> #TODO get data for PETPVC
  >>> pvc = PETPVC()
  >>> pvc.inputs.in_file   = 'pet.nii.gz'
  >>> pvc.inputs.mask_file = 'tissues.nii.gz'
  >>> pvc.inputs.out_file  = 'pet_pvc_rbv.nii.gz'
  >>> pvc.inputs.pvc = 'RBV'
  >>> pvc.inputs.fwhm_x = 2.0
  >>> pvc.inputs.fwhm_y = 2.0
  >>> pvc.inputs.fwhm_z = 2.0
  >>> outs = pvc.run() #doctest: +SKIP
  
  References
  ----------
  .. [1] K. Erlandsson, I. Buvat, P. H. Pretorius, B. A. Thomas, and B. F. Hutton,
         "A review of partial volume correction techniques for emission tomography
         and their applications in neurology, cardiology and oncology," Phys. Med.
         Biol., vol. 57, no. 21, p. R119, 2012.
  .. [2] https://github.com/UCL/PETPVC
class_docstr_tok: ["Use","PETPVC","for","partial","volume","correction","of","PET","images",".","PETPVC","(","[","1","]","_",",","[","2","]","_",")","is","a","software","from","the","Nuclear","Medicine","Department","of","the","UCL","University","Hospital",",","London",",","UK",".","Examples","--","--","--","--",">",">",">","from","..","testing","import","example_data",">",">",">","#","TODO","get","data","for","PETPVC",">",">",">","pvc","=","PETPVC","(",")",">",">",">","pvc.inputs.in_file","=","'pet.nii.gz'",">",">",">","pvc.inputs.mask_file","=","'tissues.nii.gz'",">",">",">","pvc.inputs.out_file","=","'pet_pvc_rbv.nii.gz'",">",">",">","pvc.inputs.pvc","=","'RBV'",">",">",">","pvc.inputs.fwhm_x","=","2.0",">",">",">","pvc.inputs.fwhm_y","=","2.0",">",">",">","pvc.inputs.fwhm_z","=","2.0",">",">",">","outs","=","pvc.run","(",")","#","doctest",":","+SKIP","References","--","--","--","--","--","..","[","1","]","K.","Erlandsson",",","I.","Buvat",",","P.","H.","Pretorius",",","B",".","A.","Thomas",",","and","B.","F.","Hutton",",","``","A","review","of","partial","volume","correction","techniques","for","emission","tomography","and","their","applications","in","neurology",",","cardiology","and","oncology",",","''","Phys",".","Med",".","Biol.",",","vol",".","57",",","no",".","21",",","p.","R119",",","2012",".","..","[","2","]","https",":","\/\/github.com\/UCL\/PETPVC"]
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 given `ext`.
      (Default is False)
  
  Returns
  -------
  fname : str
      New filename based on given parameters.
docstr_tok: ["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","given","`","ext","`",".","(","Default","is","False",")","Returns","--","--","--","-","fname",":","str","New","filename","based","on","given","parameters","."]
code: def _gen_fname(
      self,
      basename,
      cwd=None,
      suffix=None,
      change_ext=True,
      ext=".nii.gz",
  ):
      """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 given `ext`.
          (Default is False)
  
      Returns
      -------
      fname : str
          New filename based on given parameters.
  
      """
      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()
      if change_ext:
          if suffix:
              suffix = "".join((suffix, ext))
          else:
              suffix = ext
      if suffix is None:
          suffix = ""
      fname = fname_presuffix(
          basename, suffix=suffix, use_ext=False, newpath=cwd
      )
      return fname
  
file_path: nipype/nipype/interfaces/petpvc.py
imports: import os
  from .base import TraitedSpec, CommandLineInputSpec, CommandLine, File, isdefined, traits
  from ..utils.filemanip import fname_presuffix
  from ..external.due import BibTeX
label_desc: Use image node_id 2 for calling the PETPVC obj's underlying member method code with example usage: obj._gen_fname(basename, cwd, suffix, change_ext, ext) and returns: fname