2

我有一个矩阵M, 135*191*121 double,想通过使用这 121 个切片将其绘制为 3D 体积。我怎样才能做到这一点?(我需要一个灰度图像)

问候

4

2 回答 2

4

查看vol3d v2,它是对 Joe Conti 的 vol3d 函数的更新,允许显式定义体素颜色和 alpha 值。如果体素可以是任何 RGB 颜色,请使用:

 vol3d('CData', cdata);

其中 cdata 是一个 MxNxPx3 数组,沿第 4 维具有 RGB 颜色。在颜色和 alpha 值高度独立的情况下,指定 MxNxP alphamatte,如下所示:

vol3d('CData', cdata, 'Alpha', alpha);
于 2012-12-11T01:43:56.227 回答
0

如果您有 3 个数组,存储您需要绘制的每个点的 (x,y,z) 坐标,那么您可以使用函数 plot3
来自 matlab 帮助

PLOT3 在 3-D 空间中绘制线和点。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 绘图,您可能还想查看 surf 功能

于 2012-12-11T01:01:16.087 回答