You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>The property <codeclass="language-plaintext highlighter-rouge">how2plot</code> is a handle class of type @plottingConvention and tells MTEX how to align the corresponding coordinate system on screen.</p>
46
50
{% highlight matlab %}
@@ -58,7 +62,9 @@
58
62
{% endhighlight %}
59
63
60
64
{% highlight plaintext %}
61
-
65
+
v1 = vector3d
66
+
x y z
67
+
1 1 1
62
68
{% endhighlight %}
63
69
<center>
64
70
{% include inline_image.html file="AxesAlignment_02.png" %}
@@ -73,7 +79,11 @@
73
79
{% endhighlight %}
74
80
75
81
{% highlight plaintext %}
76
-
82
+
ans = plottingConvention
83
+
84
+
outOfScreen: (0,1,0)
85
+
north : (0,0,-1)
86
+
east : (1,0,0)
77
87
{% endhighlight %}
78
88
<center>
79
89
{% include inline_image.html file="AxesAlignment_03.png" %}
@@ -95,7 +105,11 @@
95
105
{% endhighlight %}
96
106
97
107
{% highlight plaintext %}
98
-
108
+
pC2 = plottingConvention
109
+
110
+
outOfScreen: (0,0,1)
111
+
north : (0,1,0)
112
+
east : (1,0,0)
99
113
{% endhighlight %}
100
114
<center>
101
115
{% include inline_image.html file="AxesAlignment_04.png" %}
{% include inline_image.html file="OptimalKernel_01.png" %}
@@ -53,15 +50,18 @@
53
50
{% endhighlight %}
54
51
55
52
{% highlight plaintext %}
56
-
53
+
ori = orientation (321 → xyz)
54
+
size: 10000 x 1
57
55
{% endhighlight %}
58
56
<p>Next we estimate the optimal <ahref="ODFShapes.html">kernel function</a> using the command <codeclass="language-plaintext highlighter-rouge"><ahref="orientation.calcKernel.html">calcKernel</a></code> with the default settings.</p>
59
57
{% highlight matlab %}
60
58
psi = calcKernel(ori)
61
59
{% endhighlight %}
62
60
63
61
{% highlight plaintext %}
64
-
62
+
psi = SO3DeLaValleePoussinKernel
63
+
bandwidth: 43
64
+
halfwidth: 5.7°
65
65
{% endhighlight %}
66
66
<p>This kernel can now be used to reconstruct the original ODF from the sampled points using the command <ahref="DensityEsimation.html">density estimation</a>
67
67
</p>
@@ -74,7 +74,9 @@
74
74
{% endhighlight %}
75
75
76
76
{% highlight plaintext %}
77
-
77
+
odf_rec = SO3FunHarmonic (321 → xyz)
78
+
bandwidth: 43
79
+
weight: 1
78
80
{% endhighlight %}
79
81
<center>
80
82
{% include inline_image.html file="OptimalKernel_02.png" %}
@@ -111,20 +113,24 @@ <h2 id="5">Exploration of the relationship between estimation error and number o
111
113
]);
112
114
113
115
end
114
-
{% endhighlight %}
115
116
116
-
{% highlight plaintext %}
117
-
118
-
{% endhighlight %}
119
-
<p>Plot the error to the number of single orientations sampled from the original ODF.</p>
120
-
{% highlight matlab %}
117
+
% Plot the error to the number of single orientations sampled from the original ODF.
121
118
close all;
122
119
loglog(10.^(1:length(e)),e,'LineWidth',2)
123
120
legend('Default','RuleOfThumb','magicRule')
124
121
xlabel('Number of orientations (log scale)')
125
122
ylabel('Estimation Error in degrees')
126
123
title('Error between original ODF model and the reconstructed ODF','FontWeight','bold')
127
124
{% endhighlight %}
125
+
126
+
{% highlight plaintext %}
127
+
RuleOfThumb: 75° KLCV: 24° magicRule: 31°
128
+
RuleOfThumb: 30° KLCV: 12° magicRule: 22°
129
+
RuleOfThumb: 18° KLCV: 8° magicRule: 16°
130
+
RuleOfThumb: 10° KLCV: 6° magicRule: 11°
131
+
RuleOfThumb: 9° KLCV: 5° magicRule: 8°
132
+
RuleOfThumb: 7° KLCV: 4° magicRule: 6°
133
+
{% endhighlight %}
128
134
<center>
129
135
{% include inline_image.html file="OptimalKernel_03.png" %}
{% include inline_image.html file="RBFApproximationTheory_02.png" %}
@@ -69,15 +74,19 @@
69
74
{% endhighlight %}
70
75
71
76
{% highlight plaintext %}
72
-
77
+
minValue =
78
+
1.1635e-06
79
+
meanValue =
80
+
1.0000
73
81
{% endhighlight %}
74
82
<p>One has to keep in mind that we can not expect the error in the data nodes to be zero, because we compute a smooth function from the noisy input data.</p>
75
83
{% highlight matlab %}
76
84
norm(SO3F.eval(ori) - val) / norm(val)
77
85
{% endhighlight %}
78
86
79
87
{% highlight plaintext %}
80
-
88
+
ans =
89
+
0.1639
81
90
{% endhighlight %}
82
91
<p>In contrast, if we do not tell MTEX, that we try to approximate a density function, the solver has less information and the result is not denoised.</p>
83
92
{% highlight matlab %}
@@ -87,7 +96,12 @@
87
96
{% endhighlight %}
88
97
89
98
{% highlight plaintext %}
90
-
99
+
SO3F = SO3FunRBF (1 → xyz)
100
+
101
+
multimodal components
102
+
kernel: de la Vallee Poussin, halfwidth 5°
103
+
center: 119088 orientations, resolution: 5°
104
+
weight: 0.95
91
105
{% endhighlight %}
92
106
<center>
93
107
{% include inline_image.html file="RBFApproximationTheory_03.png" %}
@@ -100,7 +114,12 @@ <h2 id="9">Adjustment of the Kernel Function</h2>
100
114
{% endhighlight %}
101
115
102
116
{% highlight plaintext %}
103
-
117
+
SO3F = SO3FunRBF (1 → xyz)
118
+
119
+
multimodal components
120
+
kernel: de la Vallee Poussin, halfwidth 2°
121
+
center: 1852941 orientations, resolution: 2°
122
+
weight: 1
104
123
{% endhighlight %}
105
124
<center>
106
125
{% include inline_image.html file="RBFApproximationTheory_04.png" %}
@@ -113,7 +132,12 @@ <h2 id="9">Adjustment of the Kernel Function</h2>
113
132
{% endhighlight %}
114
133
115
134
{% highlight plaintext %}
116
-
135
+
SO3F = SO3FunRBF (1 → xyz)
136
+
137
+
multimodal components
138
+
kernel: de la Vallee Poussin, halfwidth 10°
139
+
center: 70038 orientations, resolution: 5°
140
+
weight: 1
117
141
{% endhighlight %}
118
142
<center>
119
143
{% include inline_image.html file="RBFApproximationTheory_05.png" %}
@@ -126,7 +150,17 @@ <h2 id="9">Adjustment of the Kernel Function</h2>
126
150
{% endhighlight %}
127
151
128
152
{% highlight plaintext %}
129
-
153
+
S3G = SO3Grid (1 → xyz)
154
+
grid: 119088 orientations, resolution: 5°
155
+
Warning: Maximum number of iterations reached,
156
+
result may not have converged to the optimum yet.
157
+
158
+
SO3F = SO3FunRBF (1 → xyz)
159
+
160
+
multimodal components
161
+
kernel: de la Vallee Poussin, halfwidth 5°
162
+
center: 72018 orientations, resolution: 5°
163
+
weight: 1
130
164
{% endhighlight %}
131
165
<center>
132
166
{% include inline_image.html file="RBFApproximationTheory_06.png" %}
@@ -147,9 +181,6 @@ <h2 id="9">Adjustment of the Kernel Function</h2>
147
181
ylabel('relative error')
148
182
{% endhighlight %}
149
183
150
-
{% highlight plaintext %}
151
-
152
-
{% endhighlight %}
153
184
<center>
154
185
{% include inline_image.html file="RBFApproximationTheory_07.png" %}
155
186
</center>
@@ -160,7 +191,12 @@ <h2 id="9">Adjustment of the Kernel Function</h2>
160
191
{% endhighlight %}
161
192
162
193
{% highlight plaintext %}
163
-
194
+
SO3F = SO3FunRBF (1 → xyz)
195
+
196
+
multimodal components
197
+
kernel: de la Vallee Poussin, halfwidth 7.5°
198
+
center: 24649 orientations, resolution: 7.5°
199
+
weight: 1
164
200
{% endhighlight %}
165
201
<center>
166
202
{% include inline_image.html file="RBFApproximationTheory_08.png" %}
@@ -173,7 +209,16 @@ <h2 id="9">Adjustment of the Kernel Function</h2>
173
209
{% endhighlight %}
174
210
175
211
{% highlight plaintext %}
176
-
212
+
psi = SO3AbelPoissonKernel
213
+
bandwidth: 48
214
+
halfwidth: 5°
215
+
216
+
SO3F = SO3FunRBF (1 → xyz)
217
+
218
+
multimodal components
219
+
kernel: Abel Poisson, halfwidth 5°
220
+
center: 3989 orientations, resolution: 5°
221
+
weight: 1
177
222
{% endhighlight %}
178
223
<center>
179
224
{% include inline_image.html file="RBFApproximationTheory_09.png" %}
<p>Also, interpolation might not guarantee non-negativity of the function</p>
207
253
{% highlight matlab %}
208
254
minValue = min(SO3F)
209
255
{% endhighlight %}
210
256
211
257
{% highlight plaintext %}
212
-
258
+
minValue =
259
+
-7.6067
213
260
{% endhighlight %}
214
261
<h2id="18">LSQR-Parameters</h2>
215
262
<p>The <codeclass="language-plaintext highlighter-rouge">lsqr</code> solver and the <codeclass="language-plaintext highlighter-rouge">mlsq</code> solver, which are used to minimize the least squares problem from above has some predefined termination conditions. We can specify the method tolerance with the option <codeclass="language-plaintext highlighter-rouge">'tol'</code> (default 1e-3) and the maximum number of iterations by the option <codeclass="language-plaintext highlighter-rouge">'maxit'</code> (default 30/100).</p>
0 commit comments