updating tests to work with new imgens
@@ -9,10 +9,10 @@ from skimage.morphology import disk, ball, skeletonize_3d, square
class IBIPTest():
def setup_class(self):
- im = ps.generators.lattice_spheres(shape=[107, 107],
- radius=5, offset=9,
- lattice='tri')
- self.im = im[5:102, 5:102]
+ np.random.seed(0)
+ self.im = ps.generators.lattice_spheres(shape=[101, 101],
+ radius=5, spacing=25,
+ offset=[5, 5], lattice='tri')
bd = np.zeros_like(self.im)
bd[:, 0] = True
self.bd = bd
@@ -28,18 +28,18 @@ class IBIPTest():
def test_ibip(self):
inv = ps.filters.ibip(self.im, inlets=self.bd)
- assert inv.max() == 119
+ assert inv.max() == 318
def test_ibip_w_trapping(self):
im = self.sc_lattice_with_trapped_region()
inv = ps.filters.ibip(im, inlets=self.bd)
- assert inv.max() == 153
+ assert inv.max() == 391
inv_w_trapping = ps.filters.find_trapped_regions(seq=inv,
return_mask=True)
- assert inv_w_trapping.sum() == 390
+ assert inv_w_trapping.sum() == 461
inv_w_trapping = ps.filters.find_trapped_regions(seq=inv,
return_mask=False)
- assert (inv_w_trapping == -1).sum() == 390
+ assert (inv_w_trapping == -1).sum() == 461
def test_mio_w_trapping(self):
np.random.seed(0)
@@ -55,11 +55,11 @@ class IBIPTest():
def test_ibip_w_modes(self):
inv = ps.filters.ibip(self.im, inlets=self.bd)
- assert inv.max() == 119
+ assert inv.max() == 318
inv = ps.filters.ibip(self.im, inlets=self.bd, mode='fft')
- assert inv.max() == 119
+ assert inv.max() == 318
inv = ps.filters.ibip(self.im, inlets=self.bd, mode='insert')
- assert inv.max() == 119
+ assert inv.max() == 318
if __name__ == '__main__':
