apply_chords¶
- apply_chords(im: ndarray[Any, dtype[_ScalarType_co]], 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 to True.
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)) – If True 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 to True if spacing is 0, but is False 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.