rotate a gridded EBSD map, keeping its matrix layout canonical
Description
Rotating the spatial data moves the positions but not the entries of the matrix, so the grid directions come out somewhere else than the layout rule puts them: gridify orients a map so dimension 1 runs along the more vertical grid direction and dimension 2 along the more horizontal one, both with increasing coordinates. A quarter turn leaves that violated, and the map is then a grid whose stored order no longer says what its own d1 and d2 say - which defeats the point of the grid classes, whose reason to exist is handing a stable matrix to image registration tools.
So the layout is restored here, by reindexing. Nothing is resampled and no value is invented: a transpose and two flips are all that is ever applied, and only when the rotation actually disturbed the layout. A rotation that leaves the grid axis aligned - any multiple of 90 degrees - always lands back on the rule exactly. One that does not, say 30 degrees, is put as close to it as a permutation can get, which is what gridify itself would do.
NB this changes the SHAPE of the map for a quarter turn: an r × c map comes back c × r. That is the honest answer - the sample really did turn - and it is what keeps size(ebsd) meaning the same thing before and after.
Syntax
ebsd = rotate(ebsd,10*degree)
ebsd = rotate(ebsd,rotation.byAxisAngle(xvector,180*degree))
ebsd = rotate(ebsd,180*degree,'keepEuler')Input
| ebsd | EBSDsquare |
| angle | double |
| rot | rotation |
Output
| ebsd | EBSDsquare |
Options
| center | [x,y] center of rotation, default is (0,0) |
Flags
| keepXY | rotate only the orientation data |
| keepEuler | rotate only the spatial data |
See also
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/EBSDsquare.rotate.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.