Repository navigation
Make regionprops._slice a user-facing property - #2838
Conversation
|
Hello @jni! Thanks for updating the PR.
Comment last updated on May 22, 2018 at 07:05 Hours UTC |
ahojnnes
left a comment
There was a problem hiding this comment.
LGTM and seems to be a useful property.
| @@ -101,6 +102,7 @@ def __init__(self, slice, label, label_image, intensity_image, | |||
| self.label = label | |||
|
|
|||
| self._slice = slice | |||
There was a problem hiding this comment.
Shouldn't we remove _slice then?
There was a problem hiding this comment.
Also, isn't it confusing to use a reserved word here in several places?
There was a problem hiding this comment.
@stefanv I'm all ears for an alternative attribute name. Note that the slice in the __init__ is old, and annoying to deprecate. self.slice is not very confusing, though, only a little bit confusing.
@soupault even though ._slice is private, I'm concerned some of our users might have accessed it. So I thought we might as well keep it around, because it's not very costly to do so.
There was a problem hiding this comment.
@jni I see.
As for the name, maybe something like region_slice or slice_region?
There was a problem hiding this comment.
self.slice is probably OK. I'm more concerned with cases where the built-in gets clobbered. region_slice or slice_ work for me.
|
@jni Did you want to modify this further, or should we get it in? |
Currently, `_slice` is hidden from the user, even though it would be a useful property in many instances (for example, extracting objects from one channel based on the regionprops of another). In fact there was a discussion about this when we were talking about the bounding box property, but that went nowhere.
|
@stefanv I'm happy with it as-is. Rebased. |
Codecov Report
@@ Coverage Diff @@
## master #2838 +/- ##
==========================================
+ Coverage 85.91% 85.91% +<.01%
==========================================
Files 336 336
Lines 27305 27315 +10
==========================================
+ Hits 23459 23469 +10
Misses 3846 3846
Continue to review full report at Codecov.
|
Currently,
_sliceis hidden from the user, even though it would bea useful property in many instances (for example, extracting objects
from one channel based on the regionprops of another). In fact there
was a discussion about this when we were talking about the bounding box
property, but that went nowhere.
Checklist
[It's fine to submit PRs which are a work in progress! But before they are merged, all PRs should provide:]
Gallery example in./doc/examples(new features only)For reviewers
(Don't remove the checklist below.)
later.
__init__.py.doc/release/release_dev.rst.