概述
% IM_3D creates a solid, 3D image of multiple slices. First, create a
% string of the directory name of the files (DIRECT1) and a cell of the
% .png filenames (FILES). All files must be the same dimensions and must be
% in the order from lowest slice to highest slice.
%
% example:
% direct1='~/webMill/2011-08-18/region4/images/';
% files=
% 'Result_7481_sub13755.0_vol3.0_sl28_rater27_tutfalse.png'
% 'Result_22495_sub13755.0_vol3.0_sl29_rater57_tutfalse.png'
% 'Result_42271_sub13755.0_vol3.0_sl30_rater32_tutfalse.png'
% 'Result_30727_sub13755.0_vol3.0_sl31_rater83_tutfalse.png'
% im_3d(direct2,files)
function im_3d(direct1,files)
c=length(imread([direct1 files{1,1}])); %finds dimensions of the matrix of the image
x=double(zeros(c,c,length(files))); %creates a zeros 3D matrix
for iii=1:length(files);
x(:,:,iii)=imread([direct1 files{iii,1}]); %puts each slice into matrix
end
z=smooth3(x);
isosurface(z) %creates 3D image
patch(isocaps(z,2),'Edgecolor','blue');
brighten(1)
light
最后
以上就是跳跃雨为你收集整理的matlab两个产量三维图,matlab用几张图片形成一个三维图的全部内容,希望文章能够帮你解决matlab两个产量三维图,matlab用几张图片形成一个三维图所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复