Skip to content
New issue

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

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

Already on GitHub? # to your account

More cnmf stuff #28

Merged
merged 36 commits into from
Nov 1, 2023
Merged

More cnmf stuff #28

merged 36 commits into from
Nov 1, 2023

Conversation

kushalkolar
Copy link
Owner

No description provided.

@kushalkolar
Copy link
Owner Author

Ideas:

  • Put each gridplot in an accordian widget so they can be minized if desired

Current issues:

  • Some infinite recursion issue when clicking components or using slider, should be easy to fix. But moving the heatmap works to select components.
  • Heatmap y-axis component selector acts weird (too fast) when changing row.
  • Other weird stuff when changing row
mesviz-sep-2023-09-18_05.44.23.mp4

@kushalkolar
Copy link
Owner Author

button to zscore or 0-1 normalize heatmaps and temporals

@kushalkolar
Copy link
Owner Author

kushalkolar commented Oct 13, 2023

  • changing CNMF items seems to work fine

TODO:

  • click events on spatial contours is causing infinite recursion and is very slow, even before changing cnmf items
  • checkbox to have auto-zoom into spatial component when it is selected from the heatmap.
  • switch CNMF to just using ImageWidget if the data requested for a given gridplot are all image-type. Do not allow a mix of image and temporal data within the same gridplot. This is too complicated now, especially since everything now works with contours and all the events etc. The only thing we loose from ImageWidget at this point is vmin-vmax setters, which will come from fpl vmin-vmax histogram widget eventually, and the mean windows functions which could be implemented within the CNMFVizContainer
  • color components in diff ways
  • use this type of DummyMovie to display 2D images and movies within the same ImageWidget for both mcorr and CNMF
    class DummyMovie:
        def __init__(self, image: np.ndarray, shape, ndim, size):
            self.image = image
            self.shape = shape
            self.ndim = ndim
            self.size = size
            
        def __getitem__(self, index: int):
            return self.image

@kushalkolar
Copy link
Owner Author

Component eval would be nice to add to here but I will do that later.

@kushalkolar
Copy link
Owner Author

Current state:

mesviz_epic-2023-10-14_02.53.48.mp4

@EricThomson note that it's a bit slower because I was recording and encoding at 4k while using this.

@kushalkolar kushalkolar requested a review from clewis7 October 14, 2023 07:09
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not yet implemented, will do in a future PR

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to delete this later, we will let pynapple take care of this :D

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to remove this because of ImageWidget.set_data()

@kushalkolar
Copy link
Owner Author

One more easy todo:

  • gsig filt viz for mcorr, use a checkbox to enable it.

@kushalkolar
Copy link
Owner Author

I'm just going to enforce this layout for CNMF:
temporal & heatmap on the left, gridplot of any combo of images on the right

@kushalkolar
Copy link
Owner Author

kushalkolar commented Oct 27, 2023

Since I have decided to contrain the CNMF viz to be temporal & heatmap + images, I should just switch to using ImageWidget because it will handle all of this automatically: fastplotlib/fastplotlib#344

We can still allow some customization:

  • choosing to postprocessing temporal and heatmap (zscore etc.)
  • choosing which images to show

Eval UI can then just be placed below everything.

@kushalkolar kushalkolar marked this pull request as ready for review November 1, 2023 11:04
@kushalkolar
Copy link
Owner Author

alright, the beta is basically done. Works in notebook and Qt via %gui qt. Dataframe and UI is shown in notebook regardless because heavy Qt UI is tedious

https://www.youtube.com/watch?v=GWvaEeqA1hw

Final result is:

mcorr

ImageWidget that displays any selection of image-sequences (input, mcorr) and images (mean, corr etc.).

CNMF

This offers a lot

Displays single temporal component, heatmap, and a selection o image-sequences or images (just like mcorr).

Features:

  • Color contours based on quality metrics, or accepted/rejected.
  • View only accepted or rejected components, all components, or all with transparency on accepted or rejected.
  • Interactive component evaluation with sliders/int spinbox to set quality params and then view the result immediately using the contour color option that is set.
  • Manually accept or reject a component using "a" and "r" keys.
  • Zoom into components automatically while using the slider or heatmap selector to move through components
  • Displays the quality metric values for the currently selected component
  • Save the new component indices after evaluation with quality metrics and manual selection

@kushalkolar kushalkolar merged commit 8ab5a70 into master Nov 1, 2023
@kushalkolar kushalkolar mentioned this pull request Nov 4, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant