Understanding the maths of Computed Tomography (CT) scans

收藏待读

Understanding the maths of Computed Tomography (CT) scans

Understanding the maths of Computed Tomography (CT) scans Noseman is having a headache and as an old-school hypochondriac he goes to see his doctor. His doctor is quite worried and makes an appointment with a radiologist for Noseman to get a CT scan.

Understanding the maths of Computed Tomography (CT) scans
Modern CT scanner by Siemens

Because Noseman always wants to know how things work he asks the radiologist about the inner workings of a CT scanner.

The basic idea is that X-rays are fired from one side of the scanner to the other. Because different sorts of tissue (like bones, brain cells, cartilage etc.) block different amounts of the X-rays the intensity measured on the other side varies accordingly.

The problem is of course that a single picture cannot give the full details of what is inside the body because it is a combination of different sorts of tissue in the way of the respective X-rays. The solution is to rotate the scanner and combine the different slices.

How, you ask? Good old linear algebra to the rescue!

We start with the initial position and fire X-rays with an intensity of 30 (just a number for illustrative purposes) through the body:

Understanding the maths of Computed Tomography (CT) scans
Initial position

As can be seen in the picture the upper ray goes through areas 1, 2 and 3 and let』s say that the intensity value of 12 is measured on the other side of the scanner:

 

or

 

The rest of the formula is found accordingly:

  Understanding the maths of Computed Tomography (CT) scans

We then rotate the scanner for the first time…

Understanding the maths of Computed Tomography (CT) scans
Position after first rotation

…which gives the following formula:

  Understanding the maths of Computed Tomography (CT) scans

And a second rotation…

Understanding the maths of Computed Tomography (CT) scans
Position after second rotation

…yields the following formula:

  Understanding the maths of Computed Tomography (CT) scans

Now we are combining all three systems of equations:

  Understanding the maths of Computed Tomography (CT) scans

or written out in full:

  Understanding the maths of Computed Tomography (CT) scans

Here is the data of the matrixfor you to download:ct-scan.txt).

We now have 9 equations with 9 unknown variables… which should easily be solvable by R, which can also depict the solution as a gray-scaled image… the actual CT-scan!

A <- read.csv("data/ct-scan.txt")
b <- c(18, 21, 18, 18, 21, 9, 18, 14, 16)
v <- solve(A, b)
matrix(v, ncol = 3, byrow = TRUE)
##      [,1] [,2] [,3]
## [1,]    9    9    0
## [2,]    9    5    7
## [3,]    9    9    0
image(matrix(v, ncol = 3), col = gray(4:0 / 4))
Understanding the maths of Computed Tomography (CT) scans
CT of Noseman

The radiologist looks at the picture… and has good news for Noseman: everything is how it should be! Noseman is relieved and his headache is much better now…

Real CT scans make use of the same basic principles (of course with a lot of additional engineering and maths magic 😉 )

Here are real images of CT scans of a human brain…

Understanding the maths of Computed Tomography (CT) scans
Source: Wikimedia

… which can be combined into a 3D-animation:

Understanding the maths of Computed Tomography (CT) scans
Source: Wikimedia

Isn』t it fascinating how a little bit of maths can save lives!

原文 : Learning Machines

相關閱讀

免责声明:本文内容来源于Learning Machines,已注明原文出处和链接,文章观点不代表立场,如若侵犯到您的权益,或涉不实谣言,敬请向我们提出检举。