Skip to content

bas_nonneg=False when p=0 #1361

Open
Open
@wienecke

Description

@wienecke

Hi.

My setup:

  1. Operating System: MacOS
  2. Hardware type, RAM: M1 Pro, 16 GB
  3. Python Version: 3.11.8
  4. Caiman version: 1.10.5
  5. Which demo exhibits the problem (if applicable): N/A
  6. How you installed Caiman: Dev Mode install with Mamba

Thank you for the great code.

  • I use CNMF.fit, then CNMF.refit, to extract components from 2-photon GCaMP7f movies.

  • My neurons are non-spiking, so I skip deconvolution by setting p to 0.

  • The issue I'll describe occurs with method_init 'greedy_roi' and 'graph_nmf'.

  • My input movie is nonnegative. Negative values in the temporal components are introduced in line 214 of temporal.py, in function 'update_temporal_components', in this line:
    YrA = YA - AA.T.dot(Cin).T

  • Later, in line 124 of deconvolution.py, in function 'constrained_foopsi', those negative values are clipped to zero in this line:
    c = np.maximum(fluor, 0)

What is the meaning of the negative values after the first line? I don't understand why so much of the temporal component is getting clipped at the bottom. The clipped signal does not seem to be noise (I describe why in this post to the CaImAn Discussions forum: #1252)

I don't have this problem for spiking neurons because I make p nonzero, and in that case setting bas_nonneg to False prevents the clipping of meaningful signal. But making bas_nonneg False when p=0 seems to have no effect with respect to this issue.

Is it possible to make bas_nonneg=False have an effect when p=0? Or will that cause problems?

Thank you!
Carl

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