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

[bugfix] adjust calculatemoments code to properly use labels #228

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wllgrnt
Copy link

@wllgrnt wllgrnt commented Jan 4, 2024

Fixes #207 and #206.

  1. The function get_object_moment was not correct, since it failed to use the labels. What it was instead doing was getting a mask of all pixels in the array with the same numerical value, and then calculating the moments on those (which will definitionally be zero), rather than getting the mask for each label in turn. See the old calculatehistogram.py here for an example of how this function used to be implemented.
  2. The fix in the code was assumed to benp.fix, but it's supposed to be fixup_scipy_ndimage_result as fix (see elsewhere in the codebase).

Also ran black and flake8 on the file.

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.

CalculateMoments run error
1 participant