<jupyter_start><jupyter_text>distance_transform_lin  Import packages<jupyter_code>import numpy as np
import porespy as ps
import scipy.ndimage as spim
import matplotlib.pyplot as plt
import skimage
ps.visualization.set_mpl_style()<jupyter_output><empty_output><jupyter_text>Create image and variables<jupyter_code>im = ps.generators.blobs(shape=[500, 500])
plt.figure(figsize=[7,7])
plt.axis(False)
plt.imshow(im);

#default values:
axis=0
mode = "both"<jupyter_output><empty_output><jupyter_text>Apply filter function  axis<jupyter_code>x = ps.filters.distance_transform_lin(im=im, axis=axis, mode=mode)
xx = ps.filters.distance_transform_lin(im=im, axis=1, mode=mode)
fig, ax = plt.subplots(1, 2, figsize=[20, 20]);
ax[0].imshow(x);
ax[0].axis(False)
ax[1].imshow(xx);
ax[1].axis(False)
ax[0].set_title('axis = 0')
ax[1].set_title('axis = 1');<jupyter_output><empty_output><jupyter_text>mode<jupyter_code>xx = ps.filters.distance_transform_lin(im=im, axis=axis, mode="forward")
xxx = ps.filters.distance_transform_lin(im=im, axis=axis, mode="reverse")
fig, ax = plt.subplots(1, 3, figsize=[20, 20]);
ax[0].imshow(x);
ax[0].axis(False)
ax[1].imshow(xx);
ax[1].axis(False)
ax[2].imshow(xxx);
ax[2].axis(False)
ax[0].set_title('mode = both')
ax[1].set_title('mode = forward')
ax[2].set_title('mode = reverse');<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17475728155339806, 'fraction_numerical': 0.02912621359223301, 'mean_word_length': 9.075187969924812, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '37337', 'license': 'MIT', 'n_tokens_mistral': 564, 'n_tokens_neox': 544, 'n_words': 83, 'path': 'examples/filters/howtos/distance_transform_lin.ipynb', 'repo_name': 'jamesobutler/porespy', 'size': '1339'}