resample each chain at a constant spacing along its length
Description
Places new vertices at equal arc length along each chain, between the vertices that have to survive, which stay exactly where they are. The new vertices lie on the old boundary, so this changes nothing about its shape - it only changes how it is sampled.
A chain is cut into pieces that are resampled independently at every vertex that may not move: its two junctions, a vertex where the neighbouring grains change, and anything passed in as 'protect'. A chain resampled in one piece visits none of the ones in between, which leaves the inner boundary hanging off a vertex the outer walk no longer reaches, and lets a segment carry the grainId pair of its neighbour.
This is what makes a subsequent grain2d/smoothBoundary work properly. Subdividing each segment, as grain2d/refineBoundary used to do on its own, preserves the staircase of the pixel grid and only makes it finer. Resampling at equal arc length instead gives the smoothing evenly spaced degrees of freedom that are not tied to the grid.
grainId and phaseId are constant along a chain and carry over exactly. ebsdId and misrotation belong to a specific pair of pixels, which a resampled segment no longer corresponds to - those are inherited from whichever original segment covers the new segment's midpoint. A midpoint landing on the seam between two of them is covered by both, and which one it takes is then decided by the last bits of the arc length.
Syntax
gB_r = refine(gB)
gB_r = refine(gB,delta)
gB_r = refine(gB,delta,'protect',vertexIds)Input
| gB | grainBoundary |
| delta | target segment length (default: half the median segment length - a sample every median length may cut a corner per sample where the segments are not all of the same length, half of it follows the original polyline closely) |
Output
| gB_r | grainBoundary |
Options
| protect | ids of vertices that must survive, on top of the junctions |
See also
grainBoundary.simplify grainBoundary.reduce grain2d.refineBoundary grain2d.smoothBoundary
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/grainBoundary.refine.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.