I should represent a 3D volume image from 2D images in Matlab. The number of 2D images is 90 images in DICOM format. Besides, the each picture size is 512 * 512. This task is about the distance between slices in the Z-axis. This is my following code:
**
clear variables
clear all
close all
names=dir('C:\Users\User\Desktop\Projekt\2-DICOM-Daten von einem Cone-Beam CT (CBCT)\CT.Test CatPhan
CBCT A\*.dcm');
for i=1:size(names,1) %names is a struct consists of 90 * 1.
I(:,:,i)=dicomread(strcat('C:\Users\User\Desktop\Projekt\2-DICOM-Daten von einem Cone-Beam CT
(CBCT)\CT.Test CatPhan CBCT A\',names(i).name));
for j=1:size(names,1)
Img_3D=surface('XData',[0 256;0 256],'YData',[0 0;256 256],'ZData',
[jj;jj],'CData',flipdim(im2double(I(:,:,i)),1),'FaceColor','texturemap','EdgeColor','none');
colormap(gray)
xlabel('x')
ylabel('y')
zlabel('z')
end
end
**
I have to cancel the program so that it gives me the picture. otherwise it takes longer without adding a picture. When the program quits, it shows an image volume, but you have the same image (completely black). Nevertheless, 90 of the original images are different. I uploaded 2 pictures.enter image description here enter image description here I don't know where my fault is. I would be very grateful for your help