phase_fraction

phase_fraction(im, normed=True)[source]

Calculates the number (or fraction) of each phase in an image

Parameters
  • im (ND-array) – An ND-array containing integer values

  • normed (boolean) – If True (default) the returned values are normalized by the total number of voxels in image, otherwise the voxel count of each phase is returned.

Returns

result – A array of length max(im) with each element containing the number of voxels found with the corresponding label.

Return type

1D-array

See also

porosity

Examples

Click here to view online example.