Skip to content

Commit

Permalink
docu
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfHielscher committed Mar 1, 2024
1 parent 044d4f5 commit 23dd6d9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 43 deletions.
20 changes: 0 additions & 20 deletions _data/sidebars/function_reference_sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1402,10 +1402,6 @@ entries:
url: /orientation.symmetrise.html
output: web

- title: "tensor"
url: /orientation.tensor.html
output: web

- title: "times"
url: /orientation.times.html
output: web
Expand Down Expand Up @@ -1924,10 +1920,6 @@ entries:
url: /quaternion.calcVoronoi.html
output: web

- title: "calcVoronoiOld"
url: /quaternion.calcVoronoiOld.html
output: web

- title: "calcVoronoiVolume"
url: /quaternion.calcVoronoiVolume.html
output: web
Expand Down Expand Up @@ -3081,10 +3073,6 @@ entries:
url: /grain2d.equivalentRadius.html
output: web

- title: "fft"
url: /grain2d.fft.html
output: web

- title: "findByLocation"
url: /grain2d.findByLocation.html
output: web
Expand Down Expand Up @@ -4121,10 +4109,6 @@ entries:
url: /strainTensor.calcTaylor.html
output: web

- title: "calcTaylor2"
url: /strainTensor.calcTaylor2.html
output: web

- title: "deviatoricStrain"
url: /strainTensor.deviatoricStrain.html
output: web
Expand Down Expand Up @@ -5289,10 +5273,6 @@ entries:
url: /SO3Fun.calcComponents.html
output: web

- title: "calcComponentsOld"
url: /SO3Fun.calcComponentsOld.html
output: web

- title: "calcError"
url: /SO3Fun.calcError.html
output: web
Expand Down
2 changes: 1 addition & 1 deletion matlab/makeDoc.m
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function makeDoc(varargin)
makeHelpToc(mtexExFiles,'Examples','examples.xml');
xml2yml('examples.xml','../_data/sidebars/examples_sidebar.yml','Examples')

% publsih files
% publish files
exOut = fullfile(pwd,'..','pages','examples_matlab');
options.outDir = exOut;
options.xml.toolbox.folder.Text = 'examples';
Expand Down
47 changes: 25 additions & 22 deletions pages/documentation_matlab/GrainReconstruction.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@
{% include inline_image.html file="GrainReconstruction_01.png" %}
</center><h2 id="2">Basic grain reconstruction</h2><p>We see that there are a lot of not indexed measurements. For grain reconstruction, we have three different choices how to deal with these unindexed regions:</p><div><ol><li>leave them unindexed</li><li>assign them to the surrounding grains</li><li>a mixture of both, e.g., assign small notindexed regions to the surrounding grains but keep large notindexed regions</li></ol></div><p>The extent to which unindexed pixels are assigned is controlled by the parameter <code class="language-plaintext highlighter-rouge">'alpha'</code>. Roughly speaking this parameter is the radius of the smallest unindexed region that will not be entirely assigned to surrounding grains. The default of this value is 2.2.</p><p>The second parameter involved in grain reconstruction is the threshold misorientation angle indicating a grain boundary. By default, this value is set to 10 degrees.</p><p>All grain reconstruction methods in MTEX are accessible via the command <a href="EBSD.calcGrains.html">calcGrains</a> which takes as input an EBSD data set and returns a list of grain.</p>
{% highlight matlab %}
[grains, ebsd.grainId] = calcGrains(ebsd,'alpha',1.2,'angle',10*degree);
[grains, ebsd.grainId] = calcGrains(ebsd,'alpha',2.2,'angle',10*degree);
grains
{% endhighlight %}

{% highlight plaintext %}
grains = grain2d

Phase Grains Pixels Mineral Symmetry Crystal reference frame
1 112 14088 Forsterite mmm
2 40 1393 Enstatite mmm
3 73 758 Diopside 12/m1 X||a*, Y||b*, Z||c
1 109 14093 Forsterite mmm
2 34 1397 Enstatite mmm
3 71 759 Diopside 12/m1 X||a*, Y||b*, Z||c

boundary segments: 4772 (218456 µm)
boundary segments: 4198 (194614 µm)
inner boundary segments: 1 (19 µm)
triple points: 192
triple points: 225

Properties: meanRotation, GOS
{% endhighlight %}
Expand All @@ -76,41 +76,44 @@
{% endhighlight %}
<center>
{% include inline_image.html file="GrainReconstruction_02.png" %}
</center><p>Increasing the parameter <code class="language-plaintext highlighter-rouge">'alpha'</code> larger unindexed regions are associated to grains.</p>
</center><h2 id="4">Grainboundary Smoothing</h2><p>Due to the gridded nature of the EBSD measurement the reconstructed grain boundaries often suffer from the staircase effect. This can be reduced by smoothing the grain boundaries using the command <a href="grain2d.smooth.html"><code class="language-plaintext highlighter-rouge">smooth</code></a></p>
{% highlight matlab %}
[grains, ebsd.grainId] = calcGrains(ebsd,'alpha',3.2,'angle',10*degree);
grains = smooth(grains,5);

% plot the boundary of all grains
% display the result
plot(ebsd)
hold on
plot(grains.boundary,'linewidth',1.5,'lineColor','red')
plot(grains.boundary,'linewidth',1.5)
hold off
{% endhighlight %}
<center>
{% include inline_image.html file="GrainReconstruction_03.png" %}
</center><h2 id="5">Clearing Single Pixel Grains</h2><p>As we observe quite a few single pixel grains we might want to consider them as misindexations and perform the grain reconstruction on the cleaned up data set.</p>
</center><h2 id="5">Adapting the Alpha Paramter</h2><p>Increasing the parameter <code class="language-plaintext highlighter-rouge">'alpha'</code> larger unindexed regions are associated to grains.</p>
{% highlight matlab %}
% detect single pixel grains
isMisindexed = grains.grainSize==1;

% set the corresponding EBSD data to notIndexed
ebsd(grains(isMisindexed)) = 'notIndexed';

% redo grain reconstruction
[grains, ebsd.grainId] = calcGrains(ebsd,'alpha',3.2,'angle',10*degree);
[grains, ebsd.grainId] = calcGrains(ebsd,'alpha',10,'angle',10*degree);
grains = smooth(grains,5);

% display the result
% plot the boundary of all grains
plot(ebsd)
hold on
plot(grains.boundary,'linewidth',1.5)
hold off
{% endhighlight %}
<center>
{% include inline_image.html file="GrainReconstruction_04.png" %}
</center><h2 id="6">Grainboundary Smoothing</h2><p>Finally we may not like the staircase effect of the grain boundaries. This can be reduced by smoothing the grain boundaries using the command <a href="grain2d.smooth.html"><code class="language-plaintext highlighter-rouge">smooth</code></a></p>
</center><h2 id="6">Clearing Single Pixel Grains</h2><p>There are quite a few single pixel grains we might want to consider as misindexations and perform the grain reconstruction on the cleaned up data set. This is done as follows</p>
{% highlight matlab %}
grains = smooth(grains,5);
% detect single pixel grains
isMisindexed = grains.grainSize==1;

% set the corresponding EBSD data to notIndexed
ebsd(grains(isMisindexed)) = 'notIndexed';

% redo grain reconstruction
[grains, ebsd.grainId] = calcGrains(ebsd,'alpha',3.2,'angle',10*degree);

% display the result
grains = smooth(grains,5);
plot(ebsd)
hold on
plot(grains.boundary,'linewidth',1.5)
Expand Down

0 comments on commit 23dd6d9

Please sign in to comment.