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

No more overlapping points in griddata interpolation in create_warps.py #95

Merged
merged 8 commits into from
Aug 20, 2021

Conversation

jordandekraker
Copy link
Collaborator

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.

@jordandekraker jordandekraker requested a review from akhanf August 20, 2021 14:21
Copy link
Member

@akhanf akhanf left a 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

Copy link
Member

@akhanf akhanf left a 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

@jordandekraker
Copy link
Collaborator Author

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

@jordandekraker jordandekraker merged commit 096724d into master Aug 20, 2021
@jordandekraker jordandekraker deleted the create_warps_pointoverlap branch September 8, 2021 15:35
@akhanf akhanf added the bug Something isn't working label Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants