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
292 stars 186 forks source link

odf/calcMIndex may return value larger 1 #152

Closed kilir closed 8 years ago

kilir commented 8 years ago

Hi Ralf, some people enjoy using the m-index, which is defined between 0 and 1. Using calcMIndex on a very sharp texture may return values larger 1.

odf=unimodalODF(orientation('Euler',[0,0,0]*degree,crystalSymmetry('422')),'halfwidth',2.5*degree)
mindex=calcMIndex(odf)
mindex =
    2.3194

As a workaround the mindex can be calculated from individual orientations sampled from the odf - the latter being in most cases the more realistic use case for ebsd data:

o=discreteSample(odf,1000)
calcMIndex(o)
ans =
    0.9984

Cheers, Rüdiger

ralfHielscher commented 8 years ago

The reason here was / is series truncation effects. By default the harmonic series expansion of the MDF was cut at degree 32. I increased the cut of to 64 which gives a reasonable result for the above case. One of the truncation effects was also the occurrence of negative values in the angle distribution which finally resulted in MIndex values larger then 1. By setting all negative values to zero the result will be at least smaller then 1.