# how can I convert 2d images to a 3d image?

146 views (last 30 days)
sara on 14 Sep 2014
Edited: Walter Roberson on 24 Jan 2022
I have a CT scan file with 51 slices...how can I make a 3d image with this 51 slices?
Is there any toolbox in matlab for this?
I attached this file.
Walter Roberson on 14 Oct 2015
The 4th did not get attached.

Image Analyst on 14 Sep 2014
You can use cat()
image3d = cat(3, slice1, slice2, slice3, slice4);
or in a loop where you read in each slice
array3d = zeros(rows, columns, numberOfSlices);
for slice = 1 : numberOfSlices
filename = spritnf('image #%d', slice);
fullFileName = fullfile(folder, filename);
if exist(fullFileName, 'file)
array3d(:,:,slice) = thisSlice;
end
end
or if you don't know the number of slices in advance,
if slice == 1
array3d = thisSlice
else
array3d = cat(3, array3d, thisSlice);
end
Image Analyst on 9 Sep 2021
Edited: Walter Roberson on 24 Jan 2022
Patil, if you've studied medical reconstruction you know a reconstructed image is not merely the sum of rotates images. You have to extrude or "back project" the images before you add them. You are not doing that part so you will not get a reconstruction. Sorry, but writing a 3-D reconstruction algorithm is way beyond what I can offer you. There are people who's whole full time job is working on those kinds of algorithms.

Rekha Nair on 14 Oct 2015
how can i create a 3d image by using one Plane image(X and Y cordinates) and an oblique view of the same image.
Image Analyst on 19 Sep 2017
Also see papers here: Vision Bibliography

### Categories

Find more on 3-D Volumetric Image Processing in Help Center and File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!