1. 1 | P a g e
Optical CT scan
School of Physics
Dublin Institute of Technology
Kevin Street, Dublin 8.
Andrew O’Neill
Dt260/3
Submission date 24/5/13
Supervised by Dr Justin Donnelly
2. 2 | P a g e
Abstract
Computed Tomography or CT is used in a number of applications ranging from
the medical sector to the industrial. The applications in the medical sector
vary; it has been applied to multiple areas which include Ultrasonic imaging,
Magnetic Resonance Imaging and Computed axial Tomography. In the
Industrialsector it has been used in non-destructivetesting and allows for
imaging of nearly any object. CT is also usefulin other areas like astronomy
and archaeology.
In this projectthe studentwas to reconstructa device made by previous
student Barry Haycock. Theapparatus consisted of a laser as the light source
and a photodiode as the detector. The apparatus was built to show a student
step by step how a CT works.
The Iteration method combined with the Radon and iRadon transforms were
used in the reconstruction of an image. Using projections of a sample a 2D slice
can be obtained of a 3D object.
3. 3 | P a g e
Acknowledgements
This project would not have been possible without the input and guidance from
Dr Justin Donnelly.
I want to also thank Ciara O Hara for her help on the photodiode and Fran Pedreschi for
showing me the offset on the DAQ.
Also I would like to thank Fergal Wallace, Philip Hilliard, Michelle Laycock, Paula
McEntaggart, Darren Ryan Keogh and Craig Spence, for their support.
Finally I would like to thank Ali Doyle without whom none of this would have happened.
4. 4 | P a g e
Table of contents
Abstract 2
Acknowledgements 3
Table of Contents 4
Nomenclature 6
1. Introduction
1.1. Invention and creation of Computed tomography 7
1.2 Types of CT Systems 8
1.3 Reconstruction Methods 12
1.4 Limitation of CT 13
1.5 Future of CT 14
2. Theory
2.1 Analytic and Iterative Reconstruction Algorithm 15
2.2 Back Projection 16
2.3 Radon Transform 17
2.4 Inverse Radon 18
3. Apparatus
3.1 Design 19
3.2 Components 20
3.3 Reconstruction 22
3.4 Experimental setup 23
4. Matlab
4.1 Code implemented 24
4.2 Analysis of code 27
4.3National instruments data acquisition code 29
5. 5 | P a g e
5. Apparatus Analysis
5.1 Advantages/disadvantages of setup 30
5.2 Errors and issues 30
5.3 Future work 31
6. Results
6.1 Matlab code data output 32
6.2 iRadon image reconstructions 33
6.3 Radon transform data output 34
7. Discussion and Conclusions
7.1 Discussion 35
7.2 Conclusion 35
References 36
Appendix: Matlab code
(i) Reconstruction program 37
(ii) National instruments program for photodiode 40
Appendix: Data sheets
(i) Photodiode Data Sheet 41
(ii)NIDAQ Data sheet 42
(iii)Laser Data sheet 43
Appendix: Original project proposal 44
6. 6 | P a g e
Nomenclature
(CT) Computed Tomography, Computed Axial Tomography.
(NIDAQ) National Instruments Data Acquisition Card.
(Matlab) Text based computed language. Specifically used to aid solution and graphing of
Logic problems.
(Iteration Reconstruction) Method of image reconstruction
(Matrix) A set a values arranged into column’s and rows stated by user
(MRI) Magnetic Resonance Imaging. A method for imaging tissue using magnetic fields.
(Photodiode) Absorbs light and emits a voltage high when there is more light and low when
it is dark.
(Beam) The ray sum of the laser obtained by the photodiode
(Projection) Group of ray sums that constitute a sweep past the object at one angle
(Projection Angle) The angle of the projection being sampled
(RADON) Computes projections of an image matrix along specified directions
(IRADON) iradon uses the filtered back-projection algorithm to perform the inverse Radon
transform.
(Backprojection) Method of image reconstruction
7. 7 | P a g e
1. Chapter 1 Introduction
1.1 Invention and development of Computed Tomography
Godfrey Hounsfield (1919-2004) Invented theCT. He came up with the
Idea that one could determine what is inside a box/object by taking x-
rays at all angles around the box/object. He constructed a computer that
could take the input of the x-rays at various angles and create an image
of the object in slices. In 1979 Hounsfield and Cormack wereawarded
the Nobel Prizein medicine for the invention of CT. Cormack invented
the algorithmthat complemented Hounsfield’s invention. Below is an
image of the original design implemented by Hounsfield.
Fig1.1 Original designof Hounsfield’s invention
As seen above in fig 1.1 there is a turntable in the centre werethe object
is placed an x-ray sourceis positioned at location (d) and the detector is
at (f).
8. 8 | P a g e
1.2 Types of CT Systems
First Generation Systems
Firstgeneration Systems werethe firsttype implemented as shown in
chapter 1.1 Page 1 created by Hounsfield and the same one that was
implement by Barry Haycock and reconstructed for this project. In
devices of this type took 160 samples per rotation and 180 translations.
This meant that there were justfewer than 30000 measurements per
image.
Fig2.2 1st GenerationSystem.Systemsof thistype neededupto5 minutestogetenough
information forjustone 2d slice The issue withthiswaswhengettingenough2dinformation
to create a 3d image whichcouldtake a few daysdependingonthe detail necessary.
9. 9 | P a g e
Second Generation CT systems
A second generation CT systemhad a narrow fan beam the sizeof around 10
degrees. The machine consisted of multiple detectors and multiple angle
acquisition at each position this meant it had a larger angle rotation however
translation was still required. Even though it was faster than the 1st
Generation
it was still relatively slow at 20s per slice. Below is a image of a 2nd
Generation
System.
Fig3.1 usesa fan beamemittedforincidentradiation,alongwithtwolineardetectorarrays.
10. 10 | P a g e
Third Generation Systems
Also uses a fan beam however it has a wider angle between 50 and 55 degrees.
Ithas multiple rotating detectors ranging from (500-1000). TheSystemwas
rotation only this mean that no translation is required as it’s the detectors that
rotate around the object and not the object moving. This Systemis also much
faster than previous generations, rotating as fast as 0.5s per rotation. This is
the mostcommon modern scanner design used in commercial applications.
The main drawback to this design is that the detectors and the x-rays haveto
be in perfect sync if it’s off slightly then artefacts and errors can occur.
Fig 4.1 As stated above the source and detector have to be in perfect sync to decrease error.
11. 11 | P a g e
Fourth Generation systems
The Fourth generation uses a fan beam like previous generations. The
difference in design between the 3rd
and 4th
generation is that there are static
detectors all around the gantry and only the tube rotates. This is desirable
because it avoids the artefact errors previous stated. The main limitation to
this device is the scattering of x-ray which can also causeartefacts in the
image. Below is an image of a fourth Generation System. Also this device used
slip ring technology which allows for the mapping of a whole object by moving
the detector in the z direction this method is faster and used in medicine to
this day.
Fig1.5 the detectorisstatic and onlythe source moveswhichlimitserrorsthatwere inprevious
generations
12. 12 | P a g e
1.3 Reconstruction Methods
Reconstruction in CT refers to a mathematical process that creates images
fromprojections of x-ray data. This data is acquired by the methods previously
stated in Introduction 1.2. Two major methods of reconstruction areanalytical
reconstruction and iterative reconstruction. Analytical reconstruction is based
on filtered back projection; this is implemented in most CT designs because of
the computational efficiency and stability.
Back projection
The basic theory is that the projections of the x-rays aresummed together
across the path they passed through. A full description will be shown in
Chapter 2.
Iterative Reconstruction
Iterativereconstruction methods were successfully used in the early years of
Ct, but the availability of large computational demands was a factor in
different approaches that wereimplemented. However over the last few years
resurgencein interest in the iterative method has been seen. This is because
computers can now handle this data with speed this is becauseof quad core
technology which can divide the work load over many cores and reducethe
heavy computational component seen in iterative reconstruction. As stated
previously a more in depth look at this approach will be seen in chapter 2.
13. 13 | P a g e
1.4 Limitations of CT
The limits of CT are becoming smaller as advances in technology improve
however there are still draw backs to this device. One of major draw backs is
the issuewith portability the machine is very large and cumbersomeand has
to be in a centred location. Also an object or patient has to immobile during
the scan to prevent any artefacts during scans.
Also it is difficult to monitor and to attend the patient at the sametime which
in turn requires specific equipment and staff. Also if a patient is to large then
they cannot be scanned not because the x-ray wontpenetrate them but
because the machine can’t fit them.
A primary limitation of CT scanning is resolution, approximately 1 centimetre.
A cancer smaller than this cannot be easily detected using Computed
Tomography.
Also the level of radiation received during a CT scan is modest. Also an allergic
reaction can occur with the contrastdyehowever this is rareless than 1% of
patients develop symptoms. CTscans are very expensiveranging from€2500
for abdomen to €4000 for a pelvic scan. Soft- tissuedetails in areas like the
brain and joints can be better evaluated with magnetic resonanceimaging. In
pregnantwomen while CT can be performed safely it is not recommended
because a foetus can be very sensitive to x-ray. Also if a woman is pregnant
and does proceed with the scan shewill be instructed not to breastfeed as the
intravenous dyecould harm the new born child.
Even though there are a lot of drawbacks thebenefits out way the limits it can
detect 9 out of ten liver cancers and is heavily relied on in the medical industry
as a primary diagnostic tool.
14. 14 | P a g e
1.5 Futureof Computed Tomography
The future of CT lies with reducing the radiation dose significantly and
collimating the beam to the intended volume of interest as opposed to a large
sweep of the body which impacts image quality. Also faster CT scans are
becoming the normal with over 256 slices per rotation. Another progress in CT
is the compensation for movement in the patient which will further increase
resolution and diagnostic capabilities. Also the resolution of computed
tomography is always increasing. Sub millimetre resolution is highly desired in
CT; however this comes at a cost of a higher radiation dose. In small animal
imaging it is possibleto do a full body scan at 180umresolution in under a
minute this uses a cone beam orientation.
Developments of portable x-ray sources using carbon nanostructures as field-
emission electron sources generatex-rays whenever required because it does
not have a heater of a filament and doesn’trequire preheating making it more
cost effective. The sourcewill be able to produce more than 300 high
definition X-ray transmission images using justtwo AA batteries. Also the x-ray
sourcecan be inspected immediately as there is no preheating. Also the speed
in which images will be realised will be up to 1/1000 images per second.
Because of such a low demand of power in theory the device will be able to
run via usb on a computer which will also increase processing time as well as
being cost effective as well.
15. 15 | P a g e
Chapter 2 Theory
2.1 Analytic and IterativeReconstruction Algorithm
fig2.1 a diagram of the algorithmthatcomputesthe valuesof pixelsinamatrix giventhe raysums.
How algorithm works is to find values of 4 pixels given values in 6 ray sums.
Differencebetween estimated and measured projections is computed and
divided by number of pixels in a given direction. The resultof this is then added
to the currentestimate. The firststep (c) projectinitial estimate in vertical
direction apply algorithm and update the pixel values. Repeat this for the next
set of angles and a solution will be found when iteration is completed.
However when there are more pixels then more iteration’s are required. This is
the algorithmthat was implemented in this experiment because it is simple to
understand and easy to implement.
16. 16 | P a g e
2.2 Back projection
Back projection works by summing the attenuation of any ray-path to the
pixels that it passes through. Each pixel has added to its value the value of the
attenuation that occurred to each ray that passed through it. This means that
the pixels that contain a denseobject will develop higher values. The main
drawback to this method is the star formation that is all about the object in the
image this is especially prevalent in the projectas only four different
projections wereused. The more projections, theless this starring becomes
apparent. This is due to the way the image reconstructs, thefact that a very
dense object anywherein a samplecauses the increasein each pixel that share
a ray path in any projection. This blurring is known a kernal blurring. Kernal
blurring is a mathematical function that becomes added to all the pixels
around the denseobject (kind of like a set of weights added to the values). The
kernal is a radially symmetrical function 1/r wherer is the distance fromthe
most densepoint.To fix the Kernal blurring a convolution filter is added to the
algorithm. The filter is basically justanother Kernal that is comprised of a set
of numbers to be summed or multiplied by the value of certain pixels.
Fig2.2 Back projectionreconstructsimage bytakingeachview andsmearingitalongthe pathit was
originallyacquired.The resultingimage isablurryversionof the correctimage.
17. 17 | P a g e
2.3 Radon Transform
The radon function computes projections of an image matrix along specified
directions. A projection of a two-dimensionalfunction f(x, y) is a set of line
integrals. The radon function computes the line integrals frombeams in a
certain direction. The beams are spaced 1 pixel unit apart. To representan
image the radon takes multiple, parallel-beam projections of the image at
different angles by rotating the sourceand translating it in the x, y direction.
The figure below demonstrates this.
fig2.3
Where Thetais the rotationangle,x isthe source and, y is the detector.
The Radon Transformcan be defined by
(1)
(2)
Where p is the slope and is its intercept. The resulting image of this is a
sinusoidalwaveof said image. To reconstructthis back into the original then
the inverseradon will need to be implemented.
18. 18 | P a g e
2.4 InverseRadon Transform
The inverse Radon transformor iradon reconstructs the image form projection
data in a two dimensional array. In matlab the algorithm for this is
I=iradon(R, Theta) werethe image is I ,R is the two dimensional array and
theta is the set of angles in degrees. Iradon reconstructs an imagefrom parallel
beam projections like the radon transformhowever it uses the projects
previously calculated by radon to reconstructan image. The reconstruction is
basically filtered back projection however unlike filtered back projection it can
use the original radon transformprojection data and reconstructan image.
Below is an example using radon and iradon
P = phantom(128);
R = radon(P,0:179);
I = iradon(R,0:179) ;
imshow(P)
figure, imshow(I)
fig2.4 Phantomafterreconstruction
Fig2.5 Phantombefore reconstruction
P=phantom(128) this sets whatthe image is and its size.
R = radon(P,0:179) this tells the radon to scan from0 degrees to 179
I = iradon(R,0:179); takes theprojection data R fromthe radon in the
previous line and reconstructs image imshow(P) gives a visual
representation of Phantom then imshow (I) shows theiradon’s
reconstructed image.
19. 19 | P a g e
Chapter 3 Apparatus
Design setup 3.1
The design consists of a laser that is fixed to a retort stand that is directed
toward a photodiode between this is a turntable that can be adjusted in the
x, y direction and also rotated 360 degrees. Ithas to be able to move in the x, y
direction because there is only one beam so being able to adjustthe x and y
allows for multiple beams to be used. This is controlled manually by the user
which brings about a lot of error. Originally the design had a programthat set
the x, y plotter automatically however this was outdated and unusable. The
solution to this issuewill be discussed in chapter 3.3. The photodiode absorbs
light and gives a voltage output. The output of the photodiodeis connected to
the X, Y plotter then in turn connected to the National Instruments Data
Acquisition Card. This card along with a programin Matlab obtains this voltage
data. The data is then manually entered into the iteration programas beams.
The programwill be described in chapter 4.
Fig3.1
20. 20 | P a g e
3.2 Components of apparatus
TSLR250RLight to Voltage Optical Sensors (Photodiode)
Fig3.2(Photodiode) full datasheetcanbe foundinappendix
Hewlett Packard 7015b X, YPlotter
Fig3.3 (X,YPlotter) full datasheetcanbe foundinappendix
21. 21 | P a g e
National instruments DAQ usb6009
Fig 3.4 (Data Acquisition card ) See Appendix for details
Fig3.5 Pasco Basic Optics Diode Laser
22. 22 | P a g e
3.3 Reconstruction
The original machine was very outdated being ten years since anybody
had used it the task was to reconstruct the old machine and the
reprogram it using matlab instead of Labview which was previously
implemented. The first stage was to check the photodiode and laser.
Both were non-operational and needed to be replaced.
Also after taking off the cover to the x, y plotter it was realized that the
original Data Acquisition card was unusable because it was outdated and
broken.
Fixing this issue required cutting out the old holder for the card and
connecting a new Data acquisition card however this was problematic as
the old Photodiode was found to be non-operational. Solving this issue
involved getting a new photodiode that had a portable power supply
because the national instruments device hadn’t a sufficient enough
power source. The output of the photodiode was connected to AI0
channel in the DAQ card.
This allowed the card to read voltages from the photodiode. The
photodiode had a large aperture that was allowing a lot of background
light, tape was used to block out most of the light and make the
aperture smaller.
When in darkness the photodiode read 20mV and when saturated with
light it could reach as high as 3.7V this was a solid range to work with
when scanning an object. The laser was also found to be broken this was
replaced by a similar laser that also had an external power supply. The x,
y plotter also had its own power supply making the setup very
cumbersome. The national instruments DAQ was powered via usb which
also help with obtaining the data from the Optical CT. The turntable
connected to the x, y plotter was set in increments of 4 degrees. A
protractor was used to get the projection angles that were to be used,
these angles were 0 45 90 and 135 degrees.
23. 23 | P a g e
A piece of copper was placed on top of the turntable because there was
a screw that unbalanced any object that was placed. The last part of the
reconstruction was to get a phantom image to scan.
It was found that three pieces of clear tape one denser than the other
would be an ideal candidate to scan as it would show all the density’s
easily in a small set of pixels. On the next page is an image of the
reconstructed CT scanner.
3.4 Experimental Setup
Fig 3.6 This is the experiential setup of the CT scan.
24. 24 | P a g e
Chapter 4 Matlab
4.1 Code Implemented
clear
clc
disp('Andrew O Neill Project Year 3 Dt260/3')
disp('Optical CT scan Code ')
pause on
pause(6)
pause query
pause off
%Enter voltage values from Photodiode
Beam1 = 3.6879*25;
Beam2 = 3.58*25;
Beam3 = 2.392*25;
Beam4 = 3.366*25;
Beam5 = 3.505*25;
Beam6 = 2.856*25;
Beam7 = 3.687*25;
Beam8 = 3.658*25;
Beam9 = 2.413*25;
Beam10 =3.457*25;
Beam11 =2.540*25;
Beam12= 0;
Raysum1=Beam1/3;
Raysum2=(Beam1/3)+(Beam2/3)+(Beam3/3);
Raysum3=Beam3/3;
Difference1=Beam4-Raysum1;
Difference2=Beam5-Raysum2;
26. 26 | P a g e
Difference7=Beam10-Raysum7;
Difference8=Beam11-Raysum8;
Difference9=Beam12-Raysum9;
Pixdif7=Difference7;
Pixdif8=Difference8/3;
Pixdif9=Difference9;
Pix19=Pix10+Pixdif9;
Pix20=Pix11;
Pix21=Pix12+Pixdif8;
Pix22=Pix13;
Pix23=Pix14+Pixdif8;
Pix24=Pix15;
Pix25=Pix16+Pixdif8;
Pix26=Pix17;
Pix27=Pix18+Pixdif7;
Density=[Pix19 Pix20 Pix21;Pix22 Pix23 Pix24;Pix25 Pix26 Pix27];
R = radon(Density, 0:179);
theta = R(:,179);
I = iradon( [theta theta], [1 1] )/2;
imshow(I, [])
for i = 1:179 %increments the angle
theta = R(:,i); %filters the original R value by above loop
I = I + iradon( [theta theta], [i i] )/2;%as above this is filtering the iradon to give a
cleaner value
figure(1)% displays with the original iradon to view filtration
imagesc(I) %displays the filter in process around the phantom
colormap(jet)
end
display(I)
27. 27 | P a g e
4.2 Analysis of code
The code starts by clearing any previous variables or data then it clears
the command window using the code clc. Then the title of the project is
displayed along with the name of the creator. This is then paused for six
seconds and then the program resumes.
Beams 1:12 represent for projection angles for example beam 1:3 is for
the 0 degree angle then 4:6 is the 45 degree and so 7:9 is 90 degrees and
finally 10:12 is 135 degrees. The program creates a 3X3 matrix each
coordinate in this matrix is a pixel. Each pixel will have a different colour
depending on the density of the object that has been scanned; also the
beams that have been obtained via the national instruments DAQ
determine what the density will be in each pixel.
After the beam values have been entered then the beams will be
entered as ray sums to split the beam into each pixel. The word ray sum
in the program is arbitrary the beam values themselves are the actual
ray sums. The difference between beams and the ray sum values are
taken this difference is then added on to each pixel in the next set of
beams this repeats itself until the end of the program were the last set
of pixel values are put into an array and shown as an image.
The radon transformin this program is unnecessary however it gives the
user a better idea of what the program is doing. The radon transform is
taking the image that was just created and taking it back to its beams
this is then reconstructed by the iradon which uses filtered
backprojection to reconstruct the image. It was done at the end because
weeks were spent on the radon transform adding it to the program just
improved the visualexperience for the user as well as showing the radon
and iradon in use.
28. 28 | P a g e
4.3 The National Instruments data acquisition code
ai = analoginput('nidaq','Dev1');
addchannel(ai,0);
set(ai,'SampleRate',1000)
set(ai,'SamplesPerTrigger',5)
start(ai)
wait(ai,2)
data = getdata(ai);
data+1.4301
plot(data)
Beam=ans-3.713
end
end
display(Beam)
delete(ai)
clear ai
29. 29 | P a g e
4.4 Analysis of NIDAQ code
The Data Acquisition code begins by stating what the device is and the
channel the device is located. The channel is added that the Photodiode
is connected to. Then after this a sample rate of 1000 is set this means
it’s going to be a 1000 samples per second, the next line states how
many samples does the user want in this case 5 samples will be taken
from the photodiode.
The program then activates the channel the wait is there so the
computer can obtain the data. Data is then taken from the channel ai. It
was found that the device had an offsetvoltage of -1.4301 this had to be
added on to get the true values for the voltages.
The data is then plotted this is not necessary however it allows the user
to see if the photodiode is responding correctly. As stated previously the
photodiode when in darkness had a voltage of 20mV and in saturated
light Voltage up to 3.713V.
This had to be reversed because the pixels in matlab display colours of
only large numbers if the density on the voltage is larger in bright
conditions this meant that when viewing the density that all the colours
were the opposite.
The transparent materials would have large densities and the solid
material would have little to no density. Reversing the Photodiode fixed
this issue and displayed good results. The value of this beam is then
entered into the Iteration program for reconstruction.
30. 30 | P a g e
Chapter 5 Analysis of apparatus
5.1 Advantages and disadvantages of apparatus
Advantages of apparatus, the DAQ that was installed which has a usb
which increased data speed and performance. Also because the detector
and the laser had to be replaced this meant that the machine was nearly
entirely up to date. The code that was used for both data acquisition and
reconstruction was very quick and efficient which meant large amounts
of data could be processed at a time.
Disadvantages of the apparatus, the x, y plotter had to be used manually
which meant that the error would be higher and artefacts in the images
would be prevalent. The laser the Photodiode and the x, y plotter was all
externally powered which made the device very large. The National
Instruments Data Acquisition Card could only power up to 200mA which
meant that it was incompatible with powering the 350mA laser and
photodiode. Another disadvantage was that matlab was prone to
crashing; this may have just been the computer that I was using though.
5.2 Errors
As stated the x, y plotter had to manually translate which meant that the
projections that were acquired had a margin of error. Another error
issue was the offset of the DAQ card this had to be read from a
multimeter which itself had an error of +-0.05. The photodiode had to be
reversed in the program as stated previously this was calculated by
connecting the photodiode to the multimeter and then to the DAQ and
read to the computer. This issue with this was that the multimeter was
constantly varying when the photodiode was covered and put into
darkness so an average reading was taken from 5 samples. The reading
was 20mV +- 5mV which is a larger than wanted error.
31. 31 | P a g e
5.3 Future work
The apparatus has to get a DAQ card that can support both the laser and
the photodiode, this would make the system more compact and easier
to use. Also in the program more pixels can be added. This can be done
by following the pattern in the program and applying extra beams and
pixels. Another improvement would be if a student could write code to
make the x, y plotter automatic this would dramatically decrease error.
Also to create a 3D image a z direction would need to be added this
could be done by adding two vertical x, y plotters one attached to the
laser and the other to the photodiode. Both would have to be in sync
together. Finally if this set up was accomplished then multiple lasers and
detectors could be added to create even more detail.
32. 32 | P a g e
Chapter 6 Results
6.1 Matlab code data output
Andrew O Neill Project Year 3 Dt260/3
Optical CT scan Code
ans =
on
Density =
0 33.5910 30.9686
11.8057 17.0797 25.3719
15.4517 22.7919 86.4250
This is the density that’s reconstructed in the iteration program. What is seen
here is the different densities of the cello tape that were used on the left hand
side reading vertical so 0, 11.8057 and 15.4517 these represent a piece of cello
tape that is just one strip so most of the laser passes through each time the
reason for the two higher numbers is because at an angle of 90 degrees the
tape is in line with the other pieces of tape with larger densities. Obviously the
next set of data beside this is a thicker piece of tape and finally at the end a
tape that blocks a lot of light this was very successful as it showed that the
program was working as needed.
33. 33 | P a g e
6.2 iradon image reconstructions
fig 6.1 each pixel represents a density
Density =
0 33.5910 30.9686
11.8057 17.0797 25.3719
15.4517 22.7919 86.4250
Each number here represents a pixel in the above image the number 0 being
location 1,1 and the number 33.5910 being location 1,2 and finally 30.9686
being 1,3 this is then repeated in the next 2 rows were 1 is changed to 2 and
then 2 is changed to 3 in the final row.
34. 34 | P a g e
6.3 Radon transform data output
Below is the data output for the R value for 0, 45, 90 and 135 degrees in the
Radon transform.
0 degrees 45 degrees 90 degrees 135 degrees
0 0 0 0
3.4072 6.8863 14.9524 36.5288
29.6259 41.0411 100.1689 88.8353
76.3498 113.0972 64.7085 81.0968
116.2569 68.7734 55.3217 36.3361
17.8457 13.6874 8.3340 0.6884
0 0 0 0
What are seen above are 7 beams in descending order each value is the ray
sum of each pixel at that current projection angle. These values are then put
into the Inverse Radon Transform algorithm which then reconstructs it into an
image. This was not necessary in this program as stated in the Theory chapter
however using the radon transformwas for thestudents understanding of how
CT reconstruction works. The program works just on the iteration method the
only use for the radon transform in this program was for visual representation
of the data. Also a lot of time was spent trying to use the radon transform.
However there was an issue in understanding why at every angle did the beam
split the centre pixel from a 100% to 75% its original value then split the 25%
between the two opposing beams. Research into this found that if the beam
hit the border of the pixel then it would split between the two others however
a reason for why this would be of benefit was not found.
35. 35 | P a g e
Chapter 7 Discussion and Conclusion
7.1 Discussion
There are many ways to create a CT scan in this project the Hounsfield
approach was taken. This project was difficult because the CT scan machine
that was previously built wasn’t in running order and had to be restored to
original functionality. Also the code to reconstruct an image had to be created
this took a lot of time because understanding how the mathematics of CT
scanning took a while to comprehend. If there was more time allocated then
the pixels could have been expanded and more beams introduced.
7.2 Conclusion
The brief was to create a CT scanner and reconstruct an image. The machine
was built and a phantom object was scanned and it was reconstructed. Even
though the image is very crude it still meets the brief that was proposed.
Overall the project was a success however the CT scan could be improved
dramatically if more time had been given. The program created and machine
made are not very understandable at first glance. This write up should be read
before the machine and code is used.
36. 36 | P a g e
References
[1] Timothy G Feeman ‘’ Mathematics of medical Imaging a beginners guide ’’
Sumat 2009
[2] Paul Suetens ‘’ Fundmentals of Medical Imaging ‘’ Second edition 2009
[3] Barry Haycock ‘’ CT scan’’ 2007
[4] Mathworks documentation centre.
http://www.mathworks.co.uk/help/images/ref/iradon.html
[5]Wolfram MathWorld
http://mathworld.wolfram.com/RadonTransform.html
[6]Mathworks Documentation centre
http://mathworld.wolfram.com/RadonTransform.html
[7] Science direct
http://www.sciencedirect.com/science/article/pii/S016890021100461X
37. 37 | P a g e
Appendix: Matlab reconstruction code
clear
clc
disp('Andrew O Neill Project Year 3 Dt260/3')
disp('Optical CT scan Code ')
pause on
pause(6)
pause query
pause off
%Enter voltage values from Photodiode
Beam1 = 3.6879*25;
Beam2 = 3.58*25;
Beam3 = 2.392*25;
Beam4 = 3.366*25;
Beam5 = 3.505*25;
Beam6 = 2.856*25;
Beam7 = 3.687*25;
Beam8 = 3.658*25;
Beam9 = 2.413*25;
Beam10 =3.457*25;
Beam11 =2.540*25;
Beam12= 0;
Raysum1=Beam1/3;
Raysum2=(Beam1/3)+(Beam2/3)+(Beam3/3);
Raysum3=Beam3/3;
Difference1=Beam4-Raysum1;
Difference2=Beam5-Raysum2;
Difference3=Beam6-Raysum3;
Pixdif1=Difference1/1;
Pixdif2=Difference2/3;
39. 39 | P a g e
Pixdif7=Difference7;
Pixdif8=Difference8/3;
Pixdif9=Difference9;
Pix19=Pix10+Pixdif9;
Pix20=Pix11;
Pix21=Pix12+Pixdif8;
Pix22=Pix13;
Pix23=Pix14+Pixdif8;
Pix24=Pix15;
Pix25=Pix16+Pixdif8;
Pix26=Pix17;
Pix27=Pix18+Pixdif7;
Density=[Pix19 Pix20 Pix21;Pix22 Pix23 Pix24;Pix25 Pix26 Pix27];
R = radon(Density, 0:179);
theta = R(:,179);
I = iradon( [theta theta], [1 1] )/2;
imshow(I, [])
for i = 1:179 %increments the angle
theta = R(:,i); %filters the original R value by above loop
I = I + iradon( [theta theta], [i i] )/2;%as above this is filtering the iradon to give a
cleaner value
figure(1)% displays with the original iradon to view filtration
imagesc(I) %displays the filter in process around the phantom
colormap(jet)
end
display(I)
40. 40 | P a g e
Appendix: National Instruments data acquisition code for matlab
ai = analoginput('nidaq','Dev1');
addchannel(ai,0);
set(ai,'SampleRate',1000)
set(ai,'SamplesPerTrigger',5)
start(ai)
wait(ai,2)
data = getdata(ai);
data+1.4301
plot(data)
Beam=ans-3.713
end
end
display(Beam)
delete(ai)
clear ai
44. 44 | P a g e
Appendix: Originally proposed project
45. 45 | P a g e
As well as providing soft-tissue images of very high contrast, the digital nature of its
image generation process allows for quantitative assessment and evaluation of CAT
images.
The standard method of reconstructing CAT scans is the algebraic reconstruction
technique (ART) and integral transform (IT) techniques. Another approach is to use
neural networks in which distributed data are used with recursion to “settle” on a
reconstructed image.
This project will involve:
- Developing an optical CAT scan system involving a laser and photodiode.
- Developing a physical phantom for optical CAT scanning,
RESOURCES/EQUIPMENT: (PLEASE INDICATE WHICH ITEAMS ARE CURRENTLY AVAILABLE
AND WHICH NEED TO BE AQUIRED/PURCHASED)
- Laser pointer, photodiode, turntable, x-y plotter.
- Access to a pc and MATLAB / C compiler (available)
MILESTONES: (PLEASE INDICATE AT LEAST 5 MILESTONES TO BE REACHED BY THE STUDENT IN
THE COURSE OF THE PROJECT)
1) Construction of apparatus (turntable, laser, photodiode)
2) Interface with computer software via MATLAB.
3) Creation of a physical phantom,
4) Scanning the phantom.
5) Reconstructing the phantom image.
DELIVERABLES:
- Optical CAT scan apparatus.
- Phantom objects.
- A CAT scan image reconstructed from the physically-gathered data