-
Notifications
You must be signed in to change notification settings - Fork 8
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
Improved interpolations #15
Conversation
Co-authored-by: Phillip Alday <[email protected]>
…s.jl into yg/better-interpolation
@yakir12 can you add in a test for peaks not shifting away from their nominal location? Te example using four points near the boundary was a good one. |
Codecov Report
@@ Coverage Diff @@
## master #15 +/- ##
==========================================
+ Coverage 90.83% 95.00% +4.16%
==========================================
Files 4 4
Lines 120 120
==========================================
+ Hits 109 114 +5
+ Misses 11 6 -5
Continue to review full report at Codecov.
|
I'll keep this open in case you need it for now. |
another point to discuss: does this work also for other bounding geometries? e.g. if you have a weird polynomial, you might want to deactivate this functionality? Or should this even be "off" by default, and eeg_topoplot activates it? Answer: Just saw, that geometry should be just circle and box, did you check what happens in case of adding this to a box-type enclosure? Besides this: I think it is a clear improvement and should be merged. Integration with #12 will help debug this further |
Superseded by #20 |
This fixes the interpolation problems mentioned in #9.
The core of the problem is the introduction of zeros along the perimeter of the bounding geometry. Instead, the 4 corners of the bounding rectangle that contains all of the data (including the geometry) are added and set to
pad_value
(e.g. zero). When the geometry is a circle, this solves cases where a known data point is larger than zero AND close to the perimeter of the geometry. Because I refrain from setting the perimeter data to zero, using theDelaunayMesh
is completely impossible. We would need to be able to interpolate such a mesh for that to work. Ideally, JuliaMath/Interpolations.jl#118would be solved and we could simply use Julia's
Interpolations.jl
.This PR is quite aggressive, so I expect some pushback and appreciate any feedback you may have.