Selecting grains containing special boundaries

249 views
Skip to first unread message

Dorian Depriester

unread,
Apr 4, 2013, 3:23:39 AM4/4/13
to mtex...@googlegroups.com
Hello there!
  I would like to characterize few grains which display special boundaries (twinning, actually). Those grains have been constructed from EBSD data. First, I want to extract those grains in a new grainSet, and then perform a texture analysis on it.
I manage to get the faces corresponding to twin planes with:
rot19c=rotation('axis',vector3d(Miller(0,1,-1,0)),'angle',86.98*degree);
f
=specialBoundary(grains,rot19c);

My idea was to merge the grains considering those boundaries and then try a boolean operation to remove the non-merged grains. But due to the large number of orientations of my map (over 130,000), when I type:
[merged_grains,I_PC] = merge(grains,rot19c);

I get the following error:
 Maximum variable size allowed by the program is exceeded.

Is there any other (simpler) way to extract those special grains? (using there locations, for instance...)

Thank you very much.

Dorian Depriester

unread,
Apr 4, 2013, 11:37:15 AM4/4/13
to mtex...@googlegroups.com
Finally, I got rid of this problem by manually selecting my twinned grains (fortunately, the few ones...). But instead of using their locations, I have used their indexes, after displaying them:

centers=centroid(grains);
figure
plot
(grains)
for i=1:size(centers,1)
    text
(centers(i,1),centers(i,2),sprintf('%i',i) )
end

The 'text' command allows us to zoom on the map without changing the font size.

I'm not that proud of this means, but it solved my problem!

Regards.

Ralf Hielscher

unread,
Apr 4, 2013, 4:41:42 PM4/4/13
to mtex...@googlegroups.com
Hi Dorian,

thank you for this nice question. Your first step to compute the special boundaries was correct. 

rot19c=rotation('axis',vector3d(Miller(0,1,-1,0)),'angle',86.98*degree);
f=specialBoundary(grains,rot19c);

Having the special boundaries you want to know to which grains they belong. This relationship is stored in a huge sparse incidence matrix which can be extracted from the grain variable.

I_FG = get(grains,'I_FG');

This matrix has as many rows a grain edges and as many columns as grains. A one indicates that a edge belongs to a grain. Thus all we have to do is look at the rows indicated by f and find all columns that have a one there. This is done by the command

twin_ids = find(any(I_FG(f,:),1));

Finally, you can extract your grains by

twins = grains(twin_ids)

Hope this helps,

Ralf.

Dorian Depriester

unread,
Apr 11, 2013, 3:47:53 AM4/11/13
to mtex...@googlegroups.com
Thank you very much for your quick answer, it really helped. This way is much easier (and smarter) than mine !
This is a very convenient feature.

Best regards.
Reply all
Reply to author
Forward
0 new messages