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

[ENH] Update grid.plot to take multiple transforms #534

Merged
merged 54 commits into from
Mar 21, 2023

Conversation

lukeyoffe
Copy link
Contributor

@lukeyoffe lukeyoffe commented Mar 14, 2023

Description

When plotting cortical models, we often want to plot multiple regions (v1, v2, and v3), but this was not possible with the existing grid.plot function

  • Changed grid.plot to loop through all of the transforms in self.retinotopy rather than taking in a transform as an argument
  • Added a use_dva flag that defaults to False, but when set to True, will not apply any transforms to preserve the ability to plot in dva coordinates (rather than retinal/cortical coordinates)

Notebook
It's hard to write unit tests for plotting, so here is a notebook showing that plots look correct.
CortexPlotTester.pdf

Before / after notebooks for some other plots
Before
After

Closes #512

Type of Change

  • New feature (non-breaking change which adds functionality)

jgranley and others added 30 commits October 17, 2022 13:42
* add check for empty stimulus in stim setter for implants

* add check for empty np.ndarray
…l areas (pulse2percept#509)

* grid interface changes

* changed valueerror to runtime error in percept save test

* Fix unique time point bug

* temp commit to store grid stuff

* update requirements

* update base.py for new grid class

* Grid class now supports multiple layers

* refactor layer to be region

* Add region_mappings, RetinalMap

* Fixed overwriting static attributes

* Base class for cortical models

* [MNT] Update requirements.txt (pulse2percept#507)

* Add tests, made inv transforms optional to overwrite

* update with named tuple coordinate grids, and ret_to_dva etc
"

* refactor everything to ret_to_dva

* Update static ret2dva references

* removed backwards compatibility for ret2dva

* update doc
…ulse2percept#518)

* [MNT] Update requirements.txt (pulse2percept#507)

* [DOC] Fix gallery thumbnail images (pulse2percept#510)

* add topography module

* fix imports

* refactor tests for topography module

* doc

* add epmty submodules for implants.cortex and models.cortex
@codecov-commenter
Copy link

codecov-commenter commented Mar 14, 2023

Codecov Report

❗ No coverage uploaded for pull request base (cortex@40f882a). Click here to learn what that means.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff            @@
##             cortex     #534   +/-   ##
=========================================
  Coverage          ?   93.14%           
=========================================
  Files             ?      115           
  Lines             ?     9969           
  Branches          ?        0           
=========================================
  Hits              ?     9286           
  Misses            ?      683           
  Partials          ?        0           
Flag Coverage Δ
unittests 93.14% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@lukeyoffe lukeyoffe marked this pull request as draft March 14, 2023 20:25
Copy link
Member

@jgranley jgranley left a comment

Choose a reason for hiding this comment

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

Note of changes we talked about 3/14:

  • The default color of gray shouldn't change for unbuilt retinotopies, or for retinal models. I'm thinking it might just be easier to have a custom dict mapping regions to colors (i.e. 'ret' -> gray, 'v1' -> red, etc) and just grab a random color from one of the sequential colormaps if the region is unknown.
  • Replace __name__ with transform

@lukeyoffe lukeyoffe marked this pull request as ready for review March 18, 2023 03:12
@jgranley jgranley self-requested a review March 21, 2023 00:22
@jgranley jgranley merged commit 88eb591 into pulse2percept:cortex Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants