3D reconstruction from 2D images

I have come across an example of surface2volume function from https://www.mathworks.com/matlabcentral/fileexchange/8772-surface2volume .I had tried the example given and it work! My question is how I gonna to modify the coding so it can be used for my own ultrasound 2D images? Because the example coding is loading the mri mat file.The example coding is as below:
load mri;
D = squeeze(D);
D = padarray(D,[5 5 5],'both');
% Create an isosurface
Ds = smooth3(D);
surface = isosurface(Ds,5);
% Display the surface
figure;
subplot(1,2,1);
hiso = patch('Vertices',surface.vertices,...
'Faces',surface.faces,...
'FaceColor',[1,.75,.65],...
'EdgeColor','none');
view(45,30)
axis tight
daspect([1,1,.4])
lightangle(45,30);
set(gcf,'Renderer','zbuffer'); lighting phong
isonormals(Ds,hiso)
set(hiso,'SpecularColorReflectance',0,'SpecularExponent',50)
% Reconstruct the volume and display it as montage
OV = surface2volume(surface,[],1);
nDims = size(OV);
subplot(1,2,2);
montage(reshape(OV,nDims(1),nDims(2),1,nDims(3)),[0 1]);
Hope you can clear my doubt.I am a newbie to use matlab. If you got any solution to stack 2D images into 3D or can reconstruct 3D from multiple 2D images please feel free to comment here.Thank you very much!

댓글 수: 4

Tale Saeidi
Tale Saeidi 2019년 4월 16일
Hi guys
I have used this code as well to convert a 2D image to volume. everything is fine until the line 23"nDim=size(OV)". then I am getting this error: 'The logical indices contain a true value outside of the array bounds'.
Any body can help?
Rik
Rik 2019년 4월 16일
That sounds like you might have defined a variable with the name size.
AYYOUB AZNAG
AYYOUB AZNAG 2021년 6월 28일
Hello ,i'm now on thesis period and i need your help for 3D reconstruction from 2D image , Thank you
Rik
Rik 2021년 6월 28일
@AYYOUB AZNAG Have a read here and here. It will greatly improve your chances of getting an answer.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

질문:

2018년 2월 22일

댓글:

Rik
2021년 6월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by