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] Add methods to initialize an EnsembleImplant from a list of coordinates #601

Merged
merged 3 commits into from
Jan 26, 2024

Conversation

tallyhawley
Copy link
Member

@tallyhawley tallyhawley commented Jan 25, 2024

Description

Adds two methods to initialize an EnsembleImplant from a set of coordinates. This should generally match the format of Neuralink.from_neuropythy().

EnsembleImplant.from_coords() allows the user to pass an implant type (must subclass ProsthesisSystem) & a set of locations on the cortex/retina (in µm), or an xrange/yrange/xystep in µm. We then automatically create a set of implants of the given type at the desired locations.

EnsembleImplant.from_cortical_map() takes the same parameters as from_coords() in addition to a vfmap (must be a CorticalMap instance and implement from_dva()) and region (defaults to v1). Locations/coordinates are passed to this function in dva, and internally converted to µm (in the given region).

Possible expansion: from_retinal_map(). Not implemented currently due to lack of use-cases as retinal implants are generally stand-alone. Would take an eye parameter instead of region?

Type of Change

Please delete options that are not relevant.

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

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link

codecov bot commented Jan 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (cortex@e824044). Click here to learn what that means.

Additional details and impacted files
@@            Coverage Diff            @@
##             cortex     #601   +/-   ##
=========================================
  Coverage          ?   92.17%           
=========================================
  Files             ?      128           
  Lines             ?    11358           
  Branches          ?        0           
=========================================
  Hits              ?    10469           
  Misses            ?      889           
  Partials          ?        0           
Flag Coverage Δ
unittests 92.17% <0.00%> (?)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tallyhawley tallyhawley changed the title [ENH] Add a method to initialize an EnsembleImplant from a list of coordinates [ENH] Add methods to initialize an EnsembleImplant from a list of coordinates Jan 26, 2024
@jgranley
Copy link
Member

Looks great!

@jgranley jgranley merged commit ebb1d33 into pulse2percept:cortex Jan 26, 2024
22 checks passed
@jgranley jgranley mentioned this pull request Jan 26, 2024
7 tasks
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

2 participants