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

Calc modes of axes of misorientation #93

Closed filippeof closed 6 years ago

filippeof commented 9 years ago

Dear Ralf, As discussed on the Belo Horizonte´s workshop, i would like to calculate modes of axes of misorientation in a similar manner as the function calcModes for orientations. The following code(v. 4.0) would reproduce the expected data:

mis = calcMisorientation(ebsd('Magnesium'));
axes = axis(mis);angles = angle(mis);   
plot(axes(angles>(58)*degree & angles<63*degree),'antipodal','contourf','fundamentalRegion') ;

ax2=calcModes(axes(angles>(58)*degree & angles<63*degree),2); %in order to theoretically get the main 2 maxima.

Best Regards,

Filippe.

zmichels commented 9 years ago

Filippe,

Would it work to calculate the mode for the misorientation themselves, and then extract the axis of that mode mis/orientation?

Best, Zach

On Sep 19, 2015, at 2:07 PM, Filippe Ferreira notifications@github.com<mailto:notifications@github.com> wrote:

Dear Ralf, As discussed on the Belo Horizonte?s workshop, i would like to calculate modes of axes of misorientation in a similar manner as the function calcModes for orientations. The following code(v. 4.0) would reproduce the expected data:

mis = calcMisorientation(ebsd('Magnesium'));
axes = axis(mis);angles = angle(mis);

plot(axes(angles>(58)degree & angles<63degree),'antipodal','contourf','fundamentalRegion') ;

ax2=calcModes(axes(angles>(10)degree & angles<20degree),2); %in order to theoretically get the main 2 maxima.

Best Regards,

Filippe.

Reply to this email directly or view it on GitHubhttps://github.com/mtex-toolbox/mtex/issues/93.

zmichels commented 9 years ago

Alternatively... Could you use kernel density estimation of the population of axial data and try to identify peaks/maxima?

zmichels commented 9 years ago

I don't know any of the following helps, but it was fun to give it a shot on my break. Cheers! Zach

%% Set to your desired phase
phase = 'Magnesium';

%% PART 1: Mode first from misorientations
% This approach may not be what you are wanting, but it does not divorce
% the axes from their orientations prior to identifying the modes... and as
% such, I wonder if it might be more meaningful than first isolating the
% axes and then trying to calculate a mode. Degrees of freedom issue...

%% Calculate the misorientations
mis = calcMisorientation(ebsd(phase));

%% Select the misorientations you are concerned with (from your post)
mis_want=mis(angle(mis)>10*degree&angle(mis)<20*degree);

%% Calculate an ODF from which to calculate a mode
misodf=calcODF(mis_want);

%% Calculate modes
mis_mode=calcModes(misodf,2);

%%
ax = axis(mis_mode);

%% PART 2: KDE
% The version of this approach below does not allow for multimodes (but I
% imagine there is a way around this). This method tries to do what you
% asked by first divorcing the axes from the misorientations and then use
% directional statistics (kde) on those axial data to identify a preferred
% axial direction.

%% Try a kernel density estimation approach for the misorientation axes
% Get all the axes
axx = axis(mis);

% kernel density estimation
kde = kernelDensityEstimation(axis(mis),axis(mis),'antipodal','halfwidth',10*degree);

% identify a preferred orientation
[~,I]=max(kde);
axx_max=axx(I);
filippeof commented 9 years ago

Hi Zach! Thanks for your prompt answer! Both solutions seems to work fine! I would just add round(axx) in order to get more pleasant results. Thanks and I am glad that you had fun solving it! Regards, Filippe.

zmichels commented 9 years ago

Filippe,

I'm glad it worked for you. Cheers!

Z

ralfHielscher commented 6 years ago

MTEX 5.0 implements are multiple modes for S2Fun