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

Reset button on top row does not work on filter #11

Open
mycarta opened this issue Apr 26, 2021 · 8 comments
Open

Reset button on top row does not work on filter #11

mycarta opened this issue Apr 26, 2021 · 8 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mycarta
Copy link
Owner

mycarta commented Apr 26, 2021

Recording below shows Reset only working for the FFT spectrum plot, not the filter

ezgif com-video-to-gif

@mycarta mycarta added the bug Something isn't working label Apr 26, 2021
@WesleyTheGeolien
Copy link
Collaborator

WesleyTheGeolien commented Apr 26, 2021

Hmm I don't think we got the full screen grab @mycarta ....

But I think I know what you are talking about.

The reset button is a bokeh button is resets the zoom and any selections made.

When we make a selection on the spectrum plot the selected expression triggers a callback which detects which cells are selected applies the gaussian filter and "burns" them onto the filter.

For a reset there are two possibilities:

Find out how to override the bokeh reset (not sure how good an idea this is because what happens in the use case that you actually want to reset your zoom and not your plots?)
Write a custom reset this can also have undo and redo tools something like this ⬇️

116037833-ef81c180-a668-11eb-94fb-7e447f32b97b-2

@mycarta
Copy link
Owner Author

mycarta commented Apr 26, 2021

Hmm I don't think we got the full screen grab @mycarta ....

OOOPS
THanks @WesleyTheGeolien , I replaced it now with the full screen grab

@WesleyTheGeolien
Copy link
Collaborator

Do you have an opinion on how this should work @mycarta

@mycarta
Copy link
Owner Author

mycarta commented Apr 28, 2021

Do you have an opinion on how this should work @mycarta

Yes @WesleyTheGeolien :
I think your idea of a custom reset is good because I agree it would be desirable for users to reset their filter while not resetting the zoom.

@mycarta mycarta added enhancement New feature or request and removed bug Something isn't working labels Apr 28, 2021
@WesleyTheGeolien WesleyTheGeolien added the good first issue Good for newcomers label Apr 29, 2021
@WesleyTheGeolien
Copy link
Collaborator

Ok so I think there is a couple of steps that needs to be done then:

Version 1:

  • Just completely clear the filter and reset it to 0s everywhere

Version 2 (undo redo):

  • Store which values have been selected each time
  • Calculate the reverse of the Gaussian filter → This is probably better than setting to 0 because currently we can select the same place multiple time which means the filter gets stronger?

@leocd91
Copy link
Collaborator

leocd91 commented Apr 30, 2021

image
Trying to take a grasp how panel works.. Added the file selection and resetting the filter but still not functioning as intended yet..

@leocd91
Copy link
Collaborator

leocd91 commented May 2, 2021

So, I did the Version 1 @WesleyTheGeolien here: https://github.com/mycarta/t21-hack-footprint/tree/panel_fix/
This is my first time using panel, so sorry if the code is messy.

added:

  • file selection, automatically list .npy available on ./image_and_data/, added a load button because the select's @pn.depends("select_file.value") don't work.
  • reset button, version 1 (zero'd the filter)

fix:

  • save button, need to add output.seek(0) so the downloaded file won't be empty.

tweaks:

  • plotting difference plot clim

@WesleyTheGeolien
Copy link
Collaborator

@leocd91 we can maybe open a PR to discuss changes I am pretty sure I have seen implementations of the changing values working lets discuss that there otherwise looking great :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants