[390c2f]: / Cobiveco / utilities / cobiveco_applyAlignmentMatrix.m

Download this file

23 lines (21 with data), 646 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function vtk = cobiveco_applyAlignmentMatrix(vtk, R)
% Transforms a heart mesh using an alignment matrix as computed by cobiveco.
% After alignment, the heart axes should be parallel to x,y,z and the heart
% should be centered at (0,0,0).
%
% Syntax:
% vtk = cobiveco_applyAlignmentMatrix(vtk, R)
%
% Inputs:
% - vtk: VTK struct of the heart mesh
% - R: alignment matrix as computed by cobiveco
%
% Output:
% - vtk: VTK struct of the transformed heart mesh
%
% Written in 2020 by Steffen Schuler
% Institute of Biomedical Engineering, KIT
% www.ibt.kit.edu
vtk.points = [vtk.points ones(size(vtk.points,1),1)]*R';
vtk.points(:,end) = [];
end