porespy.metrics.porosity_profile#

porespy.metrics.porosity_profile(im, axis=0, span=1, mode='tile')#

Computes the porosity profile along the specified axis

Parameters:
  • im (ndarray) – The volumetric image for which to calculate the porosity profile. All voxels with a value of 1 (or True) are considered as void.

  • axis (int) – The axis along which to profile should be measured

  • span (int (Default = 1)) – The thickness of layers to include in the moving average calculation.

  • mode (str (Default = 'tile')) –

    How the moving average should be applied. Options are:

    mode

    description

    ’tile’

    The average is computed for discrete non-overlapping tiles of a size given by span

    ’slide’

    The average is computed in a moving window starting at span/2 and sliding by a single voxel. This method provides more data points but is slower.

Returns:

results – Results is a custom porespy class with the following attributes:

Attribute

Description

position

The position along the given axis at which porosity values are computed, corresponding to the middle of each slice, whether the mode was ‘tile’ or ‘slide’. The units are in voxels.

porosity

The local porosity value at each position.

Return type:

dataclass

Returns:

result – A 1D-array of porosity along the specified axis

Return type:

1D-array

Examples

Click here to view online example.