Advanced Grain Reconstruction edit page

1) no fill, no grains, all pixels

mtexdata small
[grains,ebsd.grainId,ebsd.mis2mean] = calcGrains(ebsd);
ebsd(grains(grains.grainSize<=3)) = [];
[grains,ebsd.grainId,ebsd.mis2mean] = calcGrains(ebsd);
F = splineFilter;
ebsd = smooth(ebsd,F);
[grains,ebsd.grainId,ebsd.mis2mean] = calcGrains(ebsd);
plot(ebsd)
hold on
plot(grains.boundary,'lineColor',[1 0 0],'linewidth',2)
hold off
ebsd = EBSD
 
 Phase  Orientations     Mineral         Color  Symmetry  Crystal reference frame
     0    1197 (32%)  notIndexed                                                 
     1    1952 (52%)  Forsterite  LightSkyBlue       mmm                         
     2    290 (7.8%)   Enstatite  DarkSeaGreen       mmm                         
     3    282 (7.6%)    Diopside     Goldenrod     12/m1       X||a*, Y||b*, Z||c
 
 Properties: bands, bc, bs, error, mad, x, y
 Scan unit : um

2) no fill, no grains, indexed pixels

mtexdata small
[grains,ebsd('indexed').grainId] = calcGrains(ebsd('indexed'));
ebsd(grains(grains.grainSize<=3)) = [];
[grains,ebsd('indexed').grainId] = calcGrains(ebsd('indexed'));
F = splineFilter;
ebsd = smooth(ebsd('indexed'),F);
[grains,ebsd('indexed').grainId] = calcGrains(ebsd('indexed'));

nextAxis
plot(ebsd)
hold on
plot(grains.boundary,'lineColor',[1 0 0],'linewidth',2)
hold off
ebsd = EBSD
 
 Phase  Orientations     Mineral         Color  Symmetry  Crystal reference frame
     0    1197 (32%)  notIndexed                                                 
     1    1952 (52%)  Forsterite  LightSkyBlue       mmm                         
     2    290 (7.8%)   Enstatite  DarkSeaGreen       mmm                         
     3    282 (7.6%)    Diopside     Goldenrod     12/m1       X||a*, Y||b*, Z||c
 
 Properties: bands, bc, bs, error, mad, x, y
 Scan unit : um

3) fill, no grains, all pixels

mtexdata small
[grains,ebsd.grainId] = calcGrains(ebsd);
ebsd(grains(grains.grainSize<=3)) = [];
[grains,ebsd.grainId] = calcGrains(ebsd);
F = splineFilter;
ebsd = smooth(ebsd,F,'fill');
[grains,ebsd.grainId] = calcGrains(ebsd);

nextAxis
plot(ebsd)
hold on
plot(grains.boundary,'lineColor',[1 0 0],'linewidth',2)
hold off
ebsd = EBSD
 
 Phase  Orientations     Mineral         Color  Symmetry  Crystal reference frame
     0    1197 (32%)  notIndexed                                                 
     1    1952 (52%)  Forsterite  LightSkyBlue       mmm                         
     2    290 (7.8%)   Enstatite  DarkSeaGreen       mmm                         
     3    282 (7.6%)    Diopside     Goldenrod     12/m1       X||a*, Y||b*, Z||c
 
 Properties: bands, bc, bs, error, mad, x, y
 Scan unit : um

4) fill, no grains, indexed pixels

mtexdata small
[grains,ebsd('indexed').grainId] = calcGrains(ebsd('indexed'));
ebsd(grains(grains.grainSize<=3)) = [];
[grains,ebsd('indexed').grainId] = calcGrains(ebsd('indexed'));
F = splineFilter;
ebsd = smooth(ebsd('indexed'),F,'fill');
[grains,ebsd('indexed').grainId] = calcGrains(ebsd('indexed'));

nextAxis
plot(ebsd)
hold on
plot(grains.boundary,'lineColor',[1 0 0],'linewidth',2)
hold off
ebsd = EBSD
 
 Phase  Orientations     Mineral         Color  Symmetry  Crystal reference frame
     0    1197 (32%)  notIndexed                                                 
     1    1952 (52%)  Forsterite  LightSkyBlue       mmm                         
     2    290 (7.8%)   Enstatite  DarkSeaGreen       mmm                         
     3    282 (7.6%)    Diopside     Goldenrod     12/m1       X||a*, Y||b*, Z||c
 
 Properties: bands, bc, bs, error, mad, x, y
 Scan unit : um

5) fill, grains, indexed pixels

mtexdata small
[grains,ebsd('indexed').grainId] = calcGrains(ebsd('indexed'));
ebsd(grains(grains.grainSize<=3)) = [];
[grains,ebsd('indexed').grainId] = calcGrains(ebsd('indexed'));
F = splineFilter;
ebsd = smooth(ebsd('indexed'),F,'fill',grains);
[grains,ebsd('indexed').grainId] = calcGrains(ebsd('indexed'));

nextAxis
plot(ebsd)
hold on
plot(grains.boundary,'lineColor',[1 0 0],'linewidth',2)
hold off
drawNow(gcm)
ebsd = EBSD
 
 Phase  Orientations     Mineral         Color  Symmetry  Crystal reference frame
     0    1197 (32%)  notIndexed                                                 
     1    1952 (52%)  Forsterite  LightSkyBlue       mmm                         
     2    290 (7.8%)   Enstatite  DarkSeaGreen       mmm                         
     3    282 (7.6%)    Diopside     Goldenrod     12/m1       X||a*, Y||b*, Z||c
 
 Properties: bands, bc, bs, error, mad, x, y
 Scan unit : um

6) Multiscale clustering method

mtexdata small
grains = calcGrains(ebsd('indexed'),'FMC',1)
nextAxis
plot(ebsd)
hold on
plot(grains.boundary,'lineColor',[1 0 0],'linewidth',2)
hold off
drawNow(gcm)
ebsd = EBSD
 
 Phase  Orientations     Mineral         Color  Symmetry  Crystal reference frame
     0    1197 (32%)  notIndexed                                                 
     1    1952 (52%)  Forsterite  LightSkyBlue       mmm                         
     2    290 (7.8%)   Enstatite  DarkSeaGreen       mmm                         
     3    282 (7.6%)    Diopside     Goldenrod     12/m1       X||a*, Y||b*, Z||c
 
 Properties: bands, bc, bs, error, mad, x, y
 Scan unit : um
 
 
grains = grain2d
 
 Phase  Grains  Pixels     Mineral  Symmetry  Crystal reference frame
     1      23    1952  Forsterite       mmm                         
     2       7     290   Enstatite       mmm                         
     3      35     282    Diopside     12/m1       X||a*, Y||b*, Z||c
 
 boundary segments: 986
 inner boundary segments: 0
 triple points: 57
 
 Properties: meanRotation, GOS

Multiscale clustering method

When analyzing grains with gradual and subtle boundaries the threshold based method may not lead to the desired result.

Let us consider the following example

mtexdata single

colorKey = axisAngleColorKey(ebsd);
colorKey.oriRef = mean(ebsd.orientations);

plot(ebsd,colorKey.orientation2color(ebsd.orientations))
ebsd = EBSD
 
 Phase  Orientations  Mineral         Color  Symmetry  Crystal reference frame
     1  10201 (100%)       Al  LightSkyBlue      m-3m                         
 
 Properties: x, y
 Scan unit : um

We obeserve that the are no rapid changes in the orientation which would allow for applying the threshold based algorithm. Setting the threshold angle to a very small value would include many irrelevant or false regions.

grains_high = calcGrains(ebsd,'angle',1*degree);
grains_low  = calcGrains(ebsd,'angle',0.5*degree);

figure
plot(ebsd,colorKey.orientation2color(ebsd.orientations))
hold on
plot(grains_high.boundary)
hold off

figure
plot(ebsd,colorKey.orientation2color(ebsd.orientations))
hold on
plot(grains_low.boundary)
hold off

As an alternative MTEX includes the fast multiscale clustering method (FMC method) which constructs clusters in a hierarchical manner from single pixels using fuzzy logic to account for local, as well as global information.

Analogous with the threshold angle, a single parameter, C_Maha controls the sensitivity of the segmentation. A C_Maha value of 3.5 properly identifies the subgrain features. A C_Maha value of 3 captures more general features, while a value of 4 identifies finer features but is slightly oversegmented.

grains_FMC = calcGrains(ebsd('indexed'),'FMC',3.8)
grains = calcGrains(ebsd('indexed'))

% smooth grains to remove staircase effect
grains_FMC = smooth(grains_FMC);
grains_FMC = grain2d
 
 Phase  Grains  Pixels  Mineral  Symmetry  Crystal reference frame
     1      17   10201       Al      m-3m                         
 
 boundary segments: 1552
 inner boundary segments: 0
 triple points: 14
 
 Id   Phase   Pixels   phi1   Phi   phi2          GOS
  1       1        7    317   128    159    0.0084358
  2       1     1120    239    74    319     0.025113
  3       1      517    238    75    320    0.0100241
  4       1     1783     56   103     40    0.0220667
  5       1       11     57   104    220   0.00744635
  6       1        2    237    79    322   0.00276888
  7       1        7    343    43    249   0.00797851
  8       1      989    236    79    322    0.0126827
  9       1     1060    239    75    320    0.0197615
 10       1       76    238    75    320   0.00793592
 11       1     1556    238    77    320    0.0219543
 12       1      349    237    77    320     0.011464
 13       1      401    342    41    251    0.0103623
 14       1      402    238    77    320    0.0121092
 15       1      184    237    77    319    0.0128468
 16       1      957    316   129     74    0.0176087
 17       1      780    238    78    321    0.0123841
 
 
grains = grain2d
 
 Phase  Grains  Pixels  Mineral  Symmetry  Crystal reference frame
     1       1   10201       Al      m-3m                         
 
 boundary segments: 404
 inner boundary segments: 0
 triple points: 0
 
 Id   Phase   Pixels   phi1   Phi   phi2         GOS
  1       1    10201    237    77    320   0.0344807

We observe how this method nicely splits the measurements into clusters of similar orientation

%plot(ebsd,oM.orientation2color(ebsd.orientations))
plot(ebsd,colorKey.orientation2color(ebsd.orientations))

% start overide mode
hold on
plot(grains_FMC.boundary,'linewidth',1.5)

% stop overide mode
hold off

Markovian Clustering Algorithm

F = halfQuadraticFilter
F.alpha = 0.5
ebsd = smooth(ebsd,F)
F = 
  halfQuadraticFilter with properties:

    l1DataFit: 1
         l1TV: 1
        alpha: 1
      iterMax: 1000
          tol: 3.4907e-04
          eps: 1.0000e-03
    threshold: 0.2618
        isHex: 0
F = 
  halfQuadraticFilter with properties:

    l1DataFit: 1
         l1TV: 1
        alpha: 0.5000
      iterMax: 1000
          tol: 3.4907e-04
          eps: 1.0000e-03
    threshold: 0.2618
        isHex: 0
 
ebsd = EBSD
 
 Phase  Orientations  Mineral         Color  Symmetry  Crystal reference frame
     1  10201 (100%)       Al  LightSkyBlue      m-3m                         
 
 Properties: x, y, oldId, quality
 Scan unit : um
grains = calcGrains(ebsd,'mcl',[1.24 50],'soft',[0.2 0.3]*degree)

grains = smooth(grains,5)

plot(ebsd,colorKey.orientation2color(ebsd.orientations))

hold on;plot(grains.boundary,'linewidth',2); hold off
grains = grain2d
 
 Phase  Grains  Pixels  Mineral  Symmetry  Crystal reference frame
     1     285   10201       Al      m-3m                         
 
 boundary segments: 3722
 inner boundary segments: 16502
 triple points: 423
 
 Properties: meanRotation, GOS
 
 
grains = grain2d
 
 Phase  Grains  Pixels  Mineral  Symmetry  Crystal reference frame
     1     285   10201       Al      m-3m                         
 
 boundary segments: 3722
 inner boundary segments: 16502
 triple points: 423
 
 Properties: meanRotation, GOS