Skip to content
Snippets Groups Projects
Commit cc4e7ccb authored by Yoann Guilhem's avatar Yoann Guilhem Committed by Nicola Vigano
Browse files

Update SST inverse pole figure (IPF) functions (1st commit)

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@972 4c865b51-4357-4376-afb4-474e03ccb993
parent 9374b607
No related branches found
No related tags found
No related merge requests found
function [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm, saturation) function [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm, saturate)
% GTCRYSTVECTOR2SST Moves crystal vectors to SST zone. % GTCRYSTVECTOR2SST Moves crystal vectors to SST zone.
% %
% [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm[, saturation]) % [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm[, saturate])
% ------------------------------------------------------------------------------- % -------------------------------------------------------------------------------
% %
% INPUT: % INPUT:
...@@ -10,7 +10,7 @@ function [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm, satur ...@@ -10,7 +10,7 @@ function [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm, satur
% symm = <cell_array> Symmetry operators % symm = <cell_array> Symmetry operators
% %
% OPTINAL INPUT: % OPTINAL INPUT:
% saturation = <logical> Saturate or not the RGB output {true} % saturate = <logical> Saturate or not the RGB output {true}
% %
% OUTPUT: % OUTPUT:
% rgb = <double> RGB colors in the SST triangle % rgb = <double> RGB colors in the SST triangle
...@@ -20,8 +20,8 @@ function [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm, satur ...@@ -20,8 +20,8 @@ function [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm, satur
% %
% Version 001 15-10-2012 by YGuilhem % Version 001 15-10-2012 by YGuilhem
if ~exist('saturation', 'var') || isempty(saturation) if ~exist('saturate', 'var') || isempty(saturate)
saturation = true; saturate = true;
end end
% Normalize vectors? % Normalize vectors?
...@@ -57,7 +57,7 @@ function [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm, satur ...@@ -57,7 +57,7 @@ function [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm, satur
switch crystal_system switch crystal_system
case {'cubic', 'cub'} case {'cubic', 'cub'}
anglesR = 45 - Vc_chi; % red color proportional to (45-chi) anglesR = 45 - Vc_chi; % red color proportional to (45 - chi)
minAngleR = 0; minAngleR = 0;
maxAngleR = 45; maxAngleR = 45;
anglesB = Vc_phi; % blue color proportional to phi anglesB = Vc_phi; % blue color proportional to phi
...@@ -120,7 +120,8 @@ function [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm, satur ...@@ -120,7 +120,8 @@ function [rgb, Vsst, Vsst_p] = gtCrystVector2SST(Vc, crystal_system, symm, satur
blue = (maxAngleR - angleR)/maxAngleR .* angleB/maxAngleB; blue = (maxAngleR - angleR)/maxAngleR .* angleB/maxAngleB;
rgb = [red green blue]; rgb = [red green blue];
if saturation if saturate
rgb = sqrt(rgb);
sat = max(rgb, [], 2); sat = max(rgb, [], 2);
rgb = rgb./sat(:, [1 1 1]); rgb = rgb./sat(:, [1 1 1]);
end end
......
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