We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
ENH: add STC partial volume correction to PETPVC interface
### Summary
Partial Volume Correction using Single-target correction (STC) has been added to PETPVC since the Nipype PETPVC interface was created, and it would therefore be ideal if this could be added to the interface as well.

### Actual behavior
The interface should include the 'STC' option for the 'pvc' flag.

### Expected behavior

### How to replicate the behavior

### Script/Workflow details

Please put URL to code or code here (if not too long).

### Platform details:

<!-- Please run the following code from your shell and place the output between the triple ticks, below.
python -c "import nipype; from pprint import pprint; pprint(nipype.get_info())"
-->

```

```

### Execution environment

Choose one
- Container [Tag: ???]
- My python environment inside container [Base Tag: ???]
- My python environment outside container


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `nipype/interfaces/petpvc.py`
Content:
```
1 # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
2 # vi: set ft=python sts=4 ts=4 sw=4 et:
3 """PETPVC is a toolbox for partial volume correction in positron emission tomography."""
4 import os
5 
6 from .base import (
7     TraitedSpec,
8     CommandLineInputSpec,
9     CommandLine,
10     File,
11     isdefined,
12     traits,
13 )
14 from ..utils.filemanip import fname_presuffix
15 from ..external.due import BibTeX
16 
17 pvc_methods = [
18     "GTM",
19     "IY",
20     "IY+RL",
21     "IY+VC",
22     "LABBE",
23     "LABBE+MTC",
24     "LABBE+MTC+RL",
25     "LABBE+MTC+VC",
26     "LABBE+RBV",
27     "LABBE+RBV+RL",
28     "LABBE+RBV+VC",
29     "MG",
30     "MG+RL",
31     "MG+VC",
32     "MTC",
33     "MTC+RL",
34     "MTC+VC",
35     "RBV",
36     "RBV+RL",
37     "RBV+VC",
38     "RL",
39     "VC",
40 ]
41 
42 
43 class PETPVCInputSpec(CommandLineInputSpec):
44     in_file = File(desc="PET image file", exists=True, mandatory=True, argstr="-i %s")
45     out_file = File(desc="Output file", genfile=True, hash_files=False, argstr="-o %s")
46     mask_file = File(
47         desc="Mask image file", exists=True, mandatory=True, argstr="-m %s"
48     )
49     pvc = traits.Enum(
50         pvc_methods,
51         mandatory=True,
52         argstr="-p %s",
53         desc="""\
54 Desired PVC method:
55 
56     * Geometric transfer matrix -- ``GTM``
57     * Labbe approach -- ``LABBE``
58     * Richardson-Lucy -- ``RL``
59     * Van-Cittert -- ``VC``
60     * Region-based voxel-wise correction -- ``RBV``
61     * RBV with Labbe -- ``LABBE+RBV``
62     * RBV with Van-Cittert -- ``RBV+VC``
63     * RBV with Richardson-Lucy -- ``RBV+RL``
64     * RBV with Labbe and Van-Cittert -- ``LABBE+RBV+VC``
65     * RBV with Labbe and Richardson-Lucy -- ``LABBE+RBV+RL``
66     * Multi-target correction -- ``MTC``
67     * MTC with Labbe -- ``LABBE+MTC``
68     * MTC with Van-Cittert -- ``MTC+VC``
69     * MTC with Richardson-Lucy -- ``MTC+RL``
70     * MTC with Labbe and Van-Cittert -- ``LABBE+MTC+VC``
71     * MTC with Labbe and Richardson-Lucy -- ``LABBE+MTC+RL``
72     * Iterative Yang -- ``IY``
73     * Iterative Yang with Van-Cittert -- ``IY+VC``
74     * Iterative Yang with Richardson-Lucy -- ``IY+RL``
75     * Muller Gartner -- ``MG``
76     * Muller Gartner with Van-Cittert -- ``MG+VC``
77     * Muller Gartner with Richardson-Lucy -- ``MG+RL``
78 
79 """,
80     )
81     fwhm_x = traits.Float(
82         desc="The full-width at half maximum in mm along x-axis",
83         mandatory=True,
84         argstr="-x %.4f",
85     )
86     fwhm_y = traits.Float(
87         desc="The full-width at half maximum in mm along y-axis",
88         mandatory=True,
89         argstr="-y %.4f",
90     )
91     fwhm_z = traits.Float(
92         desc="The full-width at half maximum in mm along z-axis",
93         mandatory=True,
94         argstr="-z %.4f",
95     )
96     debug = traits.Bool(
97         desc="Prints debug information",
98         usedefault=True,
99         default_value=False,
100         argstr="-d",
101     )
102     n_iter = traits.Int(
103         desc="Number of iterations", default_value=10, usedefault=True, argstr="-n %d"
104     )
105     n_deconv = traits.Int(
106         desc="Number of deconvolution iterations",
107         default_value=10,
108         usedefault=True,
109         argstr="-k %d",
110     )
111     alpha = traits.Float(
112         desc="Alpha value", default_value=1.5, usedefault=True, argstr="-a %.4f"
113     )
114     stop_crit = traits.Float(
115         desc="Stopping criterion", default_value=0.01, usedefault=True, argstr="-s %.4f"
116     )
117 
118 
119 class PETPVCOutputSpec(TraitedSpec):
120     out_file = File(desc="Output file")
121 
122 
123 class PETPVC(CommandLine):
124     """Use PETPVC for partial volume correction of PET images.
125 
126     PETPVC ([1]_, [2]_) is a software from the Nuclear Medicine Department
127     of the UCL University Hospital, London, UK.
128 
129     Examples
130     --------
131     >>> from ..testing import example_data
132     >>> #TODO get data for PETPVC
133     >>> pvc = PETPVC()
134     >>> pvc.inputs.in_file   = 'pet.nii.gz'
135     >>> pvc.inputs.mask_file = 'tissues.nii.gz'
136     >>> pvc.inputs.out_file  = 'pet_pvc_rbv.nii.gz'
137     >>> pvc.inputs.pvc = 'RBV'
138     >>> pvc.inputs.fwhm_x = 2.0
139     >>> pvc.inputs.fwhm_y = 2.0
140     >>> pvc.inputs.fwhm_z = 2.0
141     >>> outs = pvc.run() #doctest: +SKIP
142 
143     References
144     ----------
145     .. [1] K. Erlandsson, I. Buvat, P. H. Pretorius, B. A. Thomas, and B. F. Hutton,
146            "A review of partial volume correction techniques for emission tomography
147            and their applications in neurology, cardiology and oncology," Phys. Med.
148            Biol., vol. 57, no. 21, p. R119, 2012.
149     .. [2] https://github.com/UCL/PETPVC
150 
151     """
152 
153     input_spec = PETPVCInputSpec
154     output_spec = PETPVCOutputSpec
155     _cmd = "petpvc"
156 
157     _references = [
158         {
159             "entry": BibTeX(
160                 "@article{0031-9155-61-22-7975,"
161                 "author={Benjamin A Thomas and Vesna Cuplov and Alexandre Bousse and "
162                 "Adriana Mendes and Kris Thielemans and Brian F Hutton and Kjell Erlandsson},"
163                 "title={PETPVC: a toolbox for performing partial volume correction "
164                 "techniques in positron emission tomography},"
165                 "journal={Physics in Medicine and Biology},"
166                 "volume={61},"
167                 "number={22},"
168                 "pages={7975},"
169                 "url={http://stacks.iop.org/0031-9155/61/i=22/a=7975},"
170                 "doi={https://doi.org/10.1088/0031-9155/61/22/7975},"
171                 "year={2016},"
172                 "}"
173             ),
174             "description": "PETPVC software implementation publication",
175             "tags": ["implementation"],
176         }
177     ]
178 
179     def _list_outputs(self):
180         outputs = self.output_spec().get()
181         outputs["out_file"] = self.inputs.out_file
182         if not isdefined(outputs["out_file"]):
183             method_name = self.inputs.pvc.lower()
184             outputs["out_file"] = self._gen_fname(
185                 self.inputs.in_file, suffix=f"_{method_name}_pvc"
186             )
187 
188         outputs["out_file"] = os.path.abspath(outputs["out_file"])
189         return outputs
190 
191     def _gen_fname(
192         self, basename, cwd=None, suffix=None, change_ext=True, ext=".nii.gz"
193     ):
194         """Generate a filename based on the given parameters.
195 
196         The filename will take the form: cwd/basename<suffix><ext>.
197         If change_ext is True, it will use the extensions specified in
198         <instance>inputs.output_type.
199 
200         Parameters
201         ----------
202         basename : str
203             Filename to base the new filename on.
204         cwd : str
205             Path to prefix to the new filename. (default is os.getcwd())
206         suffix : str
207             Suffix to add to the `basename`.  (defaults is '' )
208         change_ext : bool
209             Flag to change the filename extension to the given `ext`.
210             (Default is False)
211 
212         Returns
213         -------
214         fname : str
215             New filename based on given parameters.
216 
217         """
218         if basename == "":
219             msg = "Unable to generate filename for command %s. " % self.cmd
220             msg += "basename is not set!"
221             raise ValueError(msg)
222         if cwd is None:
223             cwd = os.getcwd()
224         if change_ext:
225             if suffix:
226                 suffix = "".join((suffix, ext))
227             else:
228                 suffix = ext
229         if suffix is None:
230             suffix = ""
231         fname = fname_presuffix(basename, suffix=suffix, use_ext=False, newpath=cwd)
232         return fname
233 
234     def _gen_filename(self, name):
235         if name == "out_file":
236             return self._list_outputs()["out_file"]
237         return None
238
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/nipype/interfaces/petpvc.py b/nipype/interfaces/petpvc.py
--- a/nipype/interfaces/petpvc.py
+++ b/nipype/interfaces/petpvc.py
@@ -37,6 +37,7 @@
     "RBV+VC",
     "RL",
     "VC",
+    "STC",
 ]
 
 
@@ -75,6 +76,7 @@
     * Muller Gartner -- ``MG``
     * Muller Gartner with Van-Cittert -- ``MG+VC``
     * Muller Gartner with Richardson-Lucy -- ``MG+RL``
+    * Single-target correction -- ``STC``
 
 """,
     )

{"golden_diff": "diff --git a/nipype/interfaces/petpvc.py b/nipype/interfaces/petpvc.py\n--- a/nipype/interfaces/petpvc.py\n+++ b/nipype/interfaces/petpvc.py\n@@ -37,6 +37,7 @@\n     \"RBV+VC\",\n     \"RL\",\n     \"VC\",\n+    \"STC\",\n ]\n \n \n@@ -75,6 +76,7 @@\n     * Muller Gartner -- ``MG``\n     * Muller Gartner with Van-Cittert -- ``MG+VC``\n     * Muller Gartner with Richardson-Lucy -- ``MG+RL``\n+    * Single-target correction -- ``STC``\n \n \"\"\",\n     )\n", "issue": "ENH: add STC partial volume correction to PETPVC interface\n### Summary\r\nPartial Volume Correction using Single-target correction (STC) has been added to PETPVC since the Nipype PETPVC interface was created, and it would therefore be ideal if this could be added to the interface as well.\r\n\r\n### Actual behavior\r\nThe interface should include the 'STC' option for the 'pvc' flag.\r\n\r\n### Expected behavior\r\n\r\n### How to replicate the behavior\r\n\r\n### Script/Workflow details\r\n\r\nPlease put URL to code or code here (if not too long).\r\n\r\n### Platform details:\r\n\r\n<!-- Please run the following code from your shell and place the output between the triple ticks, below.\r\npython -c \"import nipype; from pprint import pprint; pprint(nipype.get_info())\"\r\n-->\r\n\r\n```\r\n\r\n```\r\n\r\n### Execution environment\r\n\r\nChoose one\r\n- Container [Tag: ???]\r\n- My python environment inside container [Base Tag: ???]\r\n- My python environment outside container\r\n\n", "before_files": [{"content": "# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n\"\"\"PETPVC is a toolbox for partial volume correction in positron emission tomography.\"\"\"\nimport os\n\nfrom .base import (\n    TraitedSpec,\n    CommandLineInputSpec,\n    CommandLine,\n    File,\n    isdefined,\n    traits,\n)\nfrom ..utils.filemanip import fname_presuffix\nfrom ..external.due import BibTeX\n\npvc_methods = [\n    \"GTM\",\n    \"IY\",\n    \"IY+RL\",\n    \"IY+VC\",\n    \"LABBE\",\n    \"LABBE+MTC\",\n    \"LABBE+MTC+RL\",\n    \"LABBE+MTC+VC\",\n    \"LABBE+RBV\",\n    \"LABBE+RBV+RL\",\n    \"LABBE+RBV+VC\",\n    \"MG\",\n    \"MG+RL\",\n    \"MG+VC\",\n    \"MTC\",\n    \"MTC+RL\",\n    \"MTC+VC\",\n    \"RBV\",\n    \"RBV+RL\",\n    \"RBV+VC\",\n    \"RL\",\n    \"VC\",\n]\n\n\nclass PETPVCInputSpec(CommandLineInputSpec):\n    in_file = File(desc=\"PET image file\", exists=True, mandatory=True, argstr=\"-i %s\")\n    out_file = File(desc=\"Output file\", genfile=True, hash_files=False, argstr=\"-o %s\")\n    mask_file = File(\n        desc=\"Mask image file\", exists=True, mandatory=True, argstr=\"-m %s\"\n    )\n    pvc = traits.Enum(\n        pvc_methods,\n        mandatory=True,\n        argstr=\"-p %s\",\n        desc=\"\"\"\\\nDesired PVC method:\n\n    * Geometric transfer matrix -- ``GTM``\n    * Labbe approach -- ``LABBE``\n    * Richardson-Lucy -- ``RL``\n    * Van-Cittert -- ``VC``\n    * Region-based voxel-wise correction -- ``RBV``\n    * RBV with Labbe -- ``LABBE+RBV``\n    * RBV with Van-Cittert -- ``RBV+VC``\n    * RBV with Richardson-Lucy -- ``RBV+RL``\n    * RBV with Labbe and Van-Cittert -- ``LABBE+RBV+VC``\n    * RBV with Labbe and Richardson-Lucy -- ``LABBE+RBV+RL``\n    * Multi-target correction -- ``MTC``\n    * MTC with Labbe -- ``LABBE+MTC``\n    * MTC with Van-Cittert -- ``MTC+VC``\n    * MTC with Richardson-Lucy -- ``MTC+RL``\n    * MTC with Labbe and Van-Cittert -- ``LABBE+MTC+VC``\n    * MTC with Labbe and Richardson-Lucy -- ``LABBE+MTC+RL``\n    * Iterative Yang -- ``IY``\n    * Iterative Yang with Van-Cittert -- ``IY+VC``\n    * Iterative Yang with Richardson-Lucy -- ``IY+RL``\n    * Muller Gartner -- ``MG``\n    * Muller Gartner with Van-Cittert -- ``MG+VC``\n    * Muller Gartner with Richardson-Lucy -- ``MG+RL``\n\n\"\"\",\n    )\n    fwhm_x = traits.Float(\n        desc=\"The full-width at half maximum in mm along x-axis\",\n        mandatory=True,\n        argstr=\"-x %.4f\",\n    )\n    fwhm_y = traits.Float(\n        desc=\"The full-width at half maximum in mm along y-axis\",\n        mandatory=True,\n        argstr=\"-y %.4f\",\n    )\n    fwhm_z = traits.Float(\n        desc=\"The full-width at half maximum in mm along z-axis\",\n        mandatory=True,\n        argstr=\"-z %.4f\",\n    )\n    debug = traits.Bool(\n        desc=\"Prints debug information\",\n        usedefault=True,\n        default_value=False,\n        argstr=\"-d\",\n    )\n    n_iter = traits.Int(\n        desc=\"Number of iterations\", default_value=10, usedefault=True, argstr=\"-n %d\"\n    )\n    n_deconv = traits.Int(\n        desc=\"Number of deconvolution iterations\",\n        default_value=10,\n        usedefault=True,\n        argstr=\"-k %d\",\n    )\n    alpha = traits.Float(\n        desc=\"Alpha value\", default_value=1.5, usedefault=True, argstr=\"-a %.4f\"\n    )\n    stop_crit = traits.Float(\n        desc=\"Stopping criterion\", default_value=0.01, usedefault=True, argstr=\"-s %.4f\"\n    )\n\n\nclass PETPVCOutputSpec(TraitedSpec):\n    out_file = File(desc=\"Output file\")\n\n\nclass PETPVC(CommandLine):\n    \"\"\"Use PETPVC for partial volume correction of PET images.\n\n    PETPVC ([1]_, [2]_) is a software from the Nuclear Medicine Department\n    of the UCL University Hospital, London, UK.\n\n    Examples\n    --------\n    >>> from ..testing import example_data\n    >>> #TODO get data for PETPVC\n    >>> pvc = PETPVC()\n    >>> pvc.inputs.in_file   = 'pet.nii.gz'\n    >>> pvc.inputs.mask_file = 'tissues.nii.gz'\n    >>> pvc.inputs.out_file  = 'pet_pvc_rbv.nii.gz'\n    >>> pvc.inputs.pvc = 'RBV'\n    >>> pvc.inputs.fwhm_x = 2.0\n    >>> pvc.inputs.fwhm_y = 2.0\n    >>> pvc.inputs.fwhm_z = 2.0\n    >>> outs = pvc.run() #doctest: +SKIP\n\n    References\n    ----------\n    .. [1] K. Erlandsson, I. Buvat, P. H. Pretorius, B. A. Thomas, and B. F. Hutton,\n           \"A review of partial volume correction techniques for emission tomography\n           and their applications in neurology, cardiology and oncology,\" Phys. Med.\n           Biol., vol. 57, no. 21, p. R119, 2012.\n    .. [2] https://github.com/UCL/PETPVC\n\n    \"\"\"\n\n    input_spec = PETPVCInputSpec\n    output_spec = PETPVCOutputSpec\n    _cmd = \"petpvc\"\n\n    _references = [\n        {\n            \"entry\": BibTeX(\n                \"@article{0031-9155-61-22-7975,\"\n                \"author={Benjamin A Thomas and Vesna Cuplov and Alexandre Bousse and \"\n                \"Adriana Mendes and Kris Thielemans and Brian F Hutton and Kjell Erlandsson},\"\n                \"title={PETPVC: a toolbox for performing partial volume correction \"\n                \"techniques in positron emission tomography},\"\n                \"journal={Physics in Medicine and Biology},\"\n                \"volume={61},\"\n                \"number={22},\"\n                \"pages={7975},\"\n                \"url={http://stacks.iop.org/0031-9155/61/i=22/a=7975},\"\n                \"doi={https://doi.org/10.1088/0031-9155/61/22/7975},\"\n                \"year={2016},\"\n                \"}\"\n            ),\n            \"description\": \"PETPVC software implementation publication\",\n            \"tags\": [\"implementation\"],\n        }\n    ]\n\n    def _list_outputs(self):\n        outputs = self.output_spec().get()\n        outputs[\"out_file\"] = self.inputs.out_file\n        if not isdefined(outputs[\"out_file\"]):\n            method_name = self.inputs.pvc.lower()\n            outputs[\"out_file\"] = self._gen_fname(\n                self.inputs.in_file, suffix=f\"_{method_name}_pvc\"\n            )\n\n        outputs[\"out_file\"] = os.path.abspath(outputs[\"out_file\"])\n        return outputs\n\n    def _gen_fname(\n        self, basename, cwd=None, suffix=None, change_ext=True, ext=\".nii.gz\"\n    ):\n        \"\"\"Generate a filename based on the given parameters.\n\n        The filename will take the form: cwd/basename<suffix><ext>.\n        If change_ext is True, it will use the extensions specified in\n        <instance>inputs.output_type.\n\n        Parameters\n        ----------\n        basename : str\n            Filename to base the new filename on.\n        cwd : str\n            Path to prefix to the new filename. (default is os.getcwd())\n        suffix : str\n            Suffix to add to the `basename`.  (defaults is '' )\n        change_ext : bool\n            Flag to change the filename extension to the given `ext`.\n            (Default is False)\n\n        Returns\n        -------\n        fname : str\n            New filename based on given parameters.\n\n        \"\"\"\n        if basename == \"\":\n            msg = \"Unable to generate filename for command %s. \" % self.cmd\n            msg += \"basename is not set!\"\n            raise ValueError(msg)\n        if cwd is None:\n            cwd = os.getcwd()\n        if change_ext:\n            if suffix:\n                suffix = \"\".join((suffix, ext))\n            else:\n                suffix = ext\n        if suffix is None:\n            suffix = \"\"\n        fname = fname_presuffix(basename, suffix=suffix, use_ext=False, newpath=cwd)\n        return fname\n\n    def _gen_filename(self, name):\n        if name == \"out_file\":\n            return self._list_outputs()[\"out_file\"]\n        return None\n", "path": "nipype/interfaces/petpvc.py"}], "after_files": [{"content": "# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n\"\"\"PETPVC is a toolbox for partial volume correction in positron emission tomography.\"\"\"\nimport os\n\nfrom .base import (\n    TraitedSpec,\n    CommandLineInputSpec,\n    CommandLine,\n    File,\n    isdefined,\n    traits,\n)\nfrom ..utils.filemanip import fname_presuffix\nfrom ..external.due import BibTeX\n\npvc_methods = [\n    \"GTM\",\n    \"IY\",\n    \"IY+RL\",\n    \"IY+VC\",\n    \"LABBE\",\n    \"LABBE+MTC\",\n    \"LABBE+MTC+RL\",\n    \"LABBE+MTC+VC\",\n    \"LABBE+RBV\",\n    \"LABBE+RBV+RL\",\n    \"LABBE+RBV+VC\",\n    \"MG\",\n    \"MG+RL\",\n    \"MG+VC\",\n    \"MTC\",\n    \"MTC+RL\",\n    \"MTC+VC\",\n    \"RBV\",\n    \"RBV+RL\",\n    \"RBV+VC\",\n    \"RL\",\n    \"VC\",\n    \"STC\",\n]\n\n\nclass PETPVCInputSpec(CommandLineInputSpec):\n    in_file = File(desc=\"PET image file\", exists=True, mandatory=True, argstr=\"-i %s\")\n    out_file = File(desc=\"Output file\", genfile=True, hash_files=False, argstr=\"-o %s\")\n    mask_file = File(\n        desc=\"Mask image file\", exists=True, mandatory=True, argstr=\"-m %s\"\n    )\n    pvc = traits.Enum(\n        pvc_methods,\n        mandatory=True,\n        argstr=\"-p %s\",\n        desc=\"\"\"\\\nDesired PVC method:\n\n    * Geometric transfer matrix -- ``GTM``\n    * Labbe approach -- ``LABBE``\n    * Richardson-Lucy -- ``RL``\n    * Van-Cittert -- ``VC``\n    * Region-based voxel-wise correction -- ``RBV``\n    * RBV with Labbe -- ``LABBE+RBV``\n    * RBV with Van-Cittert -- ``RBV+VC``\n    * RBV with Richardson-Lucy -- ``RBV+RL``\n    * RBV with Labbe and Van-Cittert -- ``LABBE+RBV+VC``\n    * RBV with Labbe and Richardson-Lucy -- ``LABBE+RBV+RL``\n    * Multi-target correction -- ``MTC``\n    * MTC with Labbe -- ``LABBE+MTC``\n    * MTC with Van-Cittert -- ``MTC+VC``\n    * MTC with Richardson-Lucy -- ``MTC+RL``\n    * MTC with Labbe and Van-Cittert -- ``LABBE+MTC+VC``\n    * MTC with Labbe and Richardson-Lucy -- ``LABBE+MTC+RL``\n    * Iterative Yang -- ``IY``\n    * Iterative Yang with Van-Cittert -- ``IY+VC``\n    * Iterative Yang with Richardson-Lucy -- ``IY+RL``\n    * Muller Gartner -- ``MG``\n    * Muller Gartner with Van-Cittert -- ``MG+VC``\n    * Muller Gartner with Richardson-Lucy -- ``MG+RL``\n    * Single-target correction -- ``STC``\n\n\"\"\",\n    )\n    fwhm_x = traits.Float(\n        desc=\"The full-width at half maximum in mm along x-axis\",\n        mandatory=True,\n        argstr=\"-x %.4f\",\n    )\n    fwhm_y = traits.Float(\n        desc=\"The full-width at half maximum in mm along y-axis\",\n        mandatory=True,\n        argstr=\"-y %.4f\",\n    )\n    fwhm_z = traits.Float(\n        desc=\"The full-width at half maximum in mm along z-axis\",\n        mandatory=True,\n        argstr=\"-z %.4f\",\n    )\n    debug = traits.Bool(\n        desc=\"Prints debug information\",\n        usedefault=True,\n        default_value=False,\n        argstr=\"-d\",\n    )\n    n_iter = traits.Int(\n        desc=\"Number of iterations\", default_value=10, usedefault=True, argstr=\"-n %d\"\n    )\n    n_deconv = traits.Int(\n        desc=\"Number of deconvolution iterations\",\n        default_value=10,\n        usedefault=True,\n        argstr=\"-k %d\",\n    )\n    alpha = traits.Float(\n        desc=\"Alpha value\", default_value=1.5, usedefault=True, argstr=\"-a %.4f\"\n    )\n    stop_crit = traits.Float(\n        desc=\"Stopping criterion\", default_value=0.01, usedefault=True, argstr=\"-s %.4f\"\n    )\n\n\nclass PETPVCOutputSpec(TraitedSpec):\n    out_file = File(desc=\"Output file\")\n\n\nclass PETPVC(CommandLine):\n    \"\"\"Use PETPVC for partial volume correction of PET images.\n\n    PETPVC ([1]_, [2]_) is a software from the Nuclear Medicine Department\n    of the UCL University Hospital, London, UK.\n\n    Examples\n    --------\n    >>> from ..testing import example_data\n    >>> #TODO get data for PETPVC\n    >>> pvc = PETPVC()\n    >>> pvc.inputs.in_file   = 'pet.nii.gz'\n    >>> pvc.inputs.mask_file = 'tissues.nii.gz'\n    >>> pvc.inputs.out_file  = 'pet_pvc_rbv.nii.gz'\n    >>> pvc.inputs.pvc = 'RBV'\n    >>> pvc.inputs.fwhm_x = 2.0\n    >>> pvc.inputs.fwhm_y = 2.0\n    >>> pvc.inputs.fwhm_z = 2.0\n    >>> outs = pvc.run() #doctest: +SKIP\n\n    References\n    ----------\n    .. [1] K. Erlandsson, I. Buvat, P. H. Pretorius, B. A. Thomas, and B. F. Hutton,\n           \"A review of partial volume correction techniques for emission tomography\n           and their applications in neurology, cardiology and oncology,\" Phys. Med.\n           Biol., vol. 57, no. 21, p. R119, 2012.\n    .. [2] https://github.com/UCL/PETPVC\n\n    \"\"\"\n\n    input_spec = PETPVCInputSpec\n    output_spec = PETPVCOutputSpec\n    _cmd = \"petpvc\"\n\n    _references = [\n        {\n            \"entry\": BibTeX(\n                \"@article{0031-9155-61-22-7975,\"\n                \"author={Benjamin A Thomas and Vesna Cuplov and Alexandre Bousse and \"\n                \"Adriana Mendes and Kris Thielemans and Brian F Hutton and Kjell Erlandsson},\"\n                \"title={PETPVC: a toolbox for performing partial volume correction \"\n                \"techniques in positron emission tomography},\"\n                \"journal={Physics in Medicine and Biology},\"\n                \"volume={61},\"\n                \"number={22},\"\n                \"pages={7975},\"\n                \"url={http://stacks.iop.org/0031-9155/61/i=22/a=7975},\"\n                \"doi={https://doi.org/10.1088/0031-9155/61/22/7975},\"\n                \"year={2016},\"\n                \"}\"\n            ),\n            \"description\": \"PETPVC software implementation publication\",\n            \"tags\": [\"implementation\"],\n        }\n    ]\n\n    def _list_outputs(self):\n        outputs = self.output_spec().get()\n        outputs[\"out_file\"] = self.inputs.out_file\n        if not isdefined(outputs[\"out_file\"]):\n            method_name = self.inputs.pvc.lower()\n            outputs[\"out_file\"] = self._gen_fname(\n                self.inputs.in_file, suffix=f\"_{method_name}_pvc\"\n            )\n\n        outputs[\"out_file\"] = os.path.abspath(outputs[\"out_file\"])\n        return outputs\n\n    def _gen_fname(\n        self, basename, cwd=None, suffix=None, change_ext=True, ext=\".nii.gz\"\n    ):\n        \"\"\"Generate a filename based on the given parameters.\n\n        The filename will take the form: cwd/basename<suffix><ext>.\n        If change_ext is True, it will use the extensions specified in\n        <instance>inputs.output_type.\n\n        Parameters\n        ----------\n        basename : str\n            Filename to base the new filename on.\n        cwd : str\n            Path to prefix to the new filename. (default is os.getcwd())\n        suffix : str\n            Suffix to add to the `basename`.  (defaults is '' )\n        change_ext : bool\n            Flag to change the filename extension to the given `ext`.\n            (Default is False)\n\n        Returns\n        -------\n        fname : str\n            New filename based on given parameters.\n\n        \"\"\"\n        if basename == \"\":\n            msg = \"Unable to generate filename for command %s. \" % self.cmd\n            msg += \"basename is not set!\"\n            raise ValueError(msg)\n        if cwd is None:\n            cwd = os.getcwd()\n        if change_ext:\n            if suffix:\n                suffix = \"\".join((suffix, ext))\n            else:\n                suffix = ext\n        if suffix is None:\n            suffix = \"\"\n        fname = fname_presuffix(basename, suffix=suffix, use_ext=False, newpath=cwd)\n        return fname\n\n    def _gen_filename(self, name):\n        if name == \"out_file\":\n            return self._list_outputs()[\"out_file\"]\n        return None\n", "path": "nipype/interfaces/petpvc.py"}]}