简体   繁体   English

MATLAB 3D体积可视化

[英]MATLAB 3D volume visualization

I have a matrix M, 135*191*121 double and want to plot it in 3D volume by using those 121 slices. 我有一个M, 135*191*121 double的矩阵M, 135*191*121 double并希望通过使用这121个切片将其绘制为3D体积。 How can I do this? 我怎样才能做到这一点? (I need a grayscale image) (我需要一个灰度图像)

Regards 问候

Check out vol3d v2 , it an update to Joe Conti's vol3d function, allowing voxel colors and alpha values to be defined explicitly. 检出vol3d v2 ,它是Joe Conti的vol3d函数的更新,允许显式定义体素颜色和alpha值。 In cases where voxels can be any RGB color, use: 如果体素可以是任何RGB颜色,请使用:

 vol3d('CData', cdata);

where cdata is an MxNxPx3 array, with RGB color along the 4th dimension. 其中cdata是一个MxNxPx3数组,第4维为RGB颜色。 In cases where color and alpha values are highly independent, specify an MxNxP alphamatte as follows: 如果颜色和Alpha值高度独立,请按如下所示指定MxNxP alphamatte:

vol3d('CData', cdata, 'Alpha', alpha);

if you have 3 arrays, storing (x,y,z) coordinates of every point that you need to plot, then you can use function plot3 如果您有3个数组,分别存储需要绘制的每个点的(x,y,z)坐标,则可以使用plot3函数
From matlab help 从Matlab帮助

PLOT3 Plot lines and points in 3-D space. PLOT3绘制3-D空间中的线和点。 PLOT3() is a three-dimensional analogue of PLOT(). PLOT3()是PLOT()的三维类似物。

 PLOT3(x,y,z), where x, y and z are three vectors of the same length, plots a line in 3-space through the points whose coordinates are the elements of x, y and z. PLOT3(X,Y,Z), where X, Y and Z are three matrices of the same size, plots several lines obtained from the columns of X, Y and Z. Various line types, plot symbols and colors may be obtained with PLOT3(X,Y,Z,s) where s is a 1, 2 or 3 character string made from the characters listed under the PLOT command. PLOT3(x1,y1,z1,s1,x2,y2,z2,s2,x3,y3,z3,s3,...) combines the plots defined by the (x,y,z,s) fourtuples, where the x's, y's and z's are vectors or matrices and the s's are strings. Example: A helix: t = 0:pi/50:10*pi; plot3(sin(t),cos(t),t); PLOT3 returns a column vector of handles to lineseries objects, one handle per line. The X,Y,Z triples, or X,Y,Z,S quads, can be followed by parameter/value pairs to specify additional properties of the lines. 

for 3d plots you may also want to look into surf function 对于3D图,您可能还需要研究冲浪功能

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM