Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added option for minPixel #2089

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Conversation

vedadb
Copy link

@vedadb vedadb commented Mar 13, 2024

Added option "minPixel" not to need to do Option 1.
Option 2. just skips the generation of grains object so slight speed up. (performs the same tesselation first run as second)
Option 3 and 4 perform first modified tesselation/graincalculation first run - either as scalar ebsd map (spatialDecomposition.m) or unit cell, and they produce the same grain map. - "major speed up".
Please try

e = ebsd;
e= e.gridify;
e1 = e;

Option 1:
tic
[g,e.grainId] = calcGrains(e);
e(g(g.grainSize<5)) = [];
e=e.gridify;
g=calcGrains(e);
toc

Option 2:
tic
g1 = calcGrains(e1,'minPixel',5);
toc

Option 3:
tic
g2 = calcGrains(e1,'minPixel',5,'byScalar');
toc

Option 4:
tic
g3 = calcGrains(e1,'minPixel',5,'byUnitCell');
toc

% Elapsed time is 29.616039 seconds.
% Elapsed time is 28.059836 seconds.
% Elapsed time is 19.381225 seconds.
% Elapsed time is 17.654077 seconds.

%
% Phase Grains Pixels Mineral Symmetry Crystal reference frame
% 1 3401 635157 Copper m-3m

% g1 = grain2d
%
% Phase Grains Pixels Mineral Symmetry Crystal reference frame
% 1 3401 635157 Copper m-3m
%

% g2 = grain2d
%
% Phase Grains Pixels Mineral Symmetry Crystal reference frame
% 1 3347 634138 Copper m-3m

% g3 = grain2d
%
% Phase Grains Pixels Mineral Symmetry Crystal reference frame
% 1 3347 634138 Copper m-3m

@vedadb
Copy link
Author

vedadb commented Mar 14, 2024

Note: As the ebsd map is changed (pixels removed), the returned grainId size is different from the input ebsd-map size, thus the ebsd-map needs to be returned as well.

e.g.

[grains,ebsd] = calcGrains(ebsd,'minPixel',5);

A quick-fix I implemented for myself was to return the ebsd map instead of grainId if minPixel was specified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant