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

Grains: added grain reconstruction rotation function

parent 89f8b705
No related branches found
No related tags found
No related merge requests found
function [structure, proj] = gtGrainRotateStructure(structure, proj, type, parameters, rot_tensor_angle, rot_axis)
if (any([size(rot_tensor_angle, 1), size(rot_tensor_angle, 2)] == 1))
rot_angle = rot_tensor_angle;
if (~exist('rot_axis', 'var'))
rot_axis = [0 0 1];
end
rot_tensor = eye(3);
for ii = 1:numel(rot_angle)
rotcomp = gtMathsRotationMatrixComp(rot_axis(ii, :)', 'col');
rot_tensor = gtMathsRotationTensor(rot_angle(ii), rotcomp) * rot_tensor;
end
else
rot_tensor = rot_tensor_angle;
end
structure.intensity = gtRotateVolume(structure.intensity, rot_tensor);
switch (upper(type))
case 'ODF6D'
dmvol = structure.voxels_avg_R_vectors;
dmvol(:, :, :, 1) = gtRotateVolume(dmvol(:, :, :, 1), rot_tensor);
dmvol(:, :, :, 2) = gtRotateVolume(dmvol(:, :, :, 2), rot_tensor);
dmvol(:, :, :, 3) = gtRotateVolume(dmvol(:, :, :, 3), rot_tensor);
structure.voxels_avg_R_vectors = dmvol;
case 'VOL3D'
end
proj.centerpix = proj.centerpix * rot_tensor;
structure.shift = gtFwdSimComputeVolumeShifts(proj, parameters, size(structure.intensity));
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