trim_nonpercolating_paths unit test addition
@@ -86,6 +86,7 @@ class FilterTest():
def test_find_disconnected_voxels_2d(self):
h = ps.filters.find_disconnected_voxels(self.im[:, :, 0])
assert sp.sum(h) == 477
+# print(sp.sum(h))
def test_find_disconnected_voxels_2d_conn4(self):
h = ps.filters.find_disconnected_voxels(self.im[:, :, 0], conn=4)
@@ -99,6 +100,31 @@ class FilterTest():
h = ps.filters.find_disconnected_voxels(self.im, conn=6)
assert sp.sum(h) == 202
+ def test_trim_nonpercolating_paths_2d_axis0(self):
+ h = ps.filters.trim_nonpercolating_paths(self.im[:, :, 0],inlet_axis=0,
+ outlet_axis=0)
+ assert sp.sum(h) == 5030
+
+ def test_trim_nonpercolating_paths_2d_axis1(self):
+ h = ps.filters.trim_nonpercolating_paths(self.im[:, :, 0],inlet_axis=1,
+ outlet_axis=1)
+ assert sp.sum(h) == 5185
+
+ def test_trim_nonpercolating_paths_3d_axis0(self):
+ h = ps.filters.trim_nonpercolating_paths(self.im,inlet_axis=0,
+ outlet_axis=0)
+ assert sp.sum(h) == 500283
+
+ def test_trim_nonpercolating_paths_3d_axis1(self):
+ h = ps.filters.trim_nonpercolating_paths(self.im,inlet_axis=1,
+ outlet_axis=1)
+ assert sp.sum(h) == 500402
+
+ def test_trim_nonpercolating_paths_3d_axis2(self):
+ h = ps.filters.trim_nonpercolating_paths(self.im,inlet_axis=2,
+ outlet_axis=2)
+ assert sp.sum(h) == 500413
+
def test_fill_blind_pores(self):
h = ps.filters.find_disconnected_voxels(self.im)
b = ps.filters.fill_blind_pores(h)
@@ -164,4 +190,9 @@ if __name__ == '__main__':
t.test_porosimetry()
t.test_porosimetry_npts_10()
t.test_porosimetry_with_sizes()
+ t.test_trim_nonpercolating_paths_2d_axis0()
+ t.test_trim_nonpercolating_paths_2d_axis1()
+ t.test_trim_nonpercolating_paths_3d_axis0()
+ t.test_trim_nonpercolating_paths_3d_axis1()
+ t.test_trim_nonpercolating_paths_3d_axis2()
self = t
