Merge pull request #688 from ahojnnes/regionprops-bugfix

Fix missing label property description and backwards compatibility of regionprops.
This commit is contained in:
Stefan van der Walt
2013-08-13 07:00:38 -07:00
2 changed files with 8 additions and 0 deletions
+3
View File
@@ -33,6 +33,7 @@ PROPS = {
'FilledImage': 'filled_image',
'HuMoments': 'hu_moments',
'Image': 'image',
'Label': 'label',
'MajorAxisLength': 'major_axis_length',
'MaxIntensity': 'max_intensity',
'MeanIntensity': 'mean_intensity',
@@ -386,6 +387,8 @@ def regionprops(label_image, properties=None,
Inertia tensor of the region for the rotation around its masss.
**inertia_tensor_eigvals** : tuple
The two eigen values of the inertia tensor in decreasing order.
**label** : int
The label in the labelled input image.
**major_axis_length** : float
The length of the major axis of the ellipse that has the same
normalized second central moments as the region.
@@ -149,6 +149,11 @@ def test_image():
assert_array_equal(img, SAMPLE)
def test_label():
label = regionprops(SAMPLE)[0].label
assert_array_equal(label, 1)
def test_filled_area():
area = regionprops(SAMPLE)[0].filled_area
assert area == np.sum(SAMPLE)