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

BUG: Fix slicing. More consistent with numpy #721

Merged
merged 1 commit into from
Oct 22, 2024
Merged

BUG: Fix slicing. More consistent with numpy #721

merged 1 commit into from
Oct 22, 2024

Conversation

cookpa
Copy link
Member

@cookpa cookpa commented Oct 22, 2024

Fixing slicing issues detailed in #719. The behavior of slicing should now be consistent with what you get on a numpy array, except that it returns an antsImage for slices with dimensions >= 2.

When slicing by indices, direction matrices are collapsed to identity. Users need to call the slice_image function to control that.

I added support for negative indices, so you can do something like im[:,:,0:-1] and it behaves as numpy does.

ENH: Support more indexing options
@coveralls
Copy link

Coverage Status

coverage: 85.341% (+0.003%) from 85.338%
when pulling b5380b4 on fix_slicing
into 88437eb on master.

@cookpa cookpa merged commit 6074d85 into master Oct 22, 2024
3 checks passed
@cookpa cookpa deleted the fix_slicing branch October 22, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants