porespy.filters#

This module contains a variety of functions for altering images based on the structural characteristics, such as pore sizes. A definition of a filter is a function that returns an image the same shape as the original image, but with altered values.

Functions#

apply_chords(im[, spacing, axis, trim_edges, label])

Adds chords to the void space in the specified direction.

apply_chords_3D(im[, spacing, trim_edges])

Adds chords to the void space in all three principle directions.

apply_padded(im, pad_width, func[, pad_val])

Applies padding to an image before sending to func, then extracts

capillary_transform(im[, dt, sigma, theta, g, rho_wp, ...])

Uses the Washburn equation to convert distance transform values to a capillary

chunked_func(func[, parallel_kw, im_arg, strel_arg])

Performs the specfied operation "chunk-wise" in parallel using dask.

dilate(im, r[, dt, method, smooth])

Perform dilation with a round structuring element

distance_transform_lin(im[, axis, mode])

Replaces each void voxel with the linear distance to the nearest solid

erode(im, r[, dt, method, smooth])

Perform erosion with a round structuring element

fftmorphology(im, strel[, mode])

Perform morphological operations on binary images using fft approach for

fill_closed_pores(im[, conn])

Fills all closed pores that are isolated from the main void space.

fill_invalid_pores(im[, axis, conn])

Fills invalid pores which are either closed or do not span the domain

fill_surface_pores(im[, axis, conn])

Fill surface pores

find_closed_pores(im[, conn])

Finds closed pores that a not connected to any surface

find_disconnected_voxels(im[, inlets, conn])

Identifies all voxels that are not connected to specified inlets

find_dt_artifacts(dt)

Label points in a distance transform that are closer to image boundary

find_floating_solid(im[, conn, incl_surface])

Finds all solid that that is not attached to main solid structure.

find_invalid_pores(im[, axis, conn])

Finds invalid pores which are either closed or do not span the domain

find_peaks(dt[, r_max, strel, sigma, parallel_kw])

Finds local maxima in the distance transform

find_small_clusters(im[, trapped, min_size, conn])

Finds small isolated clusters of voxels which were identified as trapped and

find_surface_pores(im[, axis, conn])

Finds surface pores that do not span the domain

find_trapped_clusters(im, seq, outlets[, conn, method])

Find the trapped regions given an invasion sequence map and specified outlets

flood(im, labels[, mode])

Floods/fills each region in an image with a single value based on the

flood_func(im, func[, labels])

Flood each isolated region in an image with a constant value calculated by

hold_peaks(im[, axis, ascending])

Replaces each voxel with the highest value along the given axis.

local_thickness(im[, dt, method, smooth, mask, ...])

Insert a maximally inscribed sphere at every pixel labelled by sphere radius

local_thickness_bf(im[, dt, mask, smooth])

Insert a maximally inscribed sphere at every pixel labelled by sphere radius

local_thickness_conv(im[, dt, sizes, smooth])

Calculates the radius of the largest sphere that overlaps each voxel while

local_thickness_dt(im[, dt, sizes, smooth])

Calculates the radius of the largest sphere that overlaps each voxel while

local_thickness_imj(im[, dt, smooth, approx])

Insert a maximally inscribed sphere at every pixel labelled by sphere radius

nl_means_layered(im[, cores, axis, patch_size, ...])

Apply the non-local means filter to each 2D layer of a stack in parallel.

nphase_border(im[, conn])

Identifies the voxels in regions that border N other regions.

pc_to_satn(pc, im[, mode])

Converts a capillary pressure map to a saturation map

pc_to_seq(pc, im[, mode])

Converts a capillary pressure map to a sequence map

porosimetry(im[, dt, inlets, sizes, method, smooth])

Each location is assigned the radius of the largest sphere that can reach it

prune_branches(skel[, branch_points, iterations])

Remove all dangling ends or tails of a skeleton

reduce_peaks(peaks)

Any peaks that are broad or elongated are replaced with a single voxel

region_size(im[, conn])

Replace each voxel with the size of the region to which it belongs

satn_to_seq(satn, im[, residual, mode])

Converts a saturaiton map to a sequence map

seq_to_satn(seq, im[, mode])

Converts a sequence map to a saturation map

size_to_pc(im, size[, f])

Converts size map into capillary pressure map

size_to_satn(size[, im, bins, mode])

Converts size map to a saturation map

size_to_seq(size[, im, bins, mode])

Converts a size map to a sequence map

snow_partitioning(im[, dt, r_max, sigma, peaks])

Partition the void space into pore regions using a marker-based

snow_partitioning_n(im[, r_max, sigma, peaks])

This function partitions an imaging oontain an arbitrary number of

snow_partitioning_parallel(im[, r_max, sigma, parallel_kw])

Performs SNOW algorithm in parallel (or serial) to reduce time

trim_disconnected_voxels(im[, inlets, conn])

Removes foreground voxels not connected to specified inlets.

trim_extrema(im, h[, mode])

Trims local extrema in greyscale values by a specified amount.

trim_floating_solid(im[, conn, incl_surface])

Removes all solid that that is not attached to main solid structure.

trim_nearby_peaks(peaks, dt[, f])

Removes peaks that are nearer to another peak than to solid

trim_nonpercolating_paths(im[, axis, inlets, outlets, ...])

Remove all nonpercolating pores between specified locations

trim_saddle_points(peaks, dt[, maxiter])

Removes peaks that were mistakenly identified because they lied on a

trim_saddle_points_legacy(peaks, dt[, maxiter])

Removes peaks that were mistakenly identified because they lied on a

trim_small_clusters(im[, min_size])

Removes clusters voxel of a given size or smaller