From 7377213fe785d6d9815bb529df9d6e9cf1aa4bb9 Mon Sep 17 00:00:00 2001 From: Ethan Blackwood Date: Thu, 14 Nov 2024 17:25:24 -0500 Subject: [PATCH] Include background component indices when removing empty/nan components --- caiman/source_extraction/cnmf/spatial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caiman/source_extraction/cnmf/spatial.py b/caiman/source_extraction/cnmf/spatial.py index 0ba5f2b4e..2f520d0ce 100644 --- a/caiman/source_extraction/cnmf/spatial.py +++ b/caiman/source_extraction/cnmf/spatial.py @@ -180,7 +180,7 @@ def update_spatial_components(Y, C=None, f=None, A_in=None, sn=None, dims=None, A_in = caiman.utils.stats.csc_column_remove(A_in, list(ff)) C = np.delete(C, list(ff), 0) # update indices - ind_list = list(range(nr-np.size(ff))) + ind_list = list(range(nr+nb-np.size(ff))) for i in ff: ind_list.insert(i, 0) ind_list = np.array(ind_list, dtype=int)