Skip to content

An Issue About ind2_ Processing in Function computing_indicator() #1539

@zyyk78

Description

@zyyk78

Function computing_indicator() in caiman/source_extraction/cnmf/spatial.py
ind2_ forget to remove background components with A_in.dtype == bool in line 1030

1030          ind2_ = [np.hstack((np.where(iid_)[0], nr + np.arange(f.shape[0])))      
1031                   if np.size(np.where(iid_)[0]) > 0 else [] for iid_ in dist_indicator]   

here ind2_ didn't remove iid>=nr , but

1047        ind2_ = [np.where(iid_.squeeze())[0]  for iid_ in dist_indicator.astype(bool).toarray()]         
1048        ind2_ = [iid_ if (np.size(iid_) > 0) and (np.min(iid_) < nr) else [] for iid_ in ind2_]  

here removed them while A_in is not bool
this may cause some bugs in function update_spatial_components() while using seeded CNMFE (with imported Ain)
in line 163 ind2_ = [ind_list[np.setdiff1d(a,ff)] if len(a) else a for a in ind2_]

I added ind2_ = [iid_[iid_ < nr] if len(iid_) > 0 else [] for iid_ in ind2_] after line 1031 for fixing it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions