我有一个矩阵M, 135*191*121 double
,想要使用这121个切片在3D体积中绘制它。我怎样才能做到这一点? (我需要一个灰度图像)
此致
答案 0 :(得分:4)
查看vol3d v2,它是Joe Conti的vol3d函数的更新,允许明确定义体素颜色和alpha值。如果体素可以是任何RGB颜色,请使用:
vol3d('CData', cdata);
其中cdata是MxNxPx3数组,沿第4维颜色为RGB颜色。如果颜色和alpha值高度独立,请按如下所示指定MxNxP alphamatte:
vol3d('CData', cdata, 'Alpha', alpha);
答案 1 :(得分:0)
如果你有3个数组,存储你需要绘制的每个点的(x,y,z)坐标,那么你可以使用函数plot3
来自matlab帮助
PLOT3在三维空间中绘制线条和点。 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.
对于3d绘图,您可能还需要查看冲浪功能