@@ -61,12 +61,12 @@ def distinguishable_colors(ncolors, backgrounds=[[0,0,0],[1,1,1]],
61
61
>>> verbose = False
62
62
>>> colors = distinguishable_colors(ncolors, backgrounds,
63
63
... save_csv, plot_colormap, verbose)
64
- >>> colors[0]
65
- array([ 0.62068966, 0.06896552, 1. ])
66
- >>> colors[1]
67
- array([ 0. , 0.5862069, 0. ])
68
- >>> colors[2]
69
- array([ 0.75862069, 0.20689655, 0. ])
64
+ >>> np.allclose( colors[0], [ 0.62068966, 0.06896552, 1. ])
65
+ True
66
+ >>> np.allclose( colors[1], [ 0. , 0.5862069, 0. ])
67
+ True
68
+ >>> np.allclose( colors[2], [ 0.75862069, 0.20689655, 0. ])
69
+ True
70
70
71
71
"""
72
72
import numpy as np
@@ -227,15 +227,17 @@ def label_adjacency_matrix(label_file, ignore_values=[-1, 999], add_value=0,
227
227
>>> label_file = fetch_data(urls['left_manual_labels'], '', '.vtk')
228
228
>>> labels, matrix, output_table = label_adjacency_matrix(label_file,
229
229
... ignore_values, add_value, save_table, output_format, verbose)
230
- >>> matrix.lookup([20,21,22,23,24,25,26,27,28,29],
230
+ >>> out = matrix.lookup([20,21,22,23,24,25,26,27,28,29],
231
231
... [35,35,35,35,35,35,35,35,35,35])
232
- array([ 0., 1., 0., 0., 0., 0., 0., 1., 1., 1.])
232
+ >>> np.allclose(out, [ 0., 1., 0., 0., 0., 0., 0., 1., 1., 1.])
233
+ True
233
234
234
235
>>> label_file = fetch_data(urls['freesurfer_labels'], '', '.nii.gz')
235
236
>>> labels, matrix, output_table = label_adjacency_matrix(label_file,
236
237
... ignore_values, add_value, save_table, output_format, verbose)
237
- >>> matrix.lookup([4,5,7,8,10,11,12,13,14,15], [4,4,4,4,4,4,4,4,4,4])
238
- array([ 1., 1., 0., 0., 0., 1., 0., 0., 1., 0.])
238
+ >>> out matrix.lookup([4,5,7,8,10,11,12,13,14,15], [4,4,4,4,4,4,4,4,4,4])
239
+ >>> np.allclose(out, [ 1., 1., 0., 0., 0., 1., 0., 0., 1., 0.])
240
+ True
239
241
240
242
"""
241
243
import numpy as np
0 commit comments