Skip to content

Commit 0a4bda2

Browse files
committed
fixed variable name changes
1 parent 54d9d1d commit 0a4bda2

File tree

4 files changed

+68
-39
lines changed

4 files changed

+68
-39
lines changed

.cache/v/cache/lastfailed

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"nipype/algorithms/tests/test_tsnr.py": true,
3+
"nipype/interfaces/dtitk/tests/test_auto_AffineTask.py": true,
4+
"nipype/interfaces/dtitk/tests/test_auto_BinThreshTask.py": true,
5+
"nipype/interfaces/dtitk/tests/test_auto_CommandLineDtitk.py": true,
6+
"nipype/interfaces/dtitk/tests/test_auto_ComposeXfmTask.py": true,
7+
"nipype/interfaces/dtitk/tests/test_auto_DiffeoTask.py": true,
8+
"nipype/interfaces/dtitk/tests/test_auto_RigidTask.py": true,
9+
"nipype/interfaces/dtitk/tests/test_auto_SVAdjustVoxSpTask.py": true,
10+
"nipype/interfaces/dtitk/tests/test_auto_SVResampleTask.py": true,
11+
"nipype/interfaces/dtitk/tests/test_auto_TVAdjustOriginTask.py": true,
12+
"nipype/interfaces/dtitk/tests/test_auto_TVAdjustVoxSpTask.py": true,
13+
"nipype/interfaces/dtitk/tests/test_auto_TVResampleTask.py": true,
14+
"nipype/interfaces/dtitk/tests/test_auto_TVtoolTask.py": true,
15+
"nipype/interfaces/dtitk/tests/test_auto_affScalarVolTask.py": true,
16+
"nipype/interfaces/dtitk/tests/test_auto_affSymTensor3DVolTask.py": true,
17+
"nipype/interfaces/dtitk/tests/test_auto_diffeoScalarVolTask.py": true,
18+
"nipype/interfaces/dtitk/tests/test_auto_diffeoSymTensor3DVolTask.py": true,
19+
"nipype/pipeline/plugins/tests/test_base.py": true,
20+
"nipype/testing/tests/test_utils.py": true,
21+
"nipype/workflows/rsfmri/fsl/tests/test_resting.py": true
22+
}

nipype/interfaces/dtitk/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
from ... import logging
2828
from ...utils.filemanip import fname_presuffix
29-
from ..base import traits, CommandLine
29+
from ..base import CommandLine
3030
from nipype.interfaces.fsl.base import Info
3131

3232
LOGGER = logging.getLogger('interface')

nipype/interfaces/dtitk/registration.py

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ class RigidTask(CommandLineDtitk):
4141

4242
def _list_outputs(self):
4343
outputs = self.output_spec().get()
44-
outputs['out_file_xfm'] = self.inputs.in_file.replace('.nii.gz', '.aff')
44+
outputs['out_file_xfm'] = self.inputs.in_file.replace('.nii.gz',
45+
'.aff')
4546
outputs['out_file'] = self.inputs.in_file.replace('.nii.gz',
4647
'_aff.nii.gz')
4748
return outputs
@@ -55,8 +56,8 @@ class AffineInputSpec(CommandLineInputSpec):
5556
desc="moving list of diffusion tensor image paths", exists=True,
5657
mandatory=False, position=1, argstr="%s")
5758
in_similarity_metric = traits.Enum('EDS', 'GDS', 'DDS', 'NMI', exists=True,
58-
mandatory=False, position=3, argstr="%s",
59-
desc = "similarity metric")
59+
mandatory=False, position=3,
60+
argstr="%s", desc="similarity metric")
6061
in_usetrans_flag = traits.Enum('--useTrans', '', exists=True,
6162
mandatory=False, position=4, argstr="%s",
6263
desc="initialize using rigid transform??")
@@ -88,10 +89,10 @@ class AffineTask(CommandLineDtitk):
8889

8990
def _list_outputs(self):
9091
outputs = self.output_spec().get()
91-
outputs['out_file_xfm'] = self.inputs.in_fixed_tensor.replace('.nii.gz',
92-
'.aff')
93-
outputs['out_file'] = self.inputs.in_fixed_tensor.replace('.nii.gz',
94-
'_aff.nii.gz')
92+
outputs['out_file_xfm'] = self.inputs.in_fixed_tensor.replace(
93+
'.nii.gz', '.aff')
94+
outputs['out_file'] = self.inputs.in_fixed_tensor.replace(
95+
'.nii.gz', '_aff.nii.gz')
9596
return outputs
9697

9798

@@ -135,7 +136,7 @@ class DiffeoTask(CommandLineDtitk):
135136
def _list_outputs(self):
136137
outputs = self.output_spec().get()
137138
outputs['out_file_xfm'] = self.inputs.in_fixed_tensor.replace(
138-
'.nii.gz','_aff_diffeo.df.nii.gz')
139+
'.nii.gz', '_aff_diffeo.df.nii.gz')
139140
outputs['out_file'] = self.inputs.in_fixed_tensor.replace(
140141
'.nii.gz', '_aff_diffeo.nii.gz')
141142
return outputs
@@ -182,7 +183,8 @@ def _list_outputs(self):
182183
class diffeoSymTensor3DVolInputSpec(CommandLineInputSpec):
183184
in_tensor = traits.Str(desc='moving tensor', exists=True, mandatory=False,
184185
position=0, argstr="-in %s")
185-
in_xfm = traits.Str(desc='transform to apply', exists=True, mandatory=False,
186+
in_xfm = traits.Str(desc='transform to apply', exists=True,
187+
mandatory=False,
186188
position=1, argstr="-trans %s")
187189
in_target = traits.Str(desc='', exists=True, mandatory=False, position=2,
188190
argstr="-target %s")
@@ -222,8 +224,8 @@ def _list_outputs(self):
222224
class affSymTensor3DVolInputSpec(CommandLineInputSpec):
223225
in_tensor = traits.Str(desc='moving tensor', exists=True, mandatory=False,
224226
position=0, argstr="-in %s")
225-
in_xfm = traits.Str(desc='transform to apply', exists=True, mandatory=False,
226-
position=1, argstr="-trans %s")
227+
in_xfm = traits.Str(desc='transform to apply', exists=True,
228+
mandatory=False, position=1, argstr="-trans %s")
227229
in_target = traits.Str(desc='', exists=True, mandatory=False, position=2,
228230
argstr="-target %s")
229231
out_path = traits.Str(desc='', exists=True, mandatory=False, position=3,
@@ -261,7 +263,8 @@ def _list_outputs(self):
261263
class affScalarVolInputSpec(CommandLineInputSpec):
262264
in_volume = traits.Str(desc='moving volume', exists=True, mandatory=False,
263265
position=0, argstr="-in %s")
264-
in_xfm = traits.Str(desc='transform to apply', exists=True, mandatory=False,
266+
in_xfm = traits.Str(desc='transform to apply', exists=True,
267+
mandatory=False,
265268
position=1, argstr="-trans %s")
266269
in_target = traits.Str(desc='', position=2, argstr="-target %s")
267270
out_path = traits.Str(desc='', mandatory=False, position=3,
@@ -299,7 +302,8 @@ def _list_outputs(self):
299302
class diffeoScalarVolInputSpec(CommandLineInputSpec):
300303
in_volume = traits.Str(desc='moving volume', exists=True, mandatory=False,
301304
position=0, argstr="-in %s")
302-
in_xfm = traits.Str(desc='transform to apply', exists=True, mandatory=False,
305+
in_xfm = traits.Str(desc='transform to apply', exists=True,
306+
mandatory=False,
303307
position=2, argstr="-trans %s")
304308
in_target = traits.Str(desc='', exists=True, mandatory=False, position=3,
305309
argstr="-target %s")
@@ -329,7 +333,7 @@ class diffeoScalarVolTask(CommandLineDtitk):
329333
330334
>>> import nipype.interfaces.dtitk as dtitk
331335
>>> node = dtitk.diffeoScalarVolTask()
332-
>>> node.inputs.in_tensor = 'fa.nii.gz'
336+
>>> node.inputs.in_volume = 'fa.nii.gz'
333337
>>> node.inputs.in_xfm = 'ants_Warp.nii.gz'
334338
>>> node.run() # doctest: +SKIP
335339
"""
@@ -343,6 +347,7 @@ def _list_outputs(self):
343347
if not isdefined(self.inputs.out_path):
344348
self.inputs.out_path = fname_presuffix(self.inputs.in_volume,
345349
suffix="_diffeoxfmd",
346-
newpath=os.path.abspath("."))
350+
newpath=os.path.abspath(
351+
"."))
347352
outputs['out_file'] = os.path.abspath(self.inputs.out_path)
348353
return outputs

nipype/interfaces/dtitk/utils.py

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__author__ = 'kjordan'
22

33
from ..base import TraitedSpec, CommandLineInputSpec, File, \
4-
traits, isdefined, split_filename
4+
traits, isdefined
55
import os
66
from .base import CommandLineDtitk
77

@@ -44,8 +44,8 @@ def _list_outputs(self):
4444
outputs["out_file"] = self._gen_fname(self.inputs.in_file,
4545
suffix=self._suffix,
4646
ext='.'+'.'.join(
47-
self.inputs.in_file.split(
48-
".")[1:]))
47+
self.inputs.in_file.
48+
split(".")[1:]))
4949
outputs["out_file"] = os.path.abspath(outputs["out_file"])
5050
return outputs
5151

@@ -96,8 +96,8 @@ def _list_outputs(self):
9696
outputs["out_file"] = self._gen_fname(self.inputs.in_file,
9797
suffix=self._suffix,
9898
ext='.'+'.'.join(
99-
self.inputs.in_file.split(
100-
".")[1:]))
99+
self.inputs.in_file.
100+
split(".")[1:]))
101101
outputs["out_file"] = os.path.abspath(outputs["out_file"])
102102
return outputs
103103

@@ -112,13 +112,14 @@ def _gen_filename(self, name):
112112

113113
class SVAdjustVoxSpInputSpec(CommandLineInputSpec):
114114
in_file = traits.Str(desc="image to resample", exists=True,
115-
mandatory=True, position=0, argstr="-in %s")
115+
mandatory=True, position=0, argstr="-in %s")
116116
in_target = traits.Str(desc='target volume', exists=True, mandatory=False,
117117
position=2, argstr="-target %s")
118118
in_voxsz = traits.Str(desc='resampled voxel size', exists=True,
119119
mandatory=False, position=3, argstr="-vsize %s")
120120
out_path = traits.Str(desc='output path', exists=True, mandatory=False,
121-
position=1, argstr="-out %s", name_source="in_volume",
121+
position=1, argstr="-out %s",
122+
name_source="in_file",
122123
name_template='%s_origmvd.nii.gz')
123124
origin = traits.Str(desc='xyz voxel size', exists=True, mandatory=False,
124125
position=4, argstr='-origin %s')
@@ -152,8 +153,8 @@ def _list_outputs(self):
152153
outputs["out_file"] = self._gen_fname(self.inputs.in_file,
153154
suffix=self._suffix,
154155
ext='.' + '.'.join(
155-
self.inputs.in_file.split(
156-
".")[1:]))
156+
self.inputs.in_file.
157+
plit(".")[1:]))
157158
outputs["out_file"] = os.path.abspath(outputs["out_file"])
158159
return outputs
159160

@@ -172,7 +173,7 @@ class TVResampleInputSpec(CommandLineInputSpec):
172173
mandatory=False, position=2, argstr="-vsize %s")
173174
out_path = traits.Str(desc='output path', exists=True, mandatory=False,
174175
position=3, argstr="-out %s",
175-
name_source="in_volume",
176+
name_source="in_file",
176177
name_template="%s_resampled.nii.gz")
177178

178179

@@ -204,8 +205,8 @@ def _list_outputs(self):
204205
outputs["out_file"] = self._gen_fname(self.inputs.in_file,
205206
suffix=self._suffix,
206207
ext='.' + '.'.join(
207-
self.inputs.in_file.split(
208-
".")[1:]))
208+
self.inputs.in_file.
209+
split(".")[1:]))
209210
outputs["out_file"] = os.path.abspath(outputs["out_file"])
210211
return outputs
211212

@@ -217,14 +218,15 @@ def _gen_filename(self, name):
217218

218219
class SVResampleInputSpec(CommandLineInputSpec):
219220
in_file = traits.Str(desc="image to resample", exists=True,
220-
mandatory=True, position=0, argstr="-in %s")
221+
mandatory=True, position=0, argstr="-in %s")
221222
in_arraysz = traits.Str(desc='resampled array size', exists=True,
222-
mandatory=False, position=1, \
223+
mandatory=False, position=1,
223224
argstr="-size %s")
224225
in_voxsz = traits.Str(desc='resampled voxel size', exists=True,
225226
mandatory=False, position=2, argstr="-vsize %s")
226227
out_path = traits.Str(desc='output path', exists=True, mandatory=False,
227-
position=3, argstr="-out %s", name_source="in_volume",
228+
position=3, argstr="-out %s",
229+
name_source="in_file",
228230
name_template="%s_resampled.nii.gz")
229231

230232

@@ -256,8 +258,8 @@ def _list_outputs(self):
256258
outputs["out_file"] = self._gen_fname(self.inputs.in_file,
257259
suffix=self._suffix,
258260
ext='.' + '.'.join(
259-
self.inputs.in_file.split(
260-
".")[1:]))
261+
self.inputs.in_file.
262+
split(".")[1:]))
261263
outputs["out_file"] = os.path.abspath(outputs["out_file"])
262264
return outputs
263265

@@ -269,7 +271,7 @@ def _gen_filename(self, name):
269271

270272
class TVtoolInputSpec(CommandLineInputSpec):
271273
in_file = traits.Str(desc="image to resample", exists=True,
272-
mandatory=False, position=0, argstr="-in %s")
274+
mandatory=False, position=0, argstr="-in %s")
273275
in_flag = traits.Enum('fa', 'tr', 'ad', 'rd', 'pd', 'rgb', exists=True,
274276
mandatory=False, position=1, argstr="-%s", desc='')
275277

@@ -303,8 +305,8 @@ def _list_outputs(self):
303305
outputs["out_file"] = self._gen_fname(self.inputs.in_file,
304306
suffix=_suffix,
305307
ext='.' + '.'.join(
306-
self.inputs.in_file.split(
307-
".")[1:]))
308+
self.inputs.in_file.
309+
split(".")[1:]))
308310
outputs["out_file"] = os.path.abspath(outputs["out_file"])
309311
return outputs
310312

@@ -316,7 +318,7 @@ def _gen_filename(self, name):
316318

317319
class BinThreshInputSpec(CommandLineInputSpec):
318320
in_file = traits.Str(desc='', exists=True, mandatory=False, position=0,
319-
argstr="%s")
321+
argstr="%s")
320322
out_path = traits.Str(desc='', exists=True, mandatory=False, position=1,
321323
argstr="%s")
322324
in_numbers = traits.Str(desc='LB UB inside_value outside_value',
@@ -354,8 +356,8 @@ def _list_outputs(self):
354356
outputs["out_file"] = self._gen_fname(self.inputs.in_file,
355357
suffix=self._suffix,
356358
ext='.'+'.'.join(
357-
self.inputs.in_file.split(
358-
".")[1:]))
359+
self.inputs.in_file.
360+
split(".")[1:]))
359361
outputs["out_file"] = os.path.abspath(outputs["out_file"])
360362
return outputs
361363

0 commit comments

Comments
 (0)