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

Explicity create and protect the background particle identity #262

Merged
merged 4 commits into from
Jun 15, 2020

Conversation

mdoube
Copy link
Member

@mdoube mdoube commented Jun 14, 2020

This PR fixes #261, which resulted from an implicit creation of the background particle ID (0) that was either not created, or created and then destroyed when there was no foreground particle in the zeroth image processing chunk.

when there were no particles in the zeroth chunk, the background element
was removed leading to an incorrect particle count (the background
particle is always present in the LUT and counts with ID = 0).
@mdoube
Copy link
Member Author

mdoube commented Jun 15, 2020

Merge this PR before #263

Copy link
Member

@alessandrofelder alessandrofelder left a comment

Choose a reason for hiding this comment

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

Can't say I completely understand the overall algorithm.
However, tests look reasonable and changes seem to be catching edge cases which I can see happening sometimes. So looks good to me.

@mdoube mdoube merged commit 8bd7bb7 into master Jun 15, 2020
@mdoube mdoube deleted the particle-bugs branch June 15, 2020 08:32
mdoube added a commit that referenced this pull request Apr 5, 2024
* Don't remove IDs from chunkMaps with zero length
* Fixes an NPE for images with some empty slices.
* Explicitly create and protect the background particle ID 0
* Add a test for ConnectedComponents.getNParticles()

Fixes #261

When there were no particles in the zeroth chunk, the background element
was removed leading to an incorrect particle count (the background
particle is always present in the LUT and counts with ID = 0).
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.

Particle Analyser throws lots of errors when there is only one particle at the end of the stack
2 participants