mtex-toolbox / mtex

MTEX is a free Matlab toolbox for quantitative texture analysis. Homepage:
http://mtex-toolbox.github.io/
GNU General Public License v2.0
286 stars 185 forks source link

self-intersecting and incomplete grain boundaries when using calcGrains on interpolated EBSD data #1723

Closed vtvivian closed 1 year ago

vtvivian commented 1 year ago

What do you want to do? I want to reconstruct the grains in an EBSD object with interpolated XY points, but the grains have strange artefacts

What data do you have? I reproduced this using a demo dataset

What code do you use?

mtexdata alphaBetaTitanium
ebsd=ebsd.gridify;

[xmin, xmax, ymin, ymax] = ebsd.extend;
%artifically halve the step size
[xGrid, yGrid] = meshgrid(xmin-ebsd.dx/4:ebsd.dx/2:xmax+ebsd.dx/4,... 
    ymin-ebsd.dy/4:ebsd.dy/2:ymax+ebsd.dy/4);

%resize EBSD map
ebsd1 = gridify(interp(ebsd, xGrid(:), yGrid(:))); 

grains = calcGrains(ebsd('Ti (alpha)'),'angle',10*degree);   
figure; plot(grains);
figure; plot(grains(39736).boundary);

grains1 = calcGrains(ebsd1('Ti (alpha)'),'angle',10*degree);
figure; plot(grains1);
figure; plot(grains1(39498).boundary);

What result do you get There are these patch artefacts (horizontal white stripy-triangles) grains1_39498 and the external grain boudary intersects itself and is incomplete at a few points grains1_39498_boundary

What result do you expect something that is a scaled version of this which works as-expected if no interpolation is performed: grains_39736 grains_39736_boundary

What MTEX version do you use? 5.8.1

vtvivian commented 1 year ago

I did not reproduce the problem after updating MTEX version to 'develop' cbf0f68. Sorry - I should probably have checked in advance.