Skip to content
Snippets Groups Projects
Commit 7419bd59 authored by Nicola Vigano's avatar Nicola Vigano
Browse files

gtRenderGrains: added optional just-in-time IPF colormap generation

parent ea2d6574
No related branches found
No related tags found
No related merge requests found
......@@ -94,6 +94,7 @@ function [h, gids] = gtRenderGrains(grains, varargin)
% Version 001 by gtTeam
%
par.phase_id = 1;
par.grainids = [];
par.patchmode = 'free_interp';
par.xcut = [];
......@@ -103,6 +104,7 @@ par.xkeep = 1:size(grains,1); % volume is transposed
par.ykeep = 1:size(grains,2); % volume is transposed
par.zkeep = 1:size(grains,3);
par.cmap = [];
par.ipf_axis = [];
par.zmark = [];
par.showaxes = true;
par.showlabel = true;
......@@ -230,9 +232,23 @@ else
h.axes = par.ha;
end
if isempty(par.cmap)
par.cmap = gtRandCmap(max(grainids)+1);
par.cmap(1,:) = [];
if (isempty(par.cmap))
if (~isempty(par.ipf_axis))
cryst_system = parameters.cryst(par.phase_id).crystal_system;
cryst_spacegroup = parameters.cryst(par.phase_id).spacegroup;
symm = gtCrystGetSymmetryOperators(cryst_system, cryst_spacegroup);
sample = GtSample.loadFromFile();
[par.cmap, ~, ~] = gtIPFCmap(par.phase_id, [], ...
'r_vectors', sample.phases{par.phase_id}.R_vector, ...
'crystal_system', cryst_system, ...
'background', false, ...
'symm', symm);
else
par.cmap = gtRandCmap(max(grainids)+1);
par.cmap(1, :) = [];
end
end
set(h.fig, 'Colormap', par.cmap);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment