How to use the porespy.generators.RSA function in porespy

To help you get started, we’ve selected a few porespy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PMEAL / porespy / test / unit / test_filters.py View on Github external
def test_local_thickness_known_sizes(self):
        im = sp.zeros(shape=[300, 300])
        im = ps.generators.RSA(im=im, radius=20)
        im = ps.generators.RSA(im=im, radius=10)
        im = im > 0
        lt = ps.filters.local_thickness(im, sizes=[20, 10])
        assert sp.all(sp.unique(lt) == [0, 10, 20])
github PMEAL / porespy / test / unit / test_generators.py View on Github external
def test_RSA_mask_edge_2d(self):
        im = sp.zeros([100, 100], dtype=int)
        im = ps.generators.RSA(im, radius=10, volume_fraction=0.5,
                               mode='contained')
        coords = sp.argwhere(im == 2)
        assert ~sp.any(coords < 10)
        assert ~sp.any(coords > 90)
github PMEAL / porespy / test / unit / test_generators.py View on Github external
def test_RSA_3d_single(self):
        sp.random.seed(0)
        im = sp.zeros([50, 50, 50], dtype=int)
        im = ps.generators.RSA(im, radius=5, volume_fraction=0.5)
        assert sp.sum(im > 0) == 45602
        assert sp.sum(im > 1) == 121
github PMEAL / porespy / test / unit / test_generators.py View on Github external
def test_RSA_2d_multi(self):
        sp.random.seed(0)
        im = sp.zeros([100, 100], dtype=int)
        im = ps.generators.RSA(im, radius=10, volume_fraction=0.5)
        im = ps.generators.RSA(im, radius=5, volume_fraction=0.75)
        assert sp.sum(im > 0) == 6520
        assert sp.sum(im > 1) == 44
github PMEAL / porespy / test / unit / test_generators.py View on Github external
def test_RSA_mask_edge_3d(self):
        im = sp.zeros([50, 50, 50], dtype=int)
        im = ps.generators.RSA(im, radius=5, volume_fraction=0.5,
                               mode='contained')
        coords = sp.argwhere(im == 2)
        assert ~sp.any(coords < 5)
        assert ~sp.any(coords > 45)
github PMEAL / porespy / test / unit / test_filters.py View on Github external
def test_local_thickness_known_sizes(self):
        im = sp.zeros(shape=[300, 300])
        im = ps.generators.RSA(im=im, radius=20)
        im = ps.generators.RSA(im=im, radius=10)
        im = im > 0
        lt = ps.filters.local_thickness(im, sizes=[20, 10])
        assert sp.all(sp.unique(lt) == [0, 10, 20])
github PMEAL / porespy / test / unit / test_generators.py View on Github external
def test_RSA_2d_multi(self):
        sp.random.seed(0)
        im = sp.zeros([100, 100], dtype=int)
        im = ps.generators.RSA(im, radius=10, volume_fraction=0.5)
        im = ps.generators.RSA(im, radius=5, volume_fraction=0.75)
        assert sp.sum(im > 0) == 6520
        assert sp.sum(im > 1) == 44
github PMEAL / porespy / test / unit / test_generators.py View on Github external
def test_RSA_2d_single(self):
        sp.random.seed(0)
        im = sp.zeros([100, 100], dtype=int)
        im = ps.generators.RSA(im, radius=10, volume_fraction=0.5)
        assert sp.sum(im > 0) == 5095
        assert sp.sum(im > 1) == 20