apply_chords¶
- apply_chords(im, spacing: int = 1, axis: int = 0, trim_edges: bool = True, label: bool = False)[source]¶
Adds chords to the void space in the specified direction.
- Parameters:
im (ndarray) – An image of the porous material with void marked as
True
.spacing (int) – Separation between chords. The default is 1 voxel. This can be decreased to 0, meaning that the chords all touch each other, which automatically sets to the
label
argument toTrue
.axis (int (default = 0)) – The axis along which the chords are drawn.
trim_edges (bool (default =
True
)) – Whether or not to remove chords that touch the edges of the image. These chords are artifically shortened, so skew the chord length distribution.label (bool (default is
False
)) – IfTrue
the chords in the returned image are each given a unique label, such that all voxels lying on the same chord have the same value. This is automatically set toTrue
if spacing is 0, but isFalse
otherwise.
- Returns:
image – A copy of
im
with non-zero values indicating the chords.- Return type:
ndarray
See also
Examples
Click here to view online example.