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

Add numpy-based bilinear downsampling along X and Y #46

Open
wants to merge 2 commits into
base: integration
Choose a base branch
from

Conversation

j6k4m8
Copy link
Member

@j6k4m8 j6k4m8 commented Feb 15, 2021

!!!!! THIS IS COMPLETELY UNTESTED because I have no way to run this in the boss infra. The added code all works as it says on the label, but I don't know how it plays in its Boss context.

This reimplements the XY downsample as a numpy kernel convolution implementation of the bilinear downsample we're currently using, rather than converting to and then back from an image.

Additional Warnings, in case the first wasn't scary enough:

  • This ONLY downsamples down by a factor of 2. I think that's correct (we use data from res (n) to get to res (n+1), right?), but will BREAK if the volume and cube arguments are not the same z-size and if cube is not half of volume in X and Y.
  • I hand-wrote this kernel, so I think it's right but I might be mistook

Good things:

  • This works on any datatype, so we support u8/u16, and also any other datatype
  • Because we're not converting to/from an Image buffer, I think this actually saves us some time (?)

@j6k4m8 j6k4m8 changed the title Add numpy-baed bilinear downsampling along X and Y Add numpy-based bilinear downsampling along X and Y Feb 15, 2021
lambda/downsample_volume.py Outdated Show resolved Hide resolved
@sandyhider
Copy link
Member

I am not going to merge it until I test on my stack.

@j6k4m8 j6k4m8 marked this pull request as ready for review June 28, 2022 21:56
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