Distribution of unmasked


In [4]:
import numpy as np
import csv
import seaborn as sns
%matplotlib inline
import matplotlib.pyplot as plt

data = open('../data/data.csv', 'r').readlines()
fieldnames = ['x', 'y', 'z', 'unmasked', 'synapses']
reader = csv.reader(data)
reader.next()

rows = [[int(col) for col in row] for row in reader]

xs = []
ys = []
zs = []

sorted_x = sorted(list(set([r[0] for r in rows])))
sorted_y = sorted(list(set([r[1] for r in rows])))
sorted_z = sorted(list(set([r[2] for r in rows])))

vol = np.zeros((len(sorted_x), len(sorted_y), len(sorted_z)))
for r in rows:
    xs.append(r[0])
    ys.append(r[1])
    zs.append(r[2])
    vol[sorted_x.index(r[0]), sorted_y.index(r[1]), sorted_z.index(r[2])] = r[-1]

In [18]:
plt.hist([r[-2] for r in rows], bins=100)
plt.xlabel("Value of Unmasked")
plt.ylabel("Frequency")
plt.suptitle("Histogram of 'unmasked' Distribution (100 bins)", fontsize=16)


Out[18]:
<matplotlib.text.Text at 0x10ff499d0>

In [19]:
max(r[-2] for r in rows)


Out[19]:
165789

In [ ]: