Medical Image Registration - Transformation matrix in 3D

Gyuha Park·2021년 8월 26일
0

Medical Image Analysis

목록 보기
16/21
post-thumbnail

1. Transformation

1) Translation

[xyz]=[xyz]+[txtytz]\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

Rx(θ)=[1000cosθsinθ0sinθcosθ]R_x(\theta)=\begin{bmatrix} 1 & 0 & 0\\ 0 & \cos\theta & -\sin\theta \\ 0 & \sin\theta & \cos\theta \end{bmatrix}

Ry(θ)=[cosθ0sinθ010sinθ0cosθ]R_y(\theta)=\begin{bmatrix} \cos\theta & 0 & \sin\theta\\ 0 & 1 & 0 \\ -\sin\theta & 0 & \cos\theta \end{bmatrix}

Rz(θ)=[cosθsinθ0sinθcosθ0001]R_z(\theta)=\begin{bmatrix} \cos\theta & -\sin\theta & 0 \\ \sin\theta & \cos\theta & 0 \\ 0 & 0 & 1 \end{bmatrix}

R=Rz(θ3)Ry(θ2)Rx(θ1)R=R_z(\theta_3)R_y(\theta_2)R_x(\theta_1)

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

R(θ)=[ll(1cosθ)+cosθml(1cosθ)nsinθnl(1cosθ)+msinθlm(1cosθ)+nsinθmm(1cosθ)+cosθnm(1cosθ)lsinθln(1cosθ)msinθmn(1cosθ)+lsinθnn(1cosθ)+cosθ]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

[100tx010ty001tz0001]\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

Rx=[10000cosθsinθ00sinθcosθ00001]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

[Sx0000Sy0000Sz00001]\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

[xyz]=[abcdefghi][xyz]+[txtytz]\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}

[xyz1]=[abctxdeftyghitz0001][xyz1]\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}

profile
Live on mission ✞

0개의 댓글