Skip to content

Fix computation of histogram bins for multichannel integer-valued images - #6413

Merged
jni merged 3 commits into
scikit-image:mainfrom
grlee77:histogram-bincount-fix
Jun 11, 2022
Merged

jni merged 3 commits into
scikit-image:mainfrom
grlee77:histogram-bincount-fix

Conversation

@grlee77

@grlee77 grlee77 commented Jun 10, 2022

Copy link
Copy Markdown
Contributor

Description

closes #6412

When calling np.bincount, we need to make sure the minimum bin is always zero, otherwise there can be a size mismatch across channels as encountered in #6412. A small test case for this was added to verify the fix.

Checklist

  • Docstrings for all functions
  • Gallery example in ./doc/examples (new features only)
  • Benchmark in ./benchmarks, if your changes aren't covered by an
    existing benchmark
  • Unit tests
  • Clean style in the spirit of PEP8
  • Descriptive commit messages (see below)

For reviewers

  • Check that the PR title is short, concise, and will make sense 1 year
    later.
  • Check that new functions are imported in corresponding __init__.py.
  • Check that new features, API changes, and deprecations are mentioned in
    doc/release/release_dev.rst.
  • There is a bot to help automate backporting a PR to an older branch. For
    example, to backport to v0.19.x after merging, add the following in a PR
    comment: @meeseeksdev backport to v0.19.x
  • To run benchmarks on a PR, add the run-benchmark label. To rerun, the label
    can be removed and then added again. The benchmark output can be checked in
    the "Actions" tab.

@grlee77 grlee77 added the 🩹 type: Bug fix Fixes unexpected or incorrect behavior label Jun 10, 2022
@grlee77 grlee77 added this to the 0.19.3 milestone Jun 10, 2022
@pep8speaks

pep8speaks commented Jun 10, 2022 •

Copy link
Copy Markdown

Hello @grlee77! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-06-10 21:28:47 UTC

@grlee77

grlee77 commented Jun 11, 2022

Copy link
Copy Markdown
Contributor Author

@meeseeksdev backport to v0.19.x

meeseeksmachine pushed a commit to meeseeksmachine/scikit-image that referenced this pull request Jun 11, 2022
@grlee77 grlee77 changed the title Fix computation of common bins for multichannel integer-valued images Fix computation of histogram bins for multichannel integer-valued images Jun 11, 2022
@jni
jni merged commit ba2f9dc into scikit-image:main Jun 11, 2022
jni pushed a commit that referenced this pull request Jun 11, 2022
…s for multichannel integer-valued images) (#6414)

Co-authored-by: Gregory Lee <grlee77@gmail.com>
grlee77 added a commit to grlee77/cucim that referenced this pull request Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🩹 type: Bug fix Fixes unexpected or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

channel_axis argument in exposure.histogram does not always work

3 participants