Repository navigation
Fix morphology.flood for F-ordered images - #4556
Merged
Merged
Conversation
Add missing "order" parameters and introduce the same parameter to _fast_pad. Previously flood wouldn't work with f-orderded images.
sciunto
reviewed
Apr 5, 2020
Co-Authored-By: François Boulogne <[email protected]>
Member
Author
|
Thanks for the quick reviews and suggestions. |
lagru
added a commit
to lagru/scikit-image
that referenced
this pull request
Apr 8, 2020
_fast_pad was changed on master in e58cead while it was moved on this branch.
rfezzani
pushed a commit
that referenced
this pull request
Apr 9, 2020
* Move shared nd-utility functions into _util module
* Simplify/tweak helper functions in morphology._util
Simplify construction of indices, use consistent name for structuring
element (selem), some reformatting and improve documentation.
* Support raveled offsets for dimensions smaller selem
The old implementation would raise a ValueError if a dimension length
given in `image_shape` was smaller than in `selem`. This precluded
operations on images e.g. with the shape (2, 100).
* Address unintended reorering by np.unique
* Check dimensions _offsets_to_raveled_neighbors
* Enhance docstrings and examples
which may act as lightweight tests.
* Add test for _offsets_to_raveled_neighbors
* Add explicit _offsets_to_raveled_neighbors tests
The explicit tests are meant to catch subtle changes in the order of
neigbors with the same connectivity. They were reviewed by constructing
an image of the given shape and filling in the raveled image around the
image center and manual inspection of the result. E.g. with
image = np.zeros(image_shape)
image_raveled = image.ravel()
image_center = tuple(s // 2 for s in image_shape)
image_center_raveled = np.ravel_multi_index(
image_center, image_shape
)
for i, offset in enumerate(offsets):
index = image_center_raveled + offset
assert image_raveled[index] == 0
image_raveled[index] += i + 1
* Remove morphology._fast_pad once NumPy >= 1.17
* Add tweaks on morphology._util and testing
* Rename to _set_border_values
"edge" may be associated with "edge filters" while "border" is used
throughout the library already.
* Flatten test suite in test_util
* Manually port changes to _fast_pad from #4556
_fast_pad was changed on master in
e58cead
while it was moved on this branch.
* Improve formatting and error messages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #4549. Previously flood wouldn't work with f-orderded images. This add's missing "order" parameters to
floodand introduces the same parameter to_fast_pad.For reviewers
later.
__init__.py.doc/release/release_dev.rst.@meeseeksdev backport to v0.14.x