-
Source Code
02/14/2019 at 17:51 • 3 commentsHere is the version 1.0 of the code: https://github.com/fpiernas/FBP
Read the instructions, although I have done my best to make the code very simple to use. It's possible to reconstruct a sinogram image in just 5 lines of code:
Mat sinogram=imread("sinogram.jpg",IMREAD_COLOR); //load the sinogram image "sinogram.jpg" Mat filtered_sinogram=filter_sinogram(sinogram); //filter the sinogram Mat reconstruction=iradon(filtered_sinogram,false); //perform back projection. Change false to true if sinogram is a full turn renormalize255_frame(reconstruction); //normalize to 255 imwrite("Reconstruction.jpg",reconstruction); //save reconstruction
You can also download the videos I've posted to try the code to perform a 3D reconstruction.
I strongly recommend to use Cloud Compare to open the saves point cloud "slices.xyz" that the code creates.
-
New tests
02/12/2019 at 20:49 • 0 commentsHi everyone, I'm still finishing the code and testing it with new object, this time it's a panel led like this one:
We see two screws and what seems to be a capacitor and a resistor. Let's CT scan it.
I removed the walls and filtered by value, the capacitor itself seems to be as transparent to x-rays as the walls, so if I remove the walls I will also remove the capacitor except for its pins.
User nevermore78 did this animation to show the differences between two methods of normalizing the results of the filtered back projection:
The left one is the result of normalizing each pixel of each slice to the maximum value of that slice so this pixel gets the value 255. It has the advantage that this automatically attenuates plastic if metal is present in the slice, but the disadvantage that it may remove some points where it shouldn't (see the capacitor).
The center example is what happens when the object is normalized to the absolute maximum value of all slices. It has the advantage that each pixel gets the value that it should have depending on absorptance, but generally walls aren't removed. The right example is a comparison between the other two.
That's all for now, I will upload the code when it's finished.