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

[Bug]: Background Components are mixed up in CaimanSegmentationExtractor #249

Closed
2 tasks done
pauladkisson opened this issue Sep 21, 2023 · 3 comments · Fixed by #291
Closed
2 tasks done

[Bug]: Background Components are mixed up in CaimanSegmentationExtractor #249

pauladkisson opened this issue Sep 21, 2023 · 3 comments · Fixed by #291
Assignees
Labels
bug Something isn't working

Comments

@pauladkisson
Copy link
Member

pauladkisson commented Sep 21, 2023

Expected Behavior

According to the CaImAn docs, estimates.C refers to the 'temporal components', which should be stored as _roi_response_raw in the SegmentationExtractor and estimates.f refers to the 'temporal background components', which should be stored as _roi_response_neuropil in the SegmentationExtractor.

Current Behavior

Instead, in the CaimanSegmentationExtractor,

self._roi_response_neuropil = self._trace_extractor_read("C")

and estimates.f is ignored.

Code of Conduct

@pauladkisson pauladkisson added the bug Something isn't working label Sep 21, 2023
@EricThomson
Copy link

Hi Caiman maintainer here. I've started working on Caiman -> NWB integration, and improving our save_nwb() functionality as initially discussed here: flatironinstitute/CaImAn#1146

I think this problem happens only if you use our current old and wonky save nwb function, which we will deprecate soon.

The next iteration I am planning to just lean on neuronconv. I've been playing around with neuroconv today with the CNMF bits, and the conversion works fine as it just pulls in the denoised calcium traces in estimates.C, the deltaf/F in estimates.F_dff, and the the deconvolved traces (spike count estimates) in estimates.S. The numbers all line up fine.

So, I think you can safely close this issue as it isn't a problem on your end but a problem we were introducing into the world with our poorly designed nwb save function.

@pauladkisson
Copy link
Member Author

Good to hear from you @EricThomson! I just want to double check -- are you using the CnmfeSegmentationInterface or the CaimanSegmentationInterface? Bc I believe this issue is only for the caiman one.

@EricThomson
Copy link

Hi I'm using the CaimanSegmentationInterface, basically following the example here:
https://neuroconv.readthedocs.io/en/main/conversion_examples_gallery/segmentation/caiman.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants