Skip to content

Commit 34a7c1d

Browse files
committed
fix: some lgtm errors (#2475)
1 parent e679215 commit 34a7c1d

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

nipype/algorithms/misc.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ def _list_outputs(self):
11911191
return outputs
11921192

11931193

1194-
def normalize_tpms(in_files, in_mask=None, out_files=[]):
1194+
def normalize_tpms(in_files, in_mask=None, out_files=None):
11951195
"""
11961196
Returns the input tissue probability maps (tpms, aka volume fractions)
11971197
normalized to sum up 1.0 at each voxel within the mask.
@@ -1202,6 +1202,9 @@ def normalize_tpms(in_files, in_mask=None, out_files=[]):
12021202

12031203
in_files = np.atleast_1d(in_files).tolist()
12041204

1205+
if not out_files:
1206+
out_files = []
1207+
12051208
if len(out_files) != len(in_files):
12061209
for i, finname in enumerate(in_files):
12071210
fname, fext = op.splitext(op.basename(finname))

nipype/interfaces/ants/segmentation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def _format_arg(self, opt, spec, val):
150150
if isdefined(self.inputs.save_posteriors):
151151
retval += ",%s" % self.inputs.output_posteriors_name_template
152152
return retval + "]"
153-
return super(ANTSCommand, self)._format_arg(opt, spec, val)
153+
return super(Atropos, self)._format_arg(opt, spec, val)
154154

155155
def _run_interface(self, runtime, correct_return_codes=[0]):
156156
if self.inputs.initialization == "PriorProbabilityImages":
@@ -640,7 +640,7 @@ def _format_arg(self, opt, spec, val):
640640
_, _, ext = split_filename(self.inputs.segmentation_priors[0])
641641
retval = "-p nipype_priors/BrainSegmentationPrior%02d" + ext
642642
return retval
643-
return super(ANTSCommand, self)._format_arg(opt, spec, val)
643+
return super(CorticalThickness, self)._format_arg(opt, spec, val)
644644

645645
def _run_interface(self, runtime, correct_return_codes=[0]):
646646
priors_directory = os.path.join(os.getcwd(), "nipype_priors")
@@ -1066,7 +1066,7 @@ def _format_arg(self, opt, spec, val):
10661066
assert len(val) == self.inputs.modalities * len(self.inputs.warped_label_images), \
10671067
"Number of intensity images and label maps must be the same {0}!={1}".format(
10681068
len(val), len(self.inputs.warped_label_images))
1069-
return super(ANTSCommand, self)._format_arg(opt, spec, val)
1069+
return super(JointFusion, self)._format_arg(opt, spec, val)
10701070
return retval
10711071

10721072
def _list_outputs(self):

nipype/interfaces/cmtk/nx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def average_networks(in_files, ntwk_res_file, group_id):
139139
current = ntwk.edge[edge[0]][edge[1]]
140140
data = add_dicts_by_key(current, data)
141141
ntwk.add_edge(edge[0], edge[1], **data)
142-
nodes = list(nodes())
142+
nodes = list(tmp.nodes())
143143
for node in nodes:
144144
data = {}
145145
data = ntwk.nodes[node]

nipype/interfaces/fsl/preprocess.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,7 +2025,7 @@ def _list_outputs(self):
20252025
outputs['bvars'] = self._gen_mesh_names('bvars', structures)
20262026
return outputs
20272027

2028-
def _gen_fname(self, name):
2028+
def _gen_fname(self, basename):
20292029
path, outname, ext = split_filename(self.inputs.out_file)
20302030

20312031
method = 'none'
@@ -2039,9 +2039,9 @@ def _gen_fname(self, name):
20392039
thres = '%.4f' % self.inputs.method_as_numerical_threshold
20402040
method = thres.replace('.', '')
20412041

2042-
if name == 'original_segmentations':
2042+
if basename == 'original_segmentations':
20432043
return op.abspath('%s_all_%s_origsegs.nii.gz' % (outname, method))
2044-
if name == 'segmentation_file':
2044+
if basename == 'segmentation_file':
20452045
return op.abspath('%s_all_%s_firstseg.nii.gz' % (outname, method))
20462046

20472047
return None

0 commit comments

Comments
 (0)