Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bas_nonneg=False when p=0 #1361

Open
wienecke opened this issue Jun 10, 2024 · 0 comments
Open

bas_nonneg=False when p=0 #1361

wienecke opened this issue Jun 10, 2024 · 0 comments

Comments

@wienecke
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant