Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DCT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
graintracking
DCT
Commits
909159ce
Commit
909159ce
authored
9 years ago
by
Nicola Vigano
Browse files
Options
Downloads
Patches
Plain Diff
EBSD Viewer: added grain average R-vector calculation
Signed-off-by:
Nicola Vigano
<
nicola.vigano@esrf.fr
>
parent
c7590c3e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
zUtil_Deformation/gtDefEBSDSegmentGrainFromSeed.m
+4
-1
4 additions, 1 deletion
zUtil_Deformation/gtDefEBSDSegmentGrainFromSeed.m
zUtil_TomoUtils/GtEBSDView.m
+23
-0
23 additions, 0 deletions
zUtil_TomoUtils/GtEBSDView.m
with
27 additions
and
1 deletion
zUtil_Deformation/gtDefEBSDSegmentGrainFromSeed.m
+
4
−
1
View file @
909159ce
function
[
grain_r_vecs
,
grain_mask
,
grain_bb
]
=
gtDefEBSDSegmentGrainFromSeed
(
EBSD_r_map
,
EBSD_mask
,
seed
,
threshold
)
function
[
grain_r_vecs
,
grain_mask
,
grain_bb
,
grain_avg_r_vec
]
=
gtDefEBSDSegmentGrainFromSeed
(
EBSD_r_map
,
EBSD_mask
,
seed
,
threshold
)
if
(
~
exist
(
'threshold'
,
'var'
)
||
isempty
(
threshold
))
if
(
~
exist
(
'threshold'
,
'var'
)
||
isempty
(
threshold
))
threshold
=
5
;
threshold
=
5
;
end
end
...
@@ -53,4 +53,7 @@ function [grain_r_vecs, grain_mask, grain_bb] = gtDefEBSDSegmentGrainFromSeed(EB
...
@@ -53,4 +53,7 @@ function [grain_r_vecs, grain_mask, grain_bb] = gtDefEBSDSegmentGrainFromSeed(EB
grain_r_vecs
=
zeros
([
size
(
grain_mask
),
3
],
'single'
);
grain_r_vecs
=
zeros
([
size
(
grain_mask
),
3
],
'single'
);
grain_r_vecs
(
grain_inds
)
=
EBSD_r_map
(
full_grain_inds
);
grain_r_vecs
(
grain_inds
)
=
EBSD_r_map
(
full_grain_inds
);
r_vecs
=
reshape
(
grain_r_vecs
(
grain_inds
),
[],
3
);
grain_avg_r_vec
=
sum
(
r_vecs
,
1
)
/
size
(
r_vecs
,
1
);
end
end
This diff is collapsed.
Click to expand it.
zUtil_TomoUtils/GtEBSDView.m
+
23
−
0
View file @
909159ce
...
@@ -181,6 +181,10 @@ classdef GtEBSDView < GtBaseGuiElem
...
@@ -181,6 +181,10 @@ classdef GtEBSDView < GtBaseGuiElem
obj
.
conf
.
h_menu_items
{
end
+
1
}
=
uimenu
(
obj
.
conf
.
h_context_menu
,
...
obj
.
conf
.
h_menu_items
{
end
+
1
}
=
uimenu
(
obj
.
conf
.
h_context_menu
,
...
'Label'
,
'Copy pixel 3D info'
,
...
'Label'
,
'Copy pixel 3D info'
,
...
'Callback'
,
cbk
);
'Callback'
,
cbk
);
cbk
=
@
(
src
,
evt
)
copyGrainAvgRvecInfoToClipboard
(
obj
);
obj
.
conf
.
h_menu_items
{
end
+
1
}
=
uimenu
(
obj
.
conf
.
h_context_menu
,
...
'Label'
,
'Copy grain Average R-vector info'
,
...
'Callback'
,
cbk
);
end
end
function
resetUiComponents
(
obj
)
function
resetUiComponents
(
obj
)
...
@@ -207,6 +211,25 @@ classdef GtEBSDView < GtBaseGuiElem
...
@@ -207,6 +211,25 @@ classdef GtEBSDView < GtBaseGuiElem
clipboard
(
'copy'
,
clipString
);
clipboard
(
'copy'
,
clipString
);
end
end
function
copyGrainAvgRvecInfoToClipboard
(
self
,
verbose
)
if
~
exist
(
'verbose'
,
'var'
)
||
isempty
(
verbose
)
verbose
=
true
;
end
if
(
isfield
(
self
.
conf
,
'clicked_point'
)
&&
~
isempty
(
self
.
conf
.
clicked_point
))
point
=
round
(
self
.
conf
.
clicked_point
);
else
point
=
round
(
self
.
getPixel
());
end
[
grain_r_vecs
,
grain_mask
]
=
gtDefEBSDSegmentGrainFromSeed
(
self
.
conf
.
ebsd_map
,
self
.
conf
.
mask
,
point
);
grain_r_vecs
=
gtDefDmvol2Gvdm
(
permute
(
grain_r_vecs
,
[
1
2
4
3
]));
avg_r_vec
=
sum
(
grain_r_vecs
(:,
grain_mask
(:)),
2
)
.
/
sum
(
grain_mask
(:));
clipString
=
sprintf
(
'(%d, %d) [%g, %g, %g]'
,
point
,
avg_r_vec
'
);
if
(
verbose
)
disp
(
clipString
)
end
clipboard
(
'copy'
,
clipString
);
end
function
doUpdateDisplay
(
obj
)
function
doUpdateDisplay
(
obj
)
% GTVOLVIEW/DOUPDATEDISPLAY Function that actually updates all the
% GTVOLVIEW/DOUPDATEDISPLAY Function that actually updates all the
% visualized GUI components of the GUI element
% visualized GUI components of the GUI element
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment