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

[MRG] ENH: Refactor dipole visualization to invert y-axis when min_freq > max_freq #903

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

samadpls
Copy link
Contributor

Added support for reversed y-axis in plot_tfr_morlet to allow min_freq > max_freq
Fixes #898

@samadpls samadpls force-pushed the fix/y-axis-flip branch 4 times, most recently from 44eabf0 to dca5a42 Compare October 25, 2024 13:49
@samadpls
Copy link
Contributor Author

@gtdang, should I update whats_new.rst for these changes?

@gtdang
Copy link
Collaborator

gtdang commented Oct 25, 2024

Yes, please do. Thanks!

@samadpls
Copy link
Contributor Author

samadpls commented Oct 29, 2024

Thanks! I have updated the what's new file. @asoplata , I appreciate your review on the pull request.

@asoplata
Copy link
Collaborator

Apologies for the radio silence, @samadpls . We've been in emergency hotfix & feature development for several weeks due to needing updates to use in-class and elsewhere, but that should be over now. I have a personal TODO to review all of your PRs / etc. asap :). Inspecting this one now.

@asoplata
Copy link
Collaborator

Unfortunately there is an issue preventing this from working fully on the spectrogram display in the GUI (note that to see the spectrogram on the GUI for the default simulation at all, you have to apply #938 ). In the GUI, if you run the default simulation and generate a default spectrogram, everything works correctly. However, if I change the min and max frequencies such that min > max, no spectrogram is displayed. Simple changes to freqs here https://github.com/jonescompneurolab/hnn-core/blob/master/hnn_core/gui/_viz_manager.py#L304 aren't enough to fix the problem. Will try to investigate more tomorrow.

@asoplata asoplata added the hnn-gui HNN GUI label Nov 15, 2024
@samadpls samadpls force-pushed the fix/y-axis-flip branch 2 times, most recently from 545b6dc to 81ea8f6 Compare January 23, 2025 18:09
@samadpls
Copy link
Contributor Author

Hi @asoplata, I tested the logic with a simple script and generated the following images:

  1. Normal Frequency Range (min_f = 10, max_f = 50):
  2. Inverted Frequency Range (min_f = 50, max_f = 10):
    image
    Let me know if further integration or tests are needed.

@samadpls samadpls force-pushed the fix/y-axis-flip branch 3 times, most recently from dcd2c69 to 23812e8 Compare January 27, 2025 20:46
@asoplata
Copy link
Collaborator

asoplata commented Feb 5, 2025

Hello @samadpls , I pushed a commit to your branch that fixes the issues with the spectrogram frequency inversion working on the GUI, along with tests of that same thing (make sure you pull my new commit to your branch if you plan to do more work on the branch). I believe this PR is now ready for merge.

@asoplata
Copy link
Collaborator

asoplata commented Feb 5, 2025

Since I added a commit, I will not merge this myself, and instead rely on someone else to do code review like @ntolley or @dylansdaniels

@asoplata asoplata changed the title [ENH] Refactor dipole visualization to invert y-axis when min_freq > max_freq [MRG] ENH: Refactor dipole visualization to invert y-axis when min_freq > max_freq Feb 5, 2025
hnn_core/gui/_viz_manager.py Outdated Show resolved Hide resolved
@asoplata asoplata changed the title [MRG] ENH: Refactor dipole visualization to invert y-axis when min_freq > max_freq [WIP] ENH: Refactor dipole visualization to invert y-axis when min_freq > max_freq Feb 6, 2025
@asoplata
Copy link
Collaborator

asoplata commented Feb 6, 2025

Hey @samadpls are you done making changes?

@samadpls
Copy link
Contributor Author

samadpls commented Feb 6, 2025

Hey @samadpls are you done making changes?

Yes, all set!

@asoplata asoplata changed the title [WIP] ENH: Refactor dipole visualization to invert y-axis when min_freq > max_freq [MRG] ENH: Refactor dipole visualization to invert y-axis when min_freq > max_freq Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hnn-gui HNN GUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow reversed y-axis on spectrogram plots
3 participants