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

EBSD/CTF-files: fixed mask loading

parent e9460a84
No related branches found
No related tags found
No related merge requests found
function [EBSD_e_map, EBSD_r_map, mask] = gtReadEBSDMapEulerCTFFile(filename, axes_perm, permute_maps, stretch_axes, phase_id) function [EBSD_e_map, EBSD_r_map, EBSD_mask] = gtReadEBSDMapEulerCTFFile(filename, axes_perm, permute_maps, stretch_axes, phase_id)
% function [EBSD_e_map, EBSD_r_map] = gtReadEBSDMapEulerCSVFile(filename, axes_perm, permute_maps) % function [EBSD_e_map, EBSD_r_map] = gtReadEBSDMapEulerCSVFile(filename, axes_perm, permute_maps)
% Axes permutation allows to easily deal with different reference % Axes permutation allows to easily deal with different reference
% systems, like for instance: % systems, like for instance:
...@@ -92,19 +92,21 @@ function [EBSD_e_map, EBSD_r_map, mask] = gtReadEBSDMapEulerCTFFile(filename, ax ...@@ -92,19 +92,21 @@ function [EBSD_e_map, EBSD_r_map, mask] = gtReadEBSDMapEulerCTFFile(filename, ax
negative = axes_perm < 0; negative = axes_perm < 0;
EBSD_r_map(:, :, negative) = - EBSD_r_map(:, :, negative); EBSD_r_map(:, :, negative) = - EBSD_r_map(:, :, negative);
mask = input(:, 1); EBSD_mask = input(:, 1);
mask = reshape(mask, sizes); EBSD_mask = reshape(EBSD_mask, sizes);
if (any(stretch_axes ~= 1)) if (any(stretch_axes ~= 1))
EBSD_e_map = imresize(EBSD_e_map, 'nearest', 'scale', stretch_axes); EBSD_e_map = imresize(EBSD_e_map, 'nearest', 'scale', stretch_axes);
EBSD_r_map = imresize(EBSD_r_map, 'nearest', 'scale', stretch_axes); EBSD_r_map = imresize(EBSD_r_map, 'nearest', 'scale', stretch_axes);
mask = imresize(mask, 'scale', stretch_axes); EBSD_mask = imresize(EBSD_mask, 'nearest', 'scale', stretch_axes);
end end
EBSD_mask = logical(EBSD_mask);
if (permute_maps) if (permute_maps)
EBSD_e_map = permute(EBSD_e_map, [2 1 3]); EBSD_e_map = permute(EBSD_e_map, [2 1 3]);
EBSD_r_map = permute(EBSD_r_map, [2 1 3]); EBSD_r_map = permute(EBSD_r_map, [2 1 3]);
mask = mask'; EBSD_mask = EBSD_mask';
end end
fprintf('\b\b, Done in %f seconds.\n', toc(c)); fprintf('\b\b, Done in %f seconds.\n', toc(c));
......
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