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

Refactor target placement #101

Merged
merged 14 commits into from
Sep 6, 2023
Merged

Refactor target placement #101

merged 14 commits into from
Sep 6, 2023

Conversation

JorisVincent
Copy link
Contributor

Adds more general-purpose functions mask_targets() and place_targets() which can be used to designate target "elements" (bars, rings, frames, etc.) from an existing mask.

This has been integrated into waves, pinwheels, rings and whites, and been used to add rings.circular_generalized() and bullseye.circular_generalized().

This single-implementation of target placement has the advantage that it all works the same: first element is 1, target_indices can be negative (counting "backwards" from the last bar/ring/etc.).

To implement this, some of the public-facing API has to change, as indicated by the fact that the papers have to be updated. Thus, this technically constitutes a "breaking" change that would require a major version bump....

@JorisVincent
Copy link
Contributor Author

One consideration: should mask_targets() and place_targets() be in stimupy.stimuli.? We also have a stimupy.utils.masks.-module, where these could also go. Currently that module mostly deals with using masks to get information out of images (mostly actually for BRENCH stuff)...

Copy link
Contributor

@LynnSchmittwilken LynnSchmittwilken left a comment

Choose a reason for hiding this comment

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

Everything looks good, but there are some non-PR-related issues in the demos (see issue #102 ). Also not all style-checks pass because bare except statements are used.

@JorisVincent JorisVincent self-assigned this Sep 6, 2023
@JorisVincent JorisVincent added the enhancement New feature or request label Sep 6, 2023
@JorisVincent JorisVincent merged commit 885ec6c into dev Sep 6, 2023
8 checks passed
@JorisVincent JorisVincent deleted the refactor_targets branch September 6, 2023 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

All stimuli. should return target_mask Unify _mask indexing as NumPy-style indexing
2 participants