Skip to content

Commit

Permalink
Make computing_indicator work with sparse A_in
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanbb committed Aug 26, 2024
1 parent 1b86d1a commit d6e8310
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions caiman/source_extraction/cnmf/spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -1063,8 +1063,15 @@ def computing_indicator(Y, A_in, b, C, f, nb, method, dims, min_size, max_size,
Y) - dist_indicator_av.T.dot(b).dot(f), 0)
A_in = scipy.sparse.coo_matrix(A_in.astype(np.float32))
nr, _ = np.shape(C) # number of neurons
ind2_ = [np.hstack((np.where(iid_)[0], nr + np.arange(f.shape[0])))
if np.size(np.where(iid_)[0]) > 0 else [] for iid_ in dist_indicator]
ind2_ = []
for iid_ in dist_indicator:
if scipy.sparse.issparse(iid_):
iid_ = iid_.toarray().squeeze()
comps = np.where(iid_)[0]
if np.size(comps) > 0:
ind2_.append(np.hstack((comps, nr + np.arange(f.shape[0]))))
else:
ind2_.append([])

else:
if C is None:
Expand Down

0 comments on commit d6e8310

Please sign in to comment.