In [20]:
import analysis3 as a3
reload(a3)


Out[20]:
<module 'analysis3' from 'analysis3.py'>

In [4]:
token = 's275_to_ara3'
cert_path = '../userToken.pem'

In [5]:
a3.get_registered(token, cert_path);


Getting registered brain from server...
Saving local copy of registered brain...

In [6]:
path = "img/" + token + "_regis.nii"
im = a3.apply_clahe(path);


Completed CLAHE!

In [7]:
output_ds = a3.downsample(im, num_points=10000);
a3.save_points(output_ds, "points/" + token + ".csv")


620.892
(This will take couple minutes)
Above threshold=175577389
total points: 175577389
v.shape:
(175577389,)
v.size before downsample: 175577389
v.size after downsample: 9926
Output num points: 9926
Finished

In [10]:
points_path = "points/" + token + ".csv";

In [11]:
a3.generate_pointcloud(points_path, "output/" + token + "_pointcloud.html");

In [12]:
a3.get_atlas_annotate(cert_path, save=True);

In [13]:
a3.get_regions(points_path, "atlas/ara3_annotation.nii", "points/" + token + "_regions.csv");


num unique regions: 407
[0, 1, 2, 4, 6, 9, 10, 12, 15, 17, 19, 23, 26, 27, 33, 36, 38, 42, 50, 56, 59, 62, 63, 64, 67, 68, 72, 73, 74, 81, 84, 88, 100, 105, 113, 117, 118, 120, 121, 122, 125, 126, 127, 128, 129, 131, 132, 133, 140, 146, 148, 149, 155, 156, 158, 159, 163, 170, 171, 173, 178, 180, 181, 186, 187, 188, 189, 190, 194, 196, 201, 204, 206, 210, 211, 214, 215, 218, 226, 233, 243, 246, 250, 252, 255, 257, 258, 260, 262, 263, 266, 271, 272, 274, 278, 286, 288, 289, 292, 296, 298, 301, 303, 304, 305, 310, 311, 313, 314, 319, 320, 321, 325, 326, 328, 330, 333, 335, 338, 341, 342, 344, 347, 351, 362, 363, 364, 366, 368, 374, 377, 381, 382, 390, 397, 403, 412, 414, 421, 422, 423, 430, 433, 436, 440, 443, 448, 449, 450, 451, 452, 461, 463, 10704, 466, 469, 470, 475, 477, 478, 482, 483, 484, 491, 494, 502, 503, 507, 510, 511, 515, 520, 523, 525, 530, 531, 536, 542, 549, 556, 558, 564, 565, 566, 573, 574, 575, 577, 580, 581, 582, 583, 587, 588, 589, 590, 591, 593, 595, 596, 598, 599, 600, 601, 603, 609, 610, 611, 612, 613, 614, 616, 620, 621, 622, 625, 628, 629, 630, 632, 634, 638, 639, 642, 647, 648, 654, 656, 657, 658, 662, 665, 667, 672, 673, 675, 678, 679, 681, 685, 687, 690, 692, 693, 694, 697, 698, 702, 703, 704, 706, 707, 718, 721, 729, 10703, 733, 741, 749, 754, 763, 767, 771, 772, 776, 778, 780, 783, 784, 788, 795, 797, 800, 802, 803, 804, 806, 810, 814, 819, 821, 827, 830, 831, 838, 841, 842, 843, 844, 848, 851, 854, 857, 862, 863, 867, 872, 873, 874, 877, 878, 882, 884, 889, 893, 897, 900, 902, 905, 906, 907, 908, 910, 918, 919, 924, 182305693, 926, 927, 182305697, 930, 931, 182305701, 934, 935, 182305705, 940, 182305709, 943, 945, 946, 950, 952, 954, 961, 962, 966, 969, 973, 974, 975, 977, 981, 982, 985, 988, 996, 998, 1004, 1005, 1009, 1010, 1015, 1016, 1020, 1021, 1022, 1026, 1029, 1031, 1035, 1037, 1038, 1045, 1046, 1047, 1052, 1054, 1058, 1060, 1061, 1062, 1070, 1074, 1081, 1084, 1085, 1089, 1090, 1092, 1094, 1097, 1101, 1102, 1105, 1106, 1109, 1111, 1114, 1120, 1125, 1128, 1139, 929, 182305713, 312782562, 312782582, 312782586, 312782590, 312782594, 312782608, 312782612, 312782616, 312782624, 312782632, 312782644, 312782648]
analysis3.py:461: VisibleDeprecationWarning:

using a non-integer number instead of an integer will result in an error in the future


In [15]:
points_region_path = "points/" + token + "_regions.csv";
g = a3.create_graph(points_region_path, output_filename="graphml/" + token + "_graph.graphml");


finished creating graph, now about to save to graphml.

In [18]:
a3.plot_graphml3d(g, output_path="output/" + token + "_edgegraph.html");

In [21]:
a3.generate_region_graph(token, points_region_path, output_path="output/" + token + "_regions.html");


Total number of unique ID's:
340
Done counting!

In [22]:
a3.generate_density_graph(graph_path="graphml/" + token + "_graph.graphml", output_path="output/" + token + "_density.html", plot_title="False-Color Density of " + token);

In [23]:
print("Completed pipeline...!")


Completed pipeline...!

In [25]:
import SimpleITK as sitk

In [26]:
test = sitk.ReadImage('img/s275_to_ara3_regis.nii')

In [28]:
test.GetSpacing()


Out[28]:
(0.009999999776482582, 0.009999999776482582, 0.009999999776482582)

In [ ]: