plotting misorientation in a line

60 views
Skip to first unread message

roghayeh...@gmail.com

unread,
Jan 1, 2021, 12:37:43 AM1/1/21
to MTEX
Hello,

I am using the following code to plot the misorientation  in a line inside a grain.
"
%create a color map of the IPF orientations of the selected material
oM = ipdfHSVOrientationMapping(ebsd('Nickel'));
%define the direction of the ipf
oM.inversePoleFigureDirection = zvector;
%convert the ebsd map orientations to a color based on the IPF
color = oM.orientation2color(ebsd('Nickel').orientations);
figure; plot(ebsd('Nickel'),color);
%select endpoints of a line on the map and store the coordinates
[x,y]=ginput(2);
% create a variable holding the xy of each end of the desired line segment
%first end, last end clicked lineSec =[x(1,:) y(1,:); x(2,:) y(2,:)];
%draw the line on the figure
hold on;
line(x,y,'linewidth',2); hold off;
%The command spatialProfile restricts the EBSD data to this line
ebsd_line = spatialProfile(ebsd('Nickel'),lineSec);
%calculate the angle between the first point of the line and all the points
%on the line
ang= angle(ebsd_line(1).orientations,ebsd_line.orientations)/degree
% plot this angle vs the x position of the point
figure;plot(ebsd_line.x,ang);
% to plot the misorientation gradient, we first calculate the average x position of two adjacent points, and then the misorientation between two adjacent points
xpos=0.5*(ebsd_line.x(1:end-1)+ebsd_line.x(2:end))
yval= angle(ebsd_line(1:end-1).orientations, ebsd_line(2:end).orientations)/degree
hold all;
plot(xpos,yval);
hold off
xlabel('x position'); ylabel('misorientation in degrees') legend('misorientation to reference orientation','orientation gradient') "

However, I am receiving   these errors.
"Error using reshape
To RESHAPE the number of elements must not change.

Error in orientation/dot (line 108)
  d = reshape(d,size(o1));

Error in orientation/angle (line 17)
  omega = real(2*acos(abs(dot(o1,varargin{:}))));"

I was wondering why  I am receiving this errors and how I can fix it. All your comments and help would be appreciated too much.

Regards,

Roghayeh



Ralf Hielscher

unread,
Jan 1, 2021, 12:41:54 AM1/1/21
to MTEX
Hi Roghayeh,

this is an outdated MTEX forum. Please post your question at https://github.com/mtex-toolbox/mtex/discussions

Thank you very much and a happy new year.

Ralf.

PS: please include in you repost the output of ebsd_line

roghayeh nikbakht

unread,
Jan 4, 2021, 1:44:18 PM1/4/21
to mtex...@googlegroups.com
Hello Ralf,

Thank you for your email and happy new year.  Also I would like to thank you for all your help and Congratulate you on MTex toolbox which is amazing.

Regards,

Roghayeh

--
If you want to reduce the number of emails you get through this forum login to https://groups.google.com/forum/?fromgroups=#!forum/mtexmail, click "My membership" and select "Don't send me email updates". You can still get emails on selected topics by staring them.
---
You received this message because you are subscribed to the Google Groups "MTEX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mtexmail+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mtexmail/7f2767ca-3bb0-4c95-9cdc-fc0133bcadf9n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages