upxo.pxtal.fm_steel_3d.grain_structure_summary module
Summary numbers of a labelled grain structure.
voxel_spacing gives the voxel size along each axis for a domain of given
physical dimensions and reports how far the voxels are from being cubic.
grain_structure_summary gives grain-size statistics and the means of
equivalent-sphere diameter, sphericity and neighbour count.
- upxo.pxtal.fm_steel_3d.grain_structure_summary.voxel_spacing(physical_dimensions: Sequence[float], shape: Sequence[int]) Tuple[float, float, float, float][source]
Voxel size along x, y and z, and the relative deviation from cubic voxels.
- upxo.pxtal.fm_steel_3d.grain_structure_summary.grain_structure_summary(lfi: ndarray, voxel_size: float, metrics: dict | None = None) Dict[str, float][source]
Grain-size statistics and mean morphology values of a label grid.
- Parameters:
- Returns:
n_grains; mean_vox, min_vox, max_vox, std_vox (voxels per grain); mean_volume, min_volume, max_volume, std_volume (the same in physical units); mean_eqdia, mean_sphericity, mean_nnb (means over grains). All are 0 for a grid without grains.
- Return type: