3D Image Reconstruction

P R O J E C T

Image
3D Model of a brain generated from 2D images
SKILLS: MATLAB THREE.JS

I was inspired by MRI scans of the brain and I thought about reconstructing a 3D brain model from 2D images. I did this mini-project to figure out if I could produce a 3D model from the top, side and front view pictures of an object.


The images were converted into a binary bitmap black and white and then the border was generated by finding where adjacent points were either 0 or 1. This process was completed for incoming points from the left, the right, above and below and then the non-unique points were removed.



The boundary array was sorted by finding the closest points to each other.



Then a grid within the boundary was calculated using MATLAB's inpolygon function.



This was repeated for the top and front view. Each of the images was normalised and combined to form a 3D image (but planar).



If the normal vectors from points on each of the three planes intersected, an intersection point was defined, creating a 3D shape.



However, for the purposes of visualising the brain, only the surface is required. Finding the maximum and minimum points in one dimension while holding the other dimensions constant gives the outermost points. For the shown resolution, the number of points is reduced from ~80,000 to ~15000.



From these points there are various ways to produce a 3D surface, such as Delaunay triangulation:



...or voxelation:



I think the 3D model created looks somewhat like a brain. Of course, only using low quality images from different sources reduces the resolution of the final image. However I think the biggest reason why the final model is not very high resolution is that I could not increase the resolution of the intersections to as high as I wanted because it was a very computationally expensive function O(N3). It could be improved by only finding the intersections near the boundary of the object instead of all intersections and then removing internal intersections afterwards. Also, using for loops in MATLAB is not very efficient, so using a compiled language or better coding practice would reduce the computation time for a given resolution.