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

ODF-Plotting: moved to degrees scale and added cluster support

parent ffc58d4a
No related branches found
No related tags found
No related merge requests found
function gt6DPlotReconstructionODF(phase_id, grain_id, percent)
grain_rec = gtLoadGrainRec(phase_id, grain_id);
if (numel(grain_id) > 1)
str_ids = sprintf('_%04d', grain_id);
file_cluster_rec_path = fullfile('4_grains', ...
sprintf('phase_%02d', phase_id), ...
sprintf('grain_cluster_details%s.mat', str_ids));
grain_rec = load(file_cluster_rec_path);
else
grain_rec = gtLoadGrainRec(phase_id, grain_id);
end
if (~isfield(grain_rec, 'SEG'))
grain_rec.SEG = gtLoadGrain(phase_id, grain_id, ...
......@@ -34,13 +42,49 @@ function gt6DPlotReconstructionODF(phase_id, grain_id, percent)
ax2 = subplot(3, 3, 4, 'parent', f);
ax3 = subplot(3, 3, 7, 'parent', f);
imagesc(sum(odf, 3), 'parent', ax1);
imagesc(squeeze(sum(odf, 1)), 'parent', ax2);
imagesc(squeeze(sum(odf, 2)), 'parent', ax3);
if (false)
imagesc(sum(odf, 3)', 'parent', ax1);
imagesc(squeeze(sum(odf, 1))', 'parent', ax2);
imagesc(squeeze(sum(odf, 2))', 'parent', ax3);
else
contourf(sum(odf, 3)', 5, 'parent', ax1)
contourf(squeeze(sum(odf, 1))', 5, 'parent', ax2)
contourf(squeeze(sum(odf, 2))', 5, 'parent', ax3)
end
x_ticks = linspace(1, size(odf, 1), 5);
x_tick_labels = 2 * atand(linspace(grid_points(1), grid_points(4), 5) - sum(grid_points([1 4]))/2);
x_tick_labels = arrayfun(@(x){sprintf('%5.2f', x)}, x_tick_labels);
y_ticks = linspace(1, size(odf, 2), 5);
y_tick_labels = 2 * atand(linspace(grid_points(2), grid_points(5), 5) - sum(grid_points([2 5]))/2);
y_tick_labels = arrayfun(@(x){sprintf('%5.2f', x)}, y_tick_labels);
z_ticks = linspace(1, size(odf, 3), 5);
z_tick_labels = 2 * atand(linspace(grid_points(3), grid_points(6), 5) - sum(grid_points([3 6]))/2);
z_tick_labels = arrayfun(@(x){sprintf('%5.2f', x)}, z_tick_labels);
xlabel(ax1, 'X');
ylabel(ax1, 'Y');
set(ax1, 'XTick', x_ticks);
set(ax1, 'XTickLabel', x_tick_labels);
set(ax1, 'YTick', y_ticks);
set(ax1, 'YTickLabel', y_tick_labels);
xlabel(ax2, 'Y');
ylabel(ax2, 'Z');
set(ax2, 'XTick', y_ticks);
set(ax2, 'XTickLabel', y_tick_labels);
set(ax2, 'YTick', z_ticks);
set(ax2, 'YTickLabel', z_tick_labels);
xlabel(ax3, 'X');
ylabel(ax3, 'Z');
set(ax3, 'XTick', x_ticks);
set(ax3, 'XTickLabel', x_tick_labels);
set(ax3, 'YTick', z_ticks);
set(ax3, 'YTickLabel', z_tick_labels);
title(ax1, 'XY');
title(ax2, 'YZ');
title(ax3, 'XZ');
colormap(ax1, gray);
colormap(ax2, gray);
colormap(ax3, gray);
......@@ -50,13 +94,36 @@ function gt6DPlotReconstructionODF(phase_id, grain_id, percent)
percent = 0.2;
end
thr_value = (max(odf(:)) - min(odf(:))) * percent + min(odf(:));
p = patch(isosurface(odf, thr_value), 'parent', ax4);
p = patch(isosurface(permute(odf, [2 1 3]), thr_value), 'parent', ax4);
set(p, 'FaceColor', 'cyan', 'EdgeColor', 'none')
axis(ax4, 'tight')
camlight('right')
camlight('left')
lighting('gouraud')
x_ticks = linspace(1, size(odf, 1), 15);
x_tick_labels = 2 * atand(linspace(grid_points(1), grid_points(4), 15) - sum(grid_points([1 4]))/2);
x_tick_labels = arrayfun(@(x){sprintf('%5.2f', x)}, x_tick_labels);
y_ticks = linspace(1, size(odf, 2), 15);
y_tick_labels = 2 * atand(linspace(grid_points(2), grid_points(5), 15) - sum(grid_points([2 5]))/2);
y_tick_labels = arrayfun(@(x){sprintf('%5.2f', x)}, y_tick_labels);
z_ticks = linspace(1, size(odf, 3), 15);
z_tick_labels = 2 * atand(linspace(grid_points(3), grid_points(6), 15) - sum(grid_points([3 6]))/2);
z_tick_labels = arrayfun(@(x){sprintf('%5.2f', x)}, z_tick_labels);
xlabel(ax4, 'X');
ylabel(ax4, 'Y');
zlabel(ax4, 'Z');
set(ax4, 'XTick', x_ticks);
set(ax4, 'XTickLabel', x_tick_labels);
set(ax4, 'YTick', y_ticks);
set(ax4, 'YTickLabel', y_tick_labels);
set(ax4, 'ZTick', z_ticks);
set(ax4, 'ZTickLabel', z_tick_labels);
set(f, 'Units', 'centimeters')
pos = get(f, 'Position');
pos(3:4) = pos(3:4) * 1.5;
......
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