Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jump Probability with Greyscale Images #24

Merged
merged 11 commits into from
Jun 15, 2023
Prev Previous commit
Next Next commit
Update examples
  • Loading branch information
TomTranter committed Jun 15, 2023
commit 728ae28bc4621e95dc85ec2e36e05254f933f692
6 changes: 3 additions & 3 deletions dots.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
dots = np.zeros([1000, 1000])
for i in range(10):
for j in range(10):
adjx = np.random.choice(np.arange(-25, 25, 1, np.int), 1)[0]
adjy = np.random.choice(np.arange(-25, 25, 1, np.int), 1)[0]
adjx = np.random.choice(np.arange(-25, 25, 1, int), 1)[0]
adjy = np.random.choice(np.arange(-25, 25, 1, int), 1)[0]
dots[(100*i)+50+adjx, (100*j)+50+adjy] = 1

dt = spim.distance_transform_edt(dots)
Expand Down Expand Up @@ -88,7 +88,7 @@ def interpolated_sq_disp(rw):
plt.figure()
plt.imshow(dt)
# thresh = np.linspace(0.525, 0.55, 3)
thresh = [0.525]
thresh = [0.6]
rws = []
ims = []
for i in range(len(thresh)):
Expand Down
2 changes: 1 addition & 1 deletion frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
plt.close('all')
def main():
im = ps.generators.blobs(shape=[1000, 1000], blobiness=3, porosity=0.5)
im = ps.filters.fill_blind_pores(im).astype(np.int)
im = ps.filters.fill_blind_pores(im).astype(int)
dt = spim.distance_transform_edt(im)
grey = dt.copy()/dt.max()
grey = np.pad(grey, 1, mode='constant', constant_values=0)
Expand Down
2 changes: 1 addition & 1 deletion grey.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import matplotlib.pyplot as plt
import scipy.ndimage as spim
if __name__ == '__main__':
im = ps.generators.blobs(shape=[200, 200], porosity=0.5).astype(np.int)
im = ps.generators.blobs(shape=[200, 200], porosity=0.5).astype(int)
plt.figure()
plt.imshow(im)
dt = spim.distance_transform_edt(im)
Expand Down
64 changes: 0 additions & 64 deletions lines.py

This file was deleted.