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

Fix off-by-one error in laplacian smoothing #23

Merged
merged 1 commit into from
Jun 23, 2020

Conversation

stuarteberg
Copy link
Member

This PR fixes an off-by-one error in laplacian_smoothing.cpp, which was caused by an unnecessary swap of the final results with the temporary arrays that are used for intermediate values.

The final round of smoothing was being computed, but then it was thrown out. So, previously, rounds=1 resulted in no smoothing at all, rounds=2 resulted in only 1 round, etc.

Since I happen to have a pandas-based implementation of laplacian_smoothing, I added it to the test suite as a reference implementation. I also corrected the reference mesh.


Side note: After fixing this, you may want to update this call in volumina, or your meshes will be slightly smoother than they were before. (Reduce it from 4 to 3)

…th a reference implementation of laplacian smoothing.

(Previously, rounds=1 resulted in no smoothing, rounds=2 resulted in only 1 round, etc.)
Copy link
Contributor

@k-dominik k-dominik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A double cross! Didn't see this coming ;)

Thank you very much for finding this one! Additional tests are also appreciated.

Hope you are doing great!

P.S.: looking into this CI issue on osx which is not related to the PR

@k-dominik k-dominik merged commit 12def75 into ilastik:master Jun 23, 2020
k-dominik added a commit to k-dominik/volumina that referenced this pull request Jun 23, 2020
Due to a bug (ilastik/marching_cubes#23) in the
marching cubes repo, smoothing rounds were off by one.
In order to retain consistent behavior we have to reduce the number of smoothing
rounds.
k-dominik added a commit to k-dominik/volumina that referenced this pull request Jun 23, 2020
Due to a bug (ilastik/marching_cubes#23) in the
marching cubes repo, smoothing rounds were off by one.
In order to retain consistent behavior we have to reduce the number of smoothing
rounds.

Co-Authored-By: Stuart Berg <[email protected]>
@stuarteberg
Copy link
Member Author

Thanks for merging, and for the new release.

Hope you are doing great!

Thanks, same to you. I'm doing well, all things considered. Working from home and taking care of a 1-year-old is not great for productivity, but I can't really complain.

k-dominik added a commit to ilastik/volumina that referenced this pull request Jul 23, 2020
Due to a bug (ilastik/marching_cubes#23) in the
marching cubes repo, smoothing rounds were off by one.
In order to retain consistent behavior we have to reduce the number of smoothing
rounds.

Co-Authored-By: Stuart Berg <[email protected]>
k-dominik added a commit to k-dominik/volumina that referenced this pull request Sep 28, 2020
Due to a bug (ilastik/marching_cubes#23) in the
marching cubes repo, smoothing rounds were off by one.
In order to retain consistent behavior we have to reduce the number of smoothing
rounds.

Co-Authored-By: Stuart Berg <[email protected]>
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