the grains of a map: a table of ids, phases, pixel counts, mean orientations and properties, with the boundary, the inner boundary and the polygon of every grain; MATLAB’s grain2d

Syntax

grains = calcGrains(ebsd)

The grains of a map.

grains = grain2d(grains.id, grains.phaseId, grains.CSList, grains.numPixel, grains.meanRotation, grains.GOS, grains.frame, boundary=grains.boundary)

A table from its columns.

grains['Forsterite']

The grains of one phase.

grains[grains.numPixel > 10]

The grains of a condition.

grains.selectByGrainId([1, 2, 3])

The grains of these ids.

Description

Grains are made by calcGrains, which segments a map; the constructor takes the columns of the table and the boundaries of a segmentation. The polygon of a grain is the loops of the boundary segments that carry its id, traced from the boundary when no loops are given, so grains without a boundary have no polygon and no shape. A property given in prop, or assigned as grains.name = values, is one value per grain and follows every selection.

MATLAB builds grains also from vertices and polygons, grain2d(V, poly, ori, CSList); here grains come from a segmentation alone.

Input

id integer array, the id of every grain
phaseId integer array, the position of every grain’s phase in CSList
CSList phaseList, the frames of the phases
numPixel integer array, the number of pixels of every grain
meanRotation rotation, the mean orientation of every grain as a rotation from the crystal to the specimen
GOS array, the grain orientation spread of every grain in radians
frame specimenFrame, the frame the grains lie in

Keywords

keyword default description
prop None dict of further properties, one value per grain, read as grains.name or grains.prop[‘name’]
boundary None grainBoundary, the segments between the grains and to the outside of the map
innerBoundary None grainBoundary, the segments inside the grains, the low angle boundaries of a segmentation with two thresholds
loops None the polygon of every grain as loops of boundary segments; traced from boundary when not given
phaseMap None the phase number of the file for every entry of CSList

Output

grains grain2d

Properties

id grain ids; these need not equal positions in a selected grain list
phaseId phase-list index of each grain
meanOrientation mean orientations for a single-phase grain selection
numPixel number of measurements assigned to each grain
GOS grain orientation spread in radians
boundary grainBoundary segments separating grains or bordering the map
innerBoundary low-angle segments within grains, when reconstructed
area area enclosed by each polygon, in squared spatial units
centroid geometric centroid of each grain outline
prop additional data with one value per grain
frame specimenFrame in which the geometry is expressed

See also

calcGrains, grain2d.merge, grain2d.selectByGrainId, grainBoundary, GrainReconstruction, SelectingGrains, GrainSpatialPlots, ShapeParameters

MATLAB’s grain2d.grain2d

source

Citing this page. This page is part of the documentation of MTEX, a free and open source MATLAB toolbox for analyzing and modeling crystallographic textures. It was written by The MTEX Developers and is published at https://mtex-toolbox.github.io/grain2d.grain2d_py.html. If you use MTEX, or reuse text or figures from this page, in your research, please cite

F. Bachmann, R. Hielscher, H. Schaeben: Texture Analysis with MTEX - Free and Open Source Software Toolbox, Solid State Phenomena 160 (2010), 63-68. 10.4028/www.scientific.net/SSP.160.63

BibTeX
@article{bachmann2010mtex,
  author  = {F. Bachmann and R. Hielscher and H. Schaeben},
  title   = {Texture Analysis with MTEX - Free and Open Source Software Toolbox},
  journal = {Solid State Phenomena},
  volume  = {160},
  pages   = {63-68},
  year    = {2010},
  doi     = {10.4028/www.scientific.net/SSP.160.63},
  url     = {https://doi.org/10.4028/www.scientific.net/SSP.160.63}
}

Other papers describing specific MTEX methods are listed under Publications — please cite the one that best fits your application. The MTEX source code is licensed under the GNU General Public License v2.0; the text and figures of this documentation are licensed under CC BY 4.0, which permits reuse — including by automated systems — provided The MTEX Developers and this page are credited.