book collections email follower instructable user

Computed tomography (CT) or computed axial tomography (CAT) is most often associated with imaging the body because it enables clinicians to see the anatomical structure inside the patient without having to do any surgery. To image inside the human body, a CT scanner requires X-rays because the radiation has to be able to penetrate through the body. If the object is semi-transparent, it is actually possible to conduct CT scanning using visible light! The technique is called optical CT, which is different than the more popular optical imaging technique known as optical coherence tomography.

To acquire 3D scans of semi-transparent objects, I constructed an optical CT scanner using an Arduino Nano and Nikon dSLR. Halfway through the project, I realized that photogrammetry, another 3D scanning technique, requires much of the same hardware as an optical CT scanner. In this instructable, I will go over the system I constructed that is capable of CT scanning and photogrammetry. After acquiring images, I have steps on using PhotoScan or Matlab for computing 3D reconstructions.

For a full class on 3D scanning, you can check out the instructables class here.

I recently found out about Ben Krasnow built an x-ray CT machine with an Arduino. Impressive!

After posting, Michalis Orfanakis shared his homebuilt optical CT scanner, for which he won the 1st prize in Science on Stage Europe 2017! Read the comments below for full documentation on his build.

Resources on optical CT:

The history and principles of optical computed tomography for scanning 3-D radiation dosimeters by S J Doran and N Krstaji

Three-dimensional image reconstruction for CCDcamera based Optical Computed Tomography Scanner by Hannah Mary Thomas T, Student Member, IEEE, D Devakumar, Paul B Ravindran

Focusing optics of a parallel beam CCD optical tomography apparatus for 3D radiation gel dosimetry by Nikola Krstaji´c and Simon J Doran

Step 1: Computed Tomography and Photogrammetry Background

Picture of Computed Tomography and Photogrammetry Background
xrayVslight-01.png

CT scanning requires a source of radiation (e.g. x-rays or light) on one side of an object and detectors on the other side. The amount of radiation that makes it to the detector depends on how absorptive the object is at a particular location. A single image acquired with this setup alone is what produces an X-ray. An X-ray is like a shadow, and has all the 3D information projected into a single 2D image. To make 3D reconstructions, a CT scanner acquires X-ray scans over many angles by either rotating the object or the source-detector array.

The images collected by a CT scanner are called sinograms, and they display absorption of X-rays through one slice of the body vs. angle. Using this data, a cross section of the object can be acquired by using a mathematical operation called the inverse Radon transform. For full details on how this operation works, check out this video.

The same principle is applied for the optical CT scanner with a camera acting as the detector and the LED array acting as the source. One of the important parts of the design is that the light rays that are collected by the lens are parallel when travelling through the object. In other words, the lens should be telecentric.

Photogrammetry requires the object to be illuminated from the front. Light is reflected off the object and is collected by the camera. Multiple views can be used to create a 3D mapping of the surface of an object in space.

While photogrammetry enables surface profiling of an object, CT scanning enables the reconstruction of the internal structure of objects. The major disadvantage for optical CT is that you can only use objects that are semi-transparent for the imaging (e.g. fruits, tissue paper, gummie bears, etc.), whereas photogrammetry can work for most objects. Furthermore, there is much more advanced software for photogrammetry so the reconstructions look incredible.

misterxp6 months ago
This is really incredible! I can see you spent a great deal of time and effort and have been very generous to share all your work with others. Really well done and also interesting for me to read. It is all new to me but I found your explanations fascinating. Thanks for sharing and hope I get the chance to tray and make one!
jbumstead (author)  misterxp5 months ago
Thanks for your kind note. It means a lot!
TimothyJ9996 months ago
Excellent! Noting your comment about the limitations caused by the camera being in only a single plane, here's a simple way to remedy this: replace the turntable with a simple pan/tilt rig (lots of inexpensive ones online, or stl files in Thingiverse). In this case, the target is being panned and tilted instead of the camera.

For each horizontal step of the turntable, add a few upward vertical steps/images and downward vertical steps/images, then rotate to the next horizontal position and repeat. Because the vertical movement is only a tilt instead of a full revolution, you could control that with a servomotor--much simpler in terms of code and hardware than a stepper motor.
Hope this helps, it's a great project!
jbumstead (author)  TimothyJ9996 months ago
Thanks for this suggestion. This would definitely improve the photogrammetry results. I wonder how multiple tilt acquistions could be used in the CT reconstruction.
krg1231236 months ago
Hello, Really nice Project.
Do we examine microstructure with this technique ?
have you ever tried or would you please confirm ?
jbumstead (author)  krg1231236 months ago
Yes, it is possible. It depends on the numerical aperture of the imaging system and the scattering of the sample. Usually, higher numerical aperture means high resolution. So if you use a microscope objective, you could potentially image with microscopic resolution. However, the decreased depth of field makes it more difficult to image. If the sample is more scattering, then the resolution would also be worse.
angrywhinnie8 months ago
Hi Jon,

Thank you for sharing this project with all of us! It is really interesting and useful.

1 thing I was hoping to clarify is the stepper motor mount STL file. I was looking for it under part 4, along with the other STL files, but did not find it. Can I check if it is saved under a different name or that I am missing some detail some where?

Thank you once again!

Regards,
whinnie
jbumstead (author)  angrywhinnie6 months ago
I think it is called PIM_motorBase2.stl, under step 4. Is that the right one?
AmmarI41 year ago

this is such an amazing project well explained

I am going to make this project as a part of medical imaging class but before doing it I am working on the maltlab code but I notice that the images are not upload with the files , Can you please share all the pic so that I could work on the matlb code well? thank you in advanced .

jbumstead (author)  AmmarI41 year ago

I am excited to hear you are including this project in your imaging class! In Step 12, I uploaded example datasets. They are already cropped and downsampled so that the files aren't so big. Use the m-file called opticalCTprocessingExample.m (also uploaded in Step 12) to process the images.

Yes I am sorry I did not noticed that form the first look!!

I have started working on the matlab code but there is an erro which I could not find out how to fix it !

I have download all the images and I have copied the path of the file in

mainFold = 'C:\Users\osman\Desktop\images'; and that was correct as I think but for this code I could not understand this part when reeding the image I=imread([mainFold,'DSC_',picNum,'.JPG'])

what do you mean by the DSC here

jbumstead (author)  AmmarI41 year ago

Hi Ammar,

There are two m-files uploaded. You need to use the m-file entitled "opticalCTprocessingExample.m" to process the example images uploaded on instructables. The other m-file, which is called "opticalCTprocessing.m", is for images straight from my dSLR. It includes the steps for cropping and aligning the images. My dSLR adds the prefix DSC before images, so that line of code just creates a string for the name of the images straight off the camera. In the example dataset, I renamed the images to be called I1.jpg, I2.jpg... and so on.

I hope this helps!

Jon

steph27031 year ago

Hi,

Great project!

Just wondering where I can find the stl files for the 3D mounts?

Thanks,

Steph :)

jbumstead (author)  steph27031 year ago

Thanks! Looks like I forgot to add STL files. Just added it to Step 4.

Thank you!

I think this is an awesome project! And I am trying to build it, but I’m a bit of an amateur and am struggling a little with connecting the wires - trying to follow your pictures but just wondering if you could give me any guidance on the wiring process so that I can connect the PCB (which I have solder H-bridge, buck converter etc as in pic) with the Arduino and power source correctly?

Many thanks,

Steph

jbumstead (author)  steph27031 year ago

Hi Steph,

The best thing to do when testing the circuit is to make sure everything is working on a breadboard first. Power the bread board using the power supply you will be using for the system. Then test small parts of the system separately with the Arduino. Only when you are sure everything is working on the breadboard, solder the components onto the prototype board. There is no special way to do it. Just make sure you have all your connects right and good soldering technique, and you should be good to go! Hope this helps. Best of luck with the build!

mrwonton1 year ago

Good job on yur win!

jbumstead (author)  mrwonton1 year ago

Thanks!

Really cool :)

Could I use a different camera for this. I have an old Digital Rebel. It is 5Meg I think

jbumstead (author)  johnaobrien1 year ago

Yes, a different camera will work. Michalis made his optical CT scanner with a webcam. See the comments below. Best of luck with the build!

Matlek1 year ago

This is an amazing project! Well explained and using various technics with PVC, wood, 3D printing, Arduino, and photogrammetry. Thanks for sharing!

jbumstead (author)  Matlek1 year ago

Thanks for checking it out, Matlek!

And congrats for the Grand Prize!

Congrats. This is amazing.

MrKOSMOS1 year ago
Awesome! Got to try this sometime, maybe with a Raspberry Pi...
By the way, what do you think about using sound instead of light?
jbumstead (author)  MrKOSMOS1 year ago

Thanks for checking it out! RaviG28 suggested using a Pi too. You could display the images in real time and even do the processing automatically on the Pi right after scanning.

Using sound is definitely feasible. There is a technique called Photoacoustic Tomography that uses light to excite the sample and detects ultrasonic waves emitted. You could also set up ultrasonic sensors and do 3D scanning, similar to what Super Make Something does with IR sensors: https://www.youtube.com/watch?v=-qeD2__yK4c

IgorF21 year ago

Wow! That's great! Congratulations! :D

jbumstead (author)  IgorF21 year ago

Thanks!

very impressive been trying to figure out a way to scan small objects for model making and found this. it is perfect for my needs. only question is the distance between the lens and the object is this critical, and is the camera set for macro photography.

There is one change that I will do and that is make it so the camera will pivot vertically around the centre of the object so I can see the top and bottom of the model. While mounting it on a fine stick

jbumstead (author)  timbologist1 year ago

The distance shouldn't matter when using a telecentric lens. However, there may be some weird magnification issues when imaging too closely to the object. Here is a link for some advice on imaging small objects with photogrammetry: https://www.reddit.com/r/photogrammetry/comments/4n03js/tips_on_small_objects/

Good idea with image from multiple heights to get better coverage of the object.

Best of luck with the project!

orfanak1 year ago

Great Job my friend! I am a Science teacher and last year I built two optical CT Scanners one with LEGO Mindstorms and one with Arduino and it gave me the 1st Prize in National Science on Stage 2016 and the 1st prize in Science on Stage Europe 2017 (32 countries, 450 Science teachers). Science on Stage is the biggest competition for Science Teachers worldwide. Check this video:

you can find all the material (instructions, image sets, code etc) here:

https://goo.gl/Mffb1m

I use my systems in school to present tomography principles and CT Scan fruits, gummy bears etc.

The main differences with your system is that I used a usb web cam and imageJ for the 3D reconstructions. I also used MATLAB to control Arduino and LEGO EV3 for image acquisition and for implementing radon transforms.

I am very happy that you did something similar with great design and I pretty much know how much time you spent for this work...

Voted for you!

Cheers

Michalis

jbumstead (author)  orfanak1 year ago

Hi Michalis,

Thank you for sharing your optical CT scanner project and all of your documentation. And congratulations on winning those competitions too! This is a perfect project to get students interested in imaging.

Your implementation, write-up, and results are terrific. I especially love your idea to use two polarizers to ensure that only light scattered in the specimen makes it to the camera. I guess that my results worked out okay because the rays of light from the source saturated the sensor if they did not travel through the sample. You also initially had some issues with scattered light in the box, which implies that using black out paper on the walls is really crucial for these homebuilt optical CT machines.

I am also happy to see that this setup works using a webcam instead of a much more expensive dSLR. I downsample the images anyway for my reconstruction. Did you add any lenses in front of your webcam? If not, I wonder how big of a difference the telecentric lens that I used makes for the CT imaging.

The last major thing that I might not have emphasized enough in this write-up was the importance of making sure that the axis of rotation is vertical and directly in the middle of the image. I actually just eyeballed the center of the images when cropping afterwards. I guess it was good enough for most scans, but I am now going to adjust my code to make sure that the axis is right in the middle of the image.

Great results with the gummie bear reconstruction. I am impressed how clearly you can see the hole in the bottom where you mounted the sample.

Thanks for voting!

Hi jbumstead,

Thank you for your kind words, The trick with the linear polarizers is common in biomedical imaging and this project was the simplified transformation of a scientific experiment to secondary education. Initially without the polarizers I had the same issues as you of course so try the trick it will make a difference in your results.

I think the most crucial factor is to have a perfect vertical axis in the middle in your images otherwise the iradon function of MATLAB will give you distorted CT Scans. I crop the images within the MATLAB code to center them and get rid of unwanted parts of the image and then the code produces a 3D matrix .tiff file with all the CT Scans of the object.

Then I use the open source ImageJ Fiji software which is specialised for biomedical imaging and which is used by scientists worldwide so as to get the 3D reconstruction with a few clicks.

Once I have used a webcam with x10 lens with simiral result. My intention as an upgrade was to use a DSLR camera but initially I wanted to develop the most simple and inexpensive ct scanner and showcase that it can be used in secondary education. the arduino ct scanner costs below 100euro.

I have made several experiments with different objects, sweets, fruits, plants even insects... objects with a lot of sugar insider are the best light scatters and give better results

Looking forward to see more of your work and wishing you all the best and success in the contest!

Best regards

Michalis

jbumstead (author)  orfanak1 year ago

Hi Michalis,

I will have to try the linear polarizers and ImageJ for making the 3D reconstructions. I have already updated my matlab code to make sure the axis of rotation is directly in the center of the image.

Excellent work keeping costs below 100euro. The dSLR will definitely help with resolution, easy triggering, and adjustable exposure. Right now I downsample the image so that it doesn't take so long for the reconstructions. The amount I downsample depends on how much I crop the image (e.g. how big the object is) and how long I want to wait.

Lots of sugar is good. Maybe this is why Jaswant suggested soaking in saturated sugar solution.

Minkaa1 year ago

Wow, amazing project! Congratulations!

ZacharyM721 year ago

Awesome Project , I'm now planning on building one similar , when it came to the software did you use the standard version of Photoscan or the Professional ? I'm hoping the Standard will work cant figuire dropping $3k on a project. Thank You !!

jbumstead (author)  ZacharyM721 year ago

I was able to make 3D scans with the demo version, which is standard Photoscan. However, I couldn't export files, so I downloaded the free trial, which is the professional version. If you buy the standard version, you can of course export files too. For a beginner with this software, I couldn't tell much of a difference between standard and pro.

I used Photoscan because I have a Mac, but there are other options. The free instructables class uses Recap Photo, but it requires windows so you will need to run parallels on your mac. You get it for free if you have a .edu email account. I would have used Recap Photo, if there was a Mac version.

Mi_Tasol also suggested trying a program called Irfanview, but I haven't tried it yet. https://www.irfanview.com/

Good day all

I was recommending Irfanview PURELY for batch photo cropping in this project. My apologies for the confusion.

For general graphics manipulation/editing/cropping/joining etc Irfanview is a magic solution - no glam but lots of power and blindingly simple controls. It is no Photoshop but for 90% of what I need it does it far faster and easier than PS

jbumstead (author)  jbumstead1 year ago

One more note. The CT reconstruction was done it Matlab, but I am sure it could be done using Python or Octave, which are free.

1-40 of 75Next »