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

pixel ospace visualization, fixed bug

parent ba4833a4
No related branches found
No related tags found
No related merge requests found
...@@ -40,7 +40,9 @@ function gt6DAnalyseVoxelProperties(test_data, result, post_result, voxel, thres ...@@ -40,7 +40,9 @@ function gt6DAnalyseVoxelProperties(test_data, result, post_result, voxel, thres
cum_sum_ints = cumsum(sorted_intensities); cum_sum_ints = cumsum(sorted_intensities);
cum_sum_ints = cum_sum_ints ./ sum(intensities_recon); cum_sum_ints = cum_sum_ints ./ sum(intensities_recon);
first_ind = find(cum_sum_ints > contribution_fraction, 1, 'first'); contribution_fraction = max(min(contribution_fraction, 1), 0);
first_ind = find(cum_sum_ints >= contribution_fraction, 1, 'first');
threshold_min = max(sorted_intensities(first_ind), threshold_min); threshold_min = max(sorted_intensities(first_ind), threshold_min);
end end
...@@ -48,28 +50,20 @@ function gt6DAnalyseVoxelProperties(test_data, result, post_result, voxel, thres ...@@ -48,28 +50,20 @@ function gt6DAnalyseVoxelProperties(test_data, result, post_result, voxel, thres
sampled_R_vecs = cat(1, gr.R_vector); sampled_R_vecs = cat(1, gr.R_vector);
f = figure('Name', sprintf('Orientation-space at: (%d, %d, %d), intensity: %g', voxel, sum(intensities_recon)) ); f = figure('Name', sprintf('Orientation-space at: (%d, %d, %d), intensity: %g', voxel, sum(intensities_recon)) );
plot_for_figure = true; ax = axes('parent', f);
if (~plot_for_figure)
ax2 = subplot(1, 4, 1, 'parent', f);
plot(ax2, intensities_recon);
ax1 = subplot(1, 4, [2 3 4], 'parent', f);
else
ax1 = axes('parent', f);
set(f, 'Units', 'centimeters') set(f, 'Units', 'centimeters')
set(ax1, 'Units', 'centimeters') set(ax, 'Units', 'centimeters')
set(f, 'Position', [0 0 25 13.5]) set(f, 'Position', [0 0 25 13.5])
set(f, 'Paperposition', [0 0 25 13.5]) set(f, 'Paperposition', [0 0 25 13.5])
set(ax1, 'Position', [2.25 1 16.25 12]) set(ax, 'Position', [2.25 1 16.25 12])
end scatter3(ax, [], [], []);
scatter3(ax1, [], [], []);
hold(ax1, 'on'); hold(ax, 'on');
show_bbox(ax1, sampled_R_vecs, show_base_grid); show_bbox(ax, sampled_R_vecs, show_base_grid);
% % Show all the lattice % % Show all the lattice
% scatter3(ax, sampled_R_vecs(:, 1), sampled_R_vecs(:, 2), sampled_R_vecs(:, 3), 30, 'm'); % scatter3(ax, sampled_R_vecs(:, 1), sampled_R_vecs(:, 2), sampled_R_vecs(:, 3), 30, 'm');
...@@ -79,11 +73,11 @@ function gt6DAnalyseVoxelProperties(test_data, result, post_result, voxel, thres ...@@ -79,11 +73,11 @@ function gt6DAnalyseVoxelProperties(test_data, result, post_result, voxel, thres
else else
devs_dmvol = []; devs_dmvol = [];
end end
theo_R_vec = show_theoretical_orientation(ax1, theo_voxel, result.expected_dmvol, devs_dmvol); theo_R_vec = show_theoretical_orientation(ax, theo_voxel, result.expected_dmvol, devs_dmvol);
show_average_orientation(ax1, sampled_R_vecs, intensities_recon, theo_R_vec); show_average_orientation(ax, sampled_R_vecs, intensities_recon, theo_R_vec);
% show_orientations_plain_main(ax1, sampled_R_vecs, intensities_recon, threshold_min, threshold_max); % show_orientations_plain_main(ax1, sampled_R_vecs, intensities_recon, threshold_min, threshold_max);
show_orientation_colormap(ax1, sampled_R_vecs, intensities_recon, jet(), threshold_min); show_orientation_colormap(ax, sampled_R_vecs, intensities_recon, jet(), threshold_min);
lower_lims = min(sampled_R_vecs, [], 1); lower_lims = min(sampled_R_vecs, [], 1);
upper_lims = max(sampled_R_vecs, [], 1); upper_lims = max(sampled_R_vecs, [], 1);
...@@ -97,12 +91,12 @@ function gt6DAnalyseVoxelProperties(test_data, result, post_result, voxel, thres ...@@ -97,12 +91,12 @@ function gt6DAnalyseVoxelProperties(test_data, result, post_result, voxel, thres
lower_lims = lower_lims - padding; lower_lims = lower_lims - padding;
upper_lims = upper_lims + padding; upper_lims = upper_lims + padding;
set(ax1, 'FontSize', 18) set(ax, 'FontSize', 18)
set(ax1, 'XLim', [lower_lims(1), upper_lims(1)]) set(ax, 'XLim', [lower_lims(1), upper_lims(1)])
set(ax1, 'YLim', [lower_lims(2), upper_lims(2)]) set(ax, 'YLim', [lower_lims(2), upper_lims(2)])
set(ax1, 'ZLim', [lower_lims(3), upper_lims(3)]) set(ax, 'ZLim', [lower_lims(3), upper_lims(3)])
hold(ax1, 'off'); hold(ax, 'off');
end end
function r_vec = show_theoretical_orientation(ax, voxel_pos, dmvol, dev_dmvol) function r_vec = show_theoretical_orientation(ax, voxel_pos, dmvol, dev_dmvol)
......
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