Skip to content

Commit

Permalink
Use toarray to avoid using numpy.matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
jni committed Jun 24, 2019
1 parent 984f86b commit 7a88173
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion microscopium/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def fraction_positive(bin_im, positive_im, erode=2, overlap_thresh=0.9,
lab_im = nd.label(bin_im)[0].ravel()
pos_im = positive_im.ravel().astype(int)
counts = sparse.coo_matrix((np.ones(lab_im.size),
(lab_im, pos_im))).todense()
(lab_im, pos_im))).toarray()
means = counts[:, 1] / np.sum(counts, axis=1)
f = np.array([np.mean(means[1:] > overlap_thresh)])
name = ['frac-%s-pos-%s-erode-%i-thresh-%.2f' %
Expand Down

0 comments on commit 7a88173

Please sign in to comment.