[Scipy-svn] r3930 - trunk/scipy/ndimage/tests

scipy-svn at scipy.org scipy-svn at scipy.org
Tue Feb 12 20:32:14 EST 2008


Author: tom.waite
Date: 2008-02-12 19:32:07 -0600 (Tue, 12 Feb 2008)
New Revision: 3930

Modified:
   trunk/scipy/ndimage/tests/test_segment.py
Log:
Assert test for boundary length and compactness of the aorta and ventricle

Modified: trunk/scipy/ndimage/tests/test_segment.py
===================================================================
--- trunk/scipy/ndimage/tests/test_segment.py	2008-02-13 00:11:57 UTC (rev 3929)
+++ trunk/scipy/ndimage/tests/test_segment.py	2008-02-13 01:32:07 UTC (rev 3930)
@@ -15,14 +15,28 @@
         get_shape_mask(edges, objects)
         get_voxel_measures(sourceImage, edges, objects)
         get_texture_measures(sourceImage, edges, objects)
+	# measure the compactness and object boundry length
+	# Ventricle measure
+	assert_almost_equal(objects[7]['compactness'], 0.25657323, 4)
+	assert_almost_equal(objects[7]['bLength'], 1215.70980000, 4)
+	# Aorta measure
+	assert_almost_equal(objects[13]['compactness'], 0.91137904, 4)
+	assert_almost_equal(objects[13]['bLength'], 198.338090000, 4)
 
     def test2(self):
         sourceImage, labeledMask, ROIList = segment_regions(filename)
+	# measure the compactness and object boundry length
+	# Ventricle measure
+	assert_almost_equal(ROIList[7]['compactness'], 0.25657323, 4)
+	assert_almost_equal(ROIList[7]['bLength'], 1215.70980000, 4)
+	# Aorta measure
+	assert_almost_equal(ROIList[13]['compactness'], 0.91137904, 4)
+	assert_almost_equal(ROIList[13]['bLength'], 198.338090000, 4)
 
     def test3(self):
         regionMask, numberRegions = grow_regions(filename)
-        regionMask.max()
-        #save_slice(regionMask, 'regionMask.raw')
+	number_of_regions = regionMask.max()
+	assert_equal(number_of_regions, 21)
 
     
 if __name__ == "__main__":




More information about the Scipy-svn mailing list