We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
ENH: ICA_AROMA: make current working directory default output directory
Changes proposed in this pull request
- Make the default output directory the current working directory so you don't have to specify an out_dir, which I believe makes ICA_AROMA more Node friendly.



--- 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/fsl/ICA_AROMA.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
3 # vi: set ft=python sts=4 ts=4 sw=4 et:
4 """This commandline module provides classes for interfacing with the
5 `ICA-AROMA.py<https://github.com/rhr-pruim/ICA-AROMA>`_ command line tool.
6     Change directory to provide relative paths for doctests
7     >>> import os
8     >>> filepath = os.path.dirname(os.path.realpath(__file__))
9     >>> datadir = os.path.realpath(os.path.join(filepath,
10     ...                            '../../testing/data'))
11     >>> os.chdir(datadir)
12 """
13 
14 from __future__ import print_function, division, unicode_literals, absolute_import
15 from ..base import (TraitedSpec, CommandLineInputSpec, CommandLine,
16                     File, Directory, traits)
17 import os
18 
19 
20 class ICA_AROMAInputSpec(CommandLineInputSpec):
21     feat_dir = Directory(exists=True, mandatory=True,
22                          argstr='-feat %s',
23                          xor=['in_file', 'mat_file', 'fnirt_warp_file', 'motion_parameters'],
24                          desc='If a feat directory exists and temporal filtering '
25                          'has not been run yet, ICA_AROMA can use the files in '
26                          'this directory.')
27     in_file = File(exists=True, mandatory=True,
28                    argstr='-i %s', xor=['feat_dir'],
29                    desc='volume to be denoised')
30     out_dir = Directory('out', genfile=True,
31                         argstr='-o %s',
32                         desc='output directory')
33     mask = File(exists=True, argstr='-m %s', xor=['feat_dir'],
34                 desc='path/name volume mask')
35     dim = traits.Int(argstr='-dim %d',
36                      desc='Dimensionality reduction when running '
37                      'MELODIC (defualt is automatic estimation)')
38     TR = traits.Float(argstr='-tr %.3f',
39                       desc='TR in seconds. If this is not specified '
40                       'the TR will be extracted from the '
41                       'header of the fMRI nifti file.')
42     melodic_dir = Directory(exists=True, argstr='-meldir %s',
43                             desc='path to MELODIC directory if MELODIC has already been run')
44     mat_file = File(exists=True, argstr='-affmat %s', xor=['feat_dir'],
45                     desc='path/name of the mat-file describing the '
46                     'affine registration (e.g. FSL FLIRT) of the '
47                     'functional data to structural space (.mat file)')
48     fnirt_warp_file = File(exists=True, argstr='-warp %s', xor=['feat_dir'],
49                            desc='File name of the warp-file describing '
50                            'the non-linear registration (e.g. FSL FNIRT) '
51                            'of the structural data to MNI152 space (.nii.gz)')
52     motion_parameters = File(exists=True, mandatory=True,
53                              argstr='-mc %s', xor=['feat_dir'],
54                              desc='motion parameters file')
55     denoise_type = traits.Enum('nonaggr', 'aggr', 'both', 'no', usedefault=True,
56                                mandatory=True, argstr='-den %s',
57                                desc='Type of denoising strategy:\n'
58                                '-none: only classification, no denoising\n'
59                                '-nonaggr (default): non-aggresssive denoising, i.e. partial component regression\n'
60                                '-aggr: aggressive denoising, i.e. full component regression\n'
61                                '-both: both aggressive and non-aggressive denoising (two outputs)')
62 
63 class ICA_AROMAOutputSpec(TraitedSpec):
64     aggr_denoised_file = File(exists=True,
65                               desc='if generated: aggressively denoised volume')
66     nonaggr_denoised_file = File(exists=True,
67                                  desc='if generated: non aggressively denoised volume' )
68     out_dir = Directory(exists=True,
69                         desc='directory contains (in addition to the denoised files): '
70                         'melodic.ica + classified_motion_components + '
71                         'classification_overview + feature_scores + melodic_ic_mni)')
72 
73 class ICA_AROMA(CommandLine):
74     """
75     Interface for the ICA_AROMA.py script.
76 
77     ICA-AROMA (i.e. 'ICA-based Automatic Removal Of Motion Artifacts') concerns
78     a data-driven method to identify and remove motion-related independent
79     components from fMRI data. To that end it exploits a small, but robust
80     set of theoretically motivated features, preventing the need for classifier
81     re-training and therefore providing direct and easy applicability.
82 
83     See link for further documentation: https://github.com/rhr-pruim/ICA-AROMA
84 
85     Example
86     -------
87 
88     >>> from nipype.interfaces.fsl import ICA_AROMA
89     >>> from nipype.testing import example_data
90     >>> AROMA_obj = ICA_AROMA.ICA_AROMA()
91     >>> AROMA_obj.inputs.in_file = 'functional.nii'
92     >>> AROMA_obj.inputs.mat_file = 'func_to_struct.mat'
93     >>> AROMA_obj.inputs.fnirt_warp_file = 'warpfield.nii'
94     >>> AROMA_obj.inputs.motion_parameters = 'fsl_mcflirt_movpar.txt'
95     >>> AROMA_obj.inputs.mask = 'mask.nii.gz'
96     >>> AROMA_obj.inputs.denoise_type = 'both'
97     >>> AROMA_obj.inputs.out_dir = 'ICA_testout'
98     >>> AROMA_obj.cmdline # doctest: +ALLOW_UNICODE
99     'ICA_AROMA.py -den both -warp warpfield.nii -i functional.nii -m mask.nii.gz -affmat func_to_struct.mat -mc fsl_mcflirt_movpar.txt -o ICA_testout'
100     """
101     _cmd = 'ICA_AROMA.py'
102     input_spec = ICA_AROMAInputSpec
103     output_spec = ICA_AROMAOutputSpec
104 
105     def _list_outputs(self):
106         outputs = self.output_spec().get()
107         if isdefined(self.inputs.out_dir):
108             outputs['out_dir'] = os.path.abspath(self.inputs.out_dir)
109         else:
110             outputs['out_dir'] = self._gen_filename('out_dir')
111         out_dir = outputs['out_dir']
112         
113         if self.inputs.denoise_type in ('aggr', 'both'):
114             outputs['aggr_denoised_file'] = os.path.join(out_dir, 'denoised_func_data_aggr.nii.gz')
115         if self.inputs.denoise_type in ('nonaggr', 'both'):
116             outputs['nonaggr_denoised_file'] = os.path.join(out_dir, 'denoised_func_data_nonaggr.nii.gz')
117         return outputs
118 
119     def _gen_filename(self, name):
120         if name == 'out_dir':
121             return os.getcwd()
122 
123     
124
```
--- 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/fsl/ICA_AROMA.py b/nipype/interfaces/fsl/ICA_AROMA.py
--- a/nipype/interfaces/fsl/ICA_AROMA.py
+++ b/nipype/interfaces/fsl/ICA_AROMA.py
@@ -13,7 +13,7 @@
 
 from __future__ import print_function, division, unicode_literals, absolute_import
 from ..base import (TraitedSpec, CommandLineInputSpec, CommandLine,
-                    File, Directory, traits)
+                    File, Directory, traits, isdefined)
 import os
 
 
@@ -109,7 +109,7 @@
         else:
             outputs['out_dir'] = self._gen_filename('out_dir')
         out_dir = outputs['out_dir']
-        
+
         if self.inputs.denoise_type in ('aggr', 'both'):
             outputs['aggr_denoised_file'] = os.path.join(out_dir, 'denoised_func_data_aggr.nii.gz')
         if self.inputs.denoise_type in ('nonaggr', 'both'):
@@ -119,5 +119,3 @@
     def _gen_filename(self, name):
         if name == 'out_dir':
             return os.getcwd()
-
-

{"golden_diff": "diff --git a/nipype/interfaces/fsl/ICA_AROMA.py b/nipype/interfaces/fsl/ICA_AROMA.py\n--- a/nipype/interfaces/fsl/ICA_AROMA.py\n+++ b/nipype/interfaces/fsl/ICA_AROMA.py\n@@ -13,7 +13,7 @@\n \n from __future__ import print_function, division, unicode_literals, absolute_import\n from ..base import (TraitedSpec, CommandLineInputSpec, CommandLine,\n-                    File, Directory, traits)\n+                    File, Directory, traits, isdefined)\n import os\n \n \n@@ -109,7 +109,7 @@\n         else:\n             outputs['out_dir'] = self._gen_filename('out_dir')\n         out_dir = outputs['out_dir']\n-        \n+\n         if self.inputs.denoise_type in ('aggr', 'both'):\n             outputs['aggr_denoised_file'] = os.path.join(out_dir, 'denoised_func_data_aggr.nii.gz')\n         if self.inputs.denoise_type in ('nonaggr', 'both'):\n@@ -119,5 +119,3 @@\n     def _gen_filename(self, name):\n         if name == 'out_dir':\n             return os.getcwd()\n-\n-\n", "issue": "ENH: ICA_AROMA: make current working directory default output directory\nChanges proposed in this pull request\r\n- Make the default output directory the current working directory so you don't have to specify an out_dir, which I believe makes ICA_AROMA more Node friendly.\r\n\r\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n\"\"\"This commandline module provides classes for interfacing with the\n`ICA-AROMA.py<https://github.com/rhr-pruim/ICA-AROMA>`_ command line tool.\n    Change directory to provide relative paths for doctests\n    >>> import os\n    >>> filepath = os.path.dirname(os.path.realpath(__file__))\n    >>> datadir = os.path.realpath(os.path.join(filepath,\n    ...                            '../../testing/data'))\n    >>> os.chdir(datadir)\n\"\"\"\n\nfrom __future__ import print_function, division, unicode_literals, absolute_import\nfrom ..base import (TraitedSpec, CommandLineInputSpec, CommandLine,\n                    File, Directory, traits)\nimport os\n\n\nclass ICA_AROMAInputSpec(CommandLineInputSpec):\n    feat_dir = Directory(exists=True, mandatory=True,\n                         argstr='-feat %s',\n                         xor=['in_file', 'mat_file', 'fnirt_warp_file', 'motion_parameters'],\n                         desc='If a feat directory exists and temporal filtering '\n                         'has not been run yet, ICA_AROMA can use the files in '\n                         'this directory.')\n    in_file = File(exists=True, mandatory=True,\n                   argstr='-i %s', xor=['feat_dir'],\n                   desc='volume to be denoised')\n    out_dir = Directory('out', genfile=True,\n                        argstr='-o %s',\n                        desc='output directory')\n    mask = File(exists=True, argstr='-m %s', xor=['feat_dir'],\n                desc='path/name volume mask')\n    dim = traits.Int(argstr='-dim %d',\n                     desc='Dimensionality reduction when running '\n                     'MELODIC (defualt is automatic estimation)')\n    TR = traits.Float(argstr='-tr %.3f',\n                      desc='TR in seconds. If this is not specified '\n                      'the TR will be extracted from the '\n                      'header of the fMRI nifti file.')\n    melodic_dir = Directory(exists=True, argstr='-meldir %s',\n                            desc='path to MELODIC directory if MELODIC has already been run')\n    mat_file = File(exists=True, argstr='-affmat %s', xor=['feat_dir'],\n                    desc='path/name of the mat-file describing the '\n                    'affine registration (e.g. FSL FLIRT) of the '\n                    'functional data to structural space (.mat file)')\n    fnirt_warp_file = File(exists=True, argstr='-warp %s', xor=['feat_dir'],\n                           desc='File name of the warp-file describing '\n                           'the non-linear registration (e.g. FSL FNIRT) '\n                           'of the structural data to MNI152 space (.nii.gz)')\n    motion_parameters = File(exists=True, mandatory=True,\n                             argstr='-mc %s', xor=['feat_dir'],\n                             desc='motion parameters file')\n    denoise_type = traits.Enum('nonaggr', 'aggr', 'both', 'no', usedefault=True,\n                               mandatory=True, argstr='-den %s',\n                               desc='Type of denoising strategy:\\n'\n                               '-none: only classification, no denoising\\n'\n                               '-nonaggr (default): non-aggresssive denoising, i.e. partial component regression\\n'\n                               '-aggr: aggressive denoising, i.e. full component regression\\n'\n                               '-both: both aggressive and non-aggressive denoising (two outputs)')\n\nclass ICA_AROMAOutputSpec(TraitedSpec):\n    aggr_denoised_file = File(exists=True,\n                              desc='if generated: aggressively denoised volume')\n    nonaggr_denoised_file = File(exists=True,\n                                 desc='if generated: non aggressively denoised volume' )\n    out_dir = Directory(exists=True,\n                        desc='directory contains (in addition to the denoised files): '\n                        'melodic.ica + classified_motion_components + '\n                        'classification_overview + feature_scores + melodic_ic_mni)')\n\nclass ICA_AROMA(CommandLine):\n    \"\"\"\n    Interface for the ICA_AROMA.py script.\n\n    ICA-AROMA (i.e. 'ICA-based Automatic Removal Of Motion Artifacts') concerns\n    a data-driven method to identify and remove motion-related independent\n    components from fMRI data. To that end it exploits a small, but robust\n    set of theoretically motivated features, preventing the need for classifier\n    re-training and therefore providing direct and easy applicability.\n\n    See link for further documentation: https://github.com/rhr-pruim/ICA-AROMA\n\n    Example\n    -------\n\n    >>> from nipype.interfaces.fsl import ICA_AROMA\n    >>> from nipype.testing import example_data\n    >>> AROMA_obj = ICA_AROMA.ICA_AROMA()\n    >>> AROMA_obj.inputs.in_file = 'functional.nii'\n    >>> AROMA_obj.inputs.mat_file = 'func_to_struct.mat'\n    >>> AROMA_obj.inputs.fnirt_warp_file = 'warpfield.nii'\n    >>> AROMA_obj.inputs.motion_parameters = 'fsl_mcflirt_movpar.txt'\n    >>> AROMA_obj.inputs.mask = 'mask.nii.gz'\n    >>> AROMA_obj.inputs.denoise_type = 'both'\n    >>> AROMA_obj.inputs.out_dir = 'ICA_testout'\n    >>> AROMA_obj.cmdline # doctest: +ALLOW_UNICODE\n    'ICA_AROMA.py -den both -warp warpfield.nii -i functional.nii -m mask.nii.gz -affmat func_to_struct.mat -mc fsl_mcflirt_movpar.txt -o ICA_testout'\n    \"\"\"\n    _cmd = 'ICA_AROMA.py'\n    input_spec = ICA_AROMAInputSpec\n    output_spec = ICA_AROMAOutputSpec\n\n    def _list_outputs(self):\n        outputs = self.output_spec().get()\n        if isdefined(self.inputs.out_dir):\n            outputs['out_dir'] = os.path.abspath(self.inputs.out_dir)\n        else:\n            outputs['out_dir'] = self._gen_filename('out_dir')\n        out_dir = outputs['out_dir']\n        \n        if self.inputs.denoise_type in ('aggr', 'both'):\n            outputs['aggr_denoised_file'] = os.path.join(out_dir, 'denoised_func_data_aggr.nii.gz')\n        if self.inputs.denoise_type in ('nonaggr', 'both'):\n            outputs['nonaggr_denoised_file'] = os.path.join(out_dir, 'denoised_func_data_nonaggr.nii.gz')\n        return outputs\n\n    def _gen_filename(self, name):\n        if name == 'out_dir':\n            return os.getcwd()\n\n    \n", "path": "nipype/interfaces/fsl/ICA_AROMA.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n\"\"\"This commandline module provides classes for interfacing with the\n`ICA-AROMA.py<https://github.com/rhr-pruim/ICA-AROMA>`_ command line tool.\n    Change directory to provide relative paths for doctests\n    >>> import os\n    >>> filepath = os.path.dirname(os.path.realpath(__file__))\n    >>> datadir = os.path.realpath(os.path.join(filepath,\n    ...                            '../../testing/data'))\n    >>> os.chdir(datadir)\n\"\"\"\n\nfrom __future__ import print_function, division, unicode_literals, absolute_import\nfrom ..base import (TraitedSpec, CommandLineInputSpec, CommandLine,\n                    File, Directory, traits, isdefined)\nimport os\n\n\nclass ICA_AROMAInputSpec(CommandLineInputSpec):\n    feat_dir = Directory(exists=True, mandatory=True,\n                         argstr='-feat %s',\n                         xor=['in_file', 'mat_file', 'fnirt_warp_file', 'motion_parameters'],\n                         desc='If a feat directory exists and temporal filtering '\n                         'has not been run yet, ICA_AROMA can use the files in '\n                         'this directory.')\n    in_file = File(exists=True, mandatory=True,\n                   argstr='-i %s', xor=['feat_dir'],\n                   desc='volume to be denoised')\n    out_dir = Directory('out', genfile=True,\n                        argstr='-o %s',\n                        desc='output directory')\n    mask = File(exists=True, argstr='-m %s', xor=['feat_dir'],\n                desc='path/name volume mask')\n    dim = traits.Int(argstr='-dim %d',\n                     desc='Dimensionality reduction when running '\n                     'MELODIC (defualt is automatic estimation)')\n    TR = traits.Float(argstr='-tr %.3f',\n                      desc='TR in seconds. If this is not specified '\n                      'the TR will be extracted from the '\n                      'header of the fMRI nifti file.')\n    melodic_dir = Directory(exists=True, argstr='-meldir %s',\n                            desc='path to MELODIC directory if MELODIC has already been run')\n    mat_file = File(exists=True, argstr='-affmat %s', xor=['feat_dir'],\n                    desc='path/name of the mat-file describing the '\n                    'affine registration (e.g. FSL FLIRT) of the '\n                    'functional data to structural space (.mat file)')\n    fnirt_warp_file = File(exists=True, argstr='-warp %s', xor=['feat_dir'],\n                           desc='File name of the warp-file describing '\n                           'the non-linear registration (e.g. FSL FNIRT) '\n                           'of the structural data to MNI152 space (.nii.gz)')\n    motion_parameters = File(exists=True, mandatory=True,\n                             argstr='-mc %s', xor=['feat_dir'],\n                             desc='motion parameters file')\n    denoise_type = traits.Enum('nonaggr', 'aggr', 'both', 'no', usedefault=True,\n                               mandatory=True, argstr='-den %s',\n                               desc='Type of denoising strategy:\\n'\n                               '-none: only classification, no denoising\\n'\n                               '-nonaggr (default): non-aggresssive denoising, i.e. partial component regression\\n'\n                               '-aggr: aggressive denoising, i.e. full component regression\\n'\n                               '-both: both aggressive and non-aggressive denoising (two outputs)')\n\nclass ICA_AROMAOutputSpec(TraitedSpec):\n    aggr_denoised_file = File(exists=True,\n                              desc='if generated: aggressively denoised volume')\n    nonaggr_denoised_file = File(exists=True,\n                                 desc='if generated: non aggressively denoised volume' )\n    out_dir = Directory(exists=True,\n                        desc='directory contains (in addition to the denoised files): '\n                        'melodic.ica + classified_motion_components + '\n                        'classification_overview + feature_scores + melodic_ic_mni)')\n\nclass ICA_AROMA(CommandLine):\n    \"\"\"\n    Interface for the ICA_AROMA.py script.\n\n    ICA-AROMA (i.e. 'ICA-based Automatic Removal Of Motion Artifacts') concerns\n    a data-driven method to identify and remove motion-related independent\n    components from fMRI data. To that end it exploits a small, but robust\n    set of theoretically motivated features, preventing the need for classifier\n    re-training and therefore providing direct and easy applicability.\n\n    See link for further documentation: https://github.com/rhr-pruim/ICA-AROMA\n\n    Example\n    -------\n\n    >>> from nipype.interfaces.fsl import ICA_AROMA\n    >>> from nipype.testing import example_data\n    >>> AROMA_obj = ICA_AROMA.ICA_AROMA()\n    >>> AROMA_obj.inputs.in_file = 'functional.nii'\n    >>> AROMA_obj.inputs.mat_file = 'func_to_struct.mat'\n    >>> AROMA_obj.inputs.fnirt_warp_file = 'warpfield.nii'\n    >>> AROMA_obj.inputs.motion_parameters = 'fsl_mcflirt_movpar.txt'\n    >>> AROMA_obj.inputs.mask = 'mask.nii.gz'\n    >>> AROMA_obj.inputs.denoise_type = 'both'\n    >>> AROMA_obj.inputs.out_dir = 'ICA_testout'\n    >>> AROMA_obj.cmdline # doctest: +ALLOW_UNICODE\n    'ICA_AROMA.py -den both -warp warpfield.nii -i functional.nii -m mask.nii.gz -affmat func_to_struct.mat -mc fsl_mcflirt_movpar.txt -o ICA_testout'\n    \"\"\"\n    _cmd = 'ICA_AROMA.py'\n    input_spec = ICA_AROMAInputSpec\n    output_spec = ICA_AROMAOutputSpec\n\n    def _list_outputs(self):\n        outputs = self.output_spec().get()\n        if isdefined(self.inputs.out_dir):\n            outputs['out_dir'] = os.path.abspath(self.inputs.out_dir)\n        else:\n            outputs['out_dir'] = self._gen_filename('out_dir')\n        out_dir = outputs['out_dir']\n\n        if self.inputs.denoise_type in ('aggr', 'both'):\n            outputs['aggr_denoised_file'] = os.path.join(out_dir, 'denoised_func_data_aggr.nii.gz')\n        if self.inputs.denoise_type in ('nonaggr', 'both'):\n            outputs['nonaggr_denoised_file'] = os.path.join(out_dir, 'denoised_func_data_nonaggr.nii.gz')\n        return outputs\n\n    def _gen_filename(self, name):\n        if name == 'out_dir':\n            return os.getcwd()\n", "path": "nipype/interfaces/fsl/ICA_AROMA.py"}]}