Merge twins on selection of grains

303 views
Skip to first unread message

niels cautaerts

unread,
Feb 9, 2017, 7:17:10 AM2/9/17
to MTEX
Hi,

I am investigating the recrystallization behavior of a certain austenitic steel. My maps thus contain original highly deformed grains, as well as recrystallized grains. I can distinguish between these grains by filtering on the GOS variable.

I wish to learn more about the size evolution of my recrystallized grains. However, the recrystallized grains are prone to forming annealing twins, which gives the false impression that the grains are really small. I wish to merge the recrystallized grains on twin boundaries, then study the size of these merged grains. However, I get the following error when trying to use merge():

Error in grain2d/merge (line 45)
A
=
sparse
(mergeId(:,1),mergeId(:,2),1,length(grains),length(grains));



Here is my code:

%split off the recrystallized grains
rgos
= 0.02;
grains
= grains(grains.GOS<rgos);

CS
= grains.CS;
gB
= grains.boundary;
gbA
= gB('Aus', 'Aus');
%The twinning orientation defined by two parralel directions
twinning
= orientation('map', Miller(1, 1, 1, CS), Miller(1, 1, 1, CS), Miller(1, -1, 0, CS), Miller(-1, 1, 0, CS));
%bound for twinning in degrees
bdt
=5;
isTwinning
= angle(gbA.misorientation, twinning) < bdt*degree;
twinBoundary
= gbA(isTwinning);

%merge the grains, update id
[mergedGrains, parentId] = merge(grains, twinBoundary);

Is there a way to work around this issue? I have tried merging before filtering, which works fine, but then I can't filter the merged grains based on GOS anymore. In attachment is a GOS plot with the twin boundaries highlighted white, other boundaries red. The recrystallized grains are the deep blue ones.

Thanks for your reply and your amazing library!
GOSGBTWIN.tif

Rüdiger Kilian

unread,
Feb 9, 2017, 11:48:29 AM2/9/17
to mtex...@googlegroups.com
Hi,
I'd guess you need to recalculate the grains before merging after you have deleted some of those:
ebsd = ebsd(selectedgrains)
[grains,ebsd.grainId]=calcgrains(ebsd,'angle', xyy, 'unitcell')
Cheers,
Rüdiger

From: mtex...@googlegroups.com [mtex...@googlegroups.com] on behalf of niels cautaerts [caut...@gmail.com]
Sent: Thursday, February 09, 2017 1:17 PM
To: MTEX
Subject: {MTEX} Merge twins on selection of grains

--
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.
Visit this group at https://groups.google.com/group/mtexmail.
For more options, visit https://groups.google.com/d/optout.

niels cautaerts

unread,
Feb 9, 2017, 5:53:04 PM2/9/17
to MTEX, ruedige...@unibas.ch
Dear Rüdiger,

Unfortunately this doesn't work. When I filter the ebsd data and recalculate grains, it tries to fill up the whole picture with grains even though only about 20% of the picture belongs to these recrystallized grains.

After many hours of playing I finally found something that seems to work, though it is quite convoluted.

Basically I perform an extra filter on the grainboundaries before I pass it onto the merge command. This to my knowledge is not so easy to do with anything else but angles and phase boundaries. I make a logical array that says both elements of a row of the grainId need to be in the list of id's of the recrystallized grains. Here is my code.

%filter off the recrystallized grains in grainsrec
grainsrec
= grains(grains.GOS<0.02);
gb
=grainsrec.boundary('Aus', 'Aus');


twinning
= orientation('map', Miller(1, 1, 1, CS), Miller(1, 1, 1, CS), Miller(1, -1, 0, CS), Miller(-1, 1, 0, CS));

isTwinning
= angle(gb.misorientation, twinning) < 1*degree;

%only merge inside recrystallized grains. Therefore only the grain
%boundaries touching only recrystallized grains can be used.
%make a logical matrix to see which gb touch a recrystallized grain
isrecbound
= ismember(gb.grainId, grainsRec.id);
%both columns must be one
bothRec
=isrecbound(:,1) & isrecbound(:,2);
bothRec
= [bothRec, bothRec];

[mergedGrainsrec, parentId] = merge(grains, gb(isTwinning & bothRec), 'calcMeanOrientation');

This merges only on twinning boundaries inside recrystallized grains. Now I still need to figure out how to separate the merged recrystallized grains from the other grains; merge didn't work with "grainsrec" as argument, only with "grains".

Are you part of the development team? Maybe the merge command could be enhanced to deal with cases like this?

Anyways, thanks for the fast response!
mergedTwins.tif

niels cautaerts

unread,
Feb 9, 2017, 6:11:12 PM2/9/17
to MTEX, ruedige...@unibas.ch
Just found out how to re-find the grains as well:
%Re-find all the grains with GOS<0.02
grains
.id = parentId;
mergedgrainsid
= grains(grains.GOS<0.02).id;
mergedGrainsrec
=mergedGrains(unique(mergedgrainsid));
onlyRecMerged.tif
Reply all
Reply to author
Forward
0 new messages