-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
allow passing extra measurement functions to regionprops and regionprops_table #4810
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
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
22a0720
seperate out test for empty properties
VolkerH 530e018
infer dtype for custom regionprop functions
VolkerH 1ade250
__getattr__ to handle extra_properties
VolkerH 54ecca0
handle both intensity and non-intensity cases
VolkerH 81e17da
added extra_properties to regionprops_table
VolkerH deefe82
small bug fix
VolkerH 915cdd6
fixed check for shadowed property names
VolkerH 84a51f2
fixed various small bugs
VolkerH 10681de
fix PEP8
VolkerH 7ca57d4
more PEP8
VolkerH 940581b
hopefully shutting up PEP8 this time
VolkerH 374032b
decreasing indent by one spave
VolkerH edbd824
removing another space for PEP8
VolkerH ed763ba
check for intensity img, raise AttributeError
VolkerH 639cec1
added tests for extra_properties
VolkerH 18f82ce
autopep8 -range on pep8speaks complaints
VolkerH 1b7dd6e
line length
VolkerH 78dea77
fixed preexisting docstring example bug
VolkerH 0adbabf
fixed bug and added an example for regionpros_table
VolkerH 7c106cc
added example for regionprops
VolkerH ed74a86
added test with multiple labels that catches previously corrected bug
VolkerH bac6264
autopep8 on --line-range with problems
VolkerH 952c3dd
more pep8 niggles addressed
VolkerH aa0c679
newline to end of file restored
VolkerH 2309d3e
Update skimage/measure/_regionprops.py
VolkerH e814531
Update skimage/measure/_regionprops.py
VolkerH 443e357
Update skimage/measure/_regionprops.py
VolkerH cec33ab
Update skimage/measure/_regionprops.py
VolkerH 58a0ed4
Update skimage/measure/_regionprops.py
VolkerH 9f69ca5
typo
VolkerH 3bbc718
explain which arguments need to be passed
VolkerH 9c10a75
Update skimage/measure/_regionprops.py
VolkerH ab0be5d
Update skimage/measure/_regionprops.py
VolkerH ba545ea
Correct doctest formatting in skimage/measure/_regionprops.py
jni b8b4919
Update skimage/measure/_regionprops.py
rfezzani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we dynamically edit
COL_DTYPES
to avoid the handling of dtype for extra properties in_props_to_dict
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rfezzani here we chose to preserve existing behaviour rather than try to improve it, which could have unintended consequences. I suggest leaving dynamic inference of existing properties for a future PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jni was faster than me. In general, I don't like modifying a global (in the namespace) state. That state change will persist in
COL_DTYPES
potentially leading to the "unintended consequences" that @jni mentioned.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggestion is not an improvement to existing behavior but the modification of the extra properties (new feature) dtype handeling ^^. Avoiding namespace variable modification is a good point, no problem ;)