Medical Image Registration - Transformation matrix in 3D

Gyuha Park·2021년 8월 26일
0

목록 보기
16/21

1. Transformation

1) Translation

$\begin{bmatrix} x'\\y'\\z' \end{bmatrix}=\begin{bmatrix} x\\y\\z \end{bmatrix}+\begin{bmatrix} t_x\\t_y\\t_z \end{bmatrix}$

2) Rotation

$R_x(\theta)=\begin{bmatrix} 1 & 0 & 0\\ 0 & \cos\theta & -\sin\theta \\ 0 & \sin\theta & \cos\theta \end{bmatrix}$

$R_y(\theta)=\begin{bmatrix} \cos\theta & 0 & \sin\theta\\ 0 & 1 & 0 \\ -\sin\theta & 0 & \cos\theta \end{bmatrix}$

$R_z(\theta)=\begin{bmatrix} \cos\theta & -\sin\theta & 0 \\ \sin\theta & \cos\theta & 0 \\ 0 & 0 & 1 \end{bmatrix}$

$R=R_z(\theta_3)R_y(\theta_2)R_x(\theta_1)$

아래 식과 같이 일반화도 가능하다. 만약 $R_x$를 구하고자 한다면 $(1, 0, 0)$$(l,m,n)$에 대입하면 된다. 또한 X, Y, Z 축이 아니더라도 $(\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}},0)$과 같은 특수한 경우에도 $(l,m,n)$에 대입하면 계산이 가능하다.

$R(\theta)=\begin{bmatrix} ll(1-\cos\theta)+\cos\theta & ml(1-\cos\theta)-n\sin\theta & nl(1-\cos\theta)+m\sin\theta \\ lm(1-\cos\theta)+n\sin\theta & mm(1-\cos\theta)+\cos\theta & nm(1-\cos\theta)-l\sin\theta \\ ln(1-\cos\theta)-m\sin\theta & mn(1-\cos\theta)+l\sin\theta & nn(1-\cos\theta)+\cos\theta \end{bmatrix}$

2. Transformation Matrix

1) Translation

$\begin{bmatrix} 1 & 0 & 0 & t_x\\ 0 & 1 & 0 & t_y \\ 0 & 0 & 1 & t_z \\ 0 & 0 & 0 & 1 \end{bmatrix}$

2) Rotation

$R_x = \begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & \cos\theta & -\sin\theta & 0 \\ 0 & \sin\theta & \cos\theta & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}$

3) Scaling

$\begin{bmatrix} S_x & 0 & 0 & 0\\ 0 & S_y & 0 & 0 \\ 0 & 0 & S_z & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}$

4) Affine transformation

$\begin{bmatrix} x'\\y'\\z' \end{bmatrix}=\begin{bmatrix} a & b & c\\ d & e & f \\ g & h & i \end{bmatrix}\begin{bmatrix} x\\y\\z \end{bmatrix}+\begin{bmatrix} t_x\\t_y\\t_z \end{bmatrix}$

$\begin{bmatrix} x'\\y'\\z'\\1 \end{bmatrix}=\begin{bmatrix} a & b & c & t_x\\ d & e & f & t_y\\ g & h & i & t_z\\ 0 & 0 & 0 & 1 \end{bmatrix}\begin{bmatrix} x\\y\\z\\1 \end{bmatrix}$