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

MPM binary_closing #142

Closed
amoodie opened this issue Jun 14, 2024 · 1 comment · Fixed by #143
Closed

MPM binary_closing #142

amoodie opened this issue Jun 14, 2024 · 1 comment · Fixed by #143
Labels
bug Something isn't working

Comments

@amoodie
Copy link
Member

amoodie commented Jun 14, 2024

I was messing around with the MPM because it was very slow on a large domain.

while (_changed != 0) and (_iter < 100):
_iter += 1
_newimg = morphology.binary_closing(img, footprint=disk)
_changed = np.sum(_newimg.astype(float) - img.astype(float))
_closed = _newimg

@elbeejay (sorry I think you wrote this bit) Am I correct in reading the lines here that the image input to binary dilation is not changed on each iteration? This seems like a bug?

@amoodie amoodie added the bug Something isn't working label Jun 14, 2024
@elbeejay
Copy link
Member

elbeejay commented Jun 14, 2024

Yes, looking with fresh eyes it does seem like this loop will never resolve short of hitting the iteration limit. But given that we iterate through the disk sizes in the public function, I'm struggling to remember why iterations here were ever needed wanted - seems like it'd be simpler to just call the binary closing function once and be done (in which case why use a private function at all).

@amoodie amoodie linked a pull request Jun 14, 2024 that will close this issue
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 a pull request may close this issue.

2 participants