Merge pull request #2030 from sdsingh/bbox

Document regionprops bbox property.
This commit is contained in:
Juan Nunez-Iglesias
2016-03-31 13:19:52 +11:00
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ sys.path.append(os.path.join(curpath, '..', 'ext'))
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.pngmath',
'sphinx.ext.imgmath',
'numpydoc',
'sphinx.ext.autosummary',
'plot2rst',
+6
View File
@@ -112,6 +112,12 @@ class _RegionProperties(object):
return np.sum(self.image)
def bbox(self):
"""
Returns
-------
A tuple of the bounding box's start coordinates for each dimension,
followed by the end coordinates for each dimension
"""
return tuple([self._slice[i].start for i in range(self._ndim)] +
[self._slice[i].stop for i in range(self._ndim)])