trueEbsd2.undistort edit page

resample every map onto the reference grid, correcting its distortion

Description

calcDistortion measures the displacement between each consecutive pair, so the correction for one map is the sum of every hop between it and the reference. Those stack in reverse: job.undistortedList(1) is shifted by everything in job.shifts, job.undistortedList(2) by job.shifts{2:end}, and the reference is not shifted at all. Afterwards every map is on the same grid and every pixel overlays.

Afterwards every aligned image is also written into the properties of every map in the sequence that carries an EBSD, under that map's name - ebsd.fsd1a, or ebsd.img2 for an entry constructed without a 'name'. Map and image are in one array order by then, so this is a plain assignment and a multi channel image stays r × c × k. That is what makes an image usable as a per pixel property of the map: it survives gridify, indexing and subGrid along with everything else the map carries.

Resampling is nearest neighbour throughout. For images that is a choice - linear or cubic would work and would be smoother - but nearest neighbour is least likely to invent intensities that were never measured.

For EBSD data it is not a choice. Orientations and phase labels have no meaningful in-between, so what gets resampled is the map's id: the id travels through exactly the same mapping as the image, and the output map is rebuilt by looking up each resampled id in the input map. Note that EBSDsquare/interp is not usable here - it assumes a regular grid, and the whole point of this step is that the input is not on one.

Syntax

job = undistort(job)
job = undistort(job,'backend','scattered')

Input

job @trueEbsd, after calcDistortion

Output

job the same @trueEbsd (a handle), with undistortedList filled in

Options

backend 'inverse' (default) or 'scattered', see remapShifted. 'inverse' is the fast one; 'scattered' is what TrueEBSD <= 2.1.0 ran, for reproducing older numbers.

See also

calcDistortion pixelSizeMatch remapShifted