find_dt_artifacts#

Labels voxels that are closer to the image boundary than to a solid. These are potentially artifacts since solid voxels could potentially lie just beyond the boundary but were cropped.

import matplotlib.pyplot as plt
import numpy as np
import porespy as ps
import scipy.ndimage as spim
import inspect
ps.visualization.set_mpl_style()
inspect.signature(ps.filters.find_dt_artifacts)
<Signature (dt)>

dt#

This function only accepts 1 argument, the distance tranform.

im = ps.generators.blobs(shape=[500, 500])
dt = spim.distance_transform_edt(im)
dt2 = ps.filters.find_dt_artifacts(dt=dt)
fig, ax = plt.subplots(1, 2, figsize=[12, 6])
ax[0].imshow(dt, interpolation='none', origin='lower')
ax[0].axis(False)
ax[1].imshow(dt2/im, interpolation='none', origin='lower')
ax[1].axis(False);
../../../_images/f8f0bda8fcfa92344fbd99018ba82032fe5465b1b96c918e3b172f005bacdc27.svg