Skip to content

Commit 2794721

Browse files
committed
Merge pull request #448 from swederik/fix/nx
NetworkXMetrix fix. Thanks aguidon
2 parents 9525f40 + d5692d1 commit 2794721

File tree

1 file changed

+2
-4
lines changed
  • nipype/interfaces/cmtk

1 file changed

+2
-4
lines changed

nipype/interfaces/cmtk/nx.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ def compute_network_measures(ntwk):
299299

300300

301301
def add_node_data(node_array, ntwk):
302-
ntwk = read_unknown_ntwk(ntwk)
303302
node_ntwk = nx.Graph()
304303
newdata = {}
305304
for idx, data in ntwk.nodes_iter(data=True):
@@ -311,7 +310,6 @@ def add_node_data(node_array, ntwk):
311310

312311

313312
def add_edge_data(edge_array, ntwk, above=0, below=0):
314-
ntwk = read_unknown_ntwk(ntwk)
315313
edge_ntwk = ntwk.copy()
316314
data = {}
317315
for x, row in enumerate(edge_array):
@@ -395,7 +393,7 @@ def _run_interface(self, runtime):
395393

396394
node_measures = compute_node_measures(ntwk, calculate_cliques)
397395
for key in node_measures.keys():
398-
newntwk = add_node_data(node_measures[key], self.inputs.in_file)
396+
newntwk = add_node_data(node_measures[key], ntwk)
399397
out_file = op.abspath(self._gen_outfilename(key, 'pck'))
400398
nx.write_gpickle(newntwk, out_file)
401399
nodentwks.append(out_file)
@@ -409,7 +407,7 @@ def _run_interface(self, runtime):
409407

410408
edge_measures = compute_edge_measures(ntwk)
411409
for key in edge_measures.keys():
412-
newntwk = add_edge_data(edge_measures[key], self.inputs.in_file)
410+
newntwk = add_edge_data(edge_measures[key], ntwk)
413411
out_file = op.abspath(self._gen_outfilename(key, 'pck'))
414412
nx.write_gpickle(newntwk, out_file)
415413
edgentwks.append(out_file)

0 commit comments

Comments
 (0)