Measurement of grain size variation using Matlab: Line-sampled linear intercept length method (ASTM E1382)



The most commonly reported microstructural measure in literature is the average grain size. In addition to measurement of average grain size, other material specific factors such as differences in phase structure and grain size distribution need to be considered. For heterogeneous materials such as welded low-alloy steel joints, the grain size distribution is of particular interest since it has been shown to influence the mechanical properties. Improved grain size measurement methods are thus required to enhance the understanding between grain size distribution and mechanical properties.

These codes are an implementation of the line- and point-sampled linear intercept length methods published in Refs. [1-2], utilising the functionalities of Matlab image processing toolbox. The separate codes are provided: the line-sampled intercept length measures the average grain size (d), and the relative grain size dispersion (Delta d/d). The line-sampled procedure is based on the ASTM E1382 standard. In addition, the point-sampled linear-intercept length method measures the volume-weighted average grain size, which is more relevant for mechanical properties than the average grain size for microstructures with a broad grain size dispersion. 

The point-sampled code is partially obsolete, and has been superseeded by a newer version also capable of measuring spatial grain size variation, available at: For more details, refer to the two publications [1-2], and WIKI page [3] given below.


Open linesampled_intercept_length_v1b.m or pointsampled_intercept_length_v1b.mPre-process the grain boundary maps according to the instructions on in Ref. [3]. Two example grain boundary maps are provided, one extracted from HKL Channel 5 software, the other post-processed from an optical micrograph. Note that grain boundaries must have a thickness larger than 1 pixel, otherwise measurements will bleed through gaps in the boundaries.Check the parameters set at sections 'Input data', 'Output settings' and 'Linear intercept parameters'. Typical parameters are set as default.Run the code (F5).For statistical analysis use the distribution fitting toolbox 'dfittool', variable descriptions are given in the beginning of the code.


Matlab's image processing toolbox and statistics toolbox

Published under GNU GPL v3 License.

For further information, refer to the following articles and the Wiki page:

[1] Materials Science and Engineering: A, 2014; 592: 28-39,[2] Welding in the World. 2016; 60: 673-678.[3] Aalto University Wiki -

Revision history:

v1b: File uploaded to Zenodo on 2021/August 11th. Initial Release was in March 2016.
Koska saatavilla2016

Dataset Licences

  • CC-BY-4.0

Siteeraa tätä