-
Notifications
You must be signed in to change notification settings - Fork 14
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
No more overlapping points in griddata interpolation in create_warps.py #95
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just had one question on defining the mask -- see line comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, feel free to merge this in
Closing with one comment that I'd like to address in #96 There are some NaNs in the create_warps.py resulting from the inability of griddata to extrapolate (see fc1d252). Currently the shortcut is to set them ==0, but this can create misplaced vertices in the final surfaces. I aim to fill those sensibly |
After spending a long time trying to get this step (and the next) to work on 3D PLI and BigBrain data at super high resolution, I realized the issue wasn't memory. I'll leave https://github.com/khanlab/hippunfold/tree/create_warps_resource_manage as is in case we need further memory management (in this case by downsampling) in the future.
The actual issue is outlined here:
https://stackoverflow.com/questions/10886971/alternatives-to-scipy-interpolate-griddata-that-dont-hang-on-aligned-points
The solution is to simply add a tiny bit of noise to the Laplace coords to ensure none of them are perfectly overlapping or perfectly aligned along any one dimension. I'm keeping some of the improvements and debugging from the downsampling code since this step still takes ~1h and its nice to check that it is indeed running.