| MATLAB Function Reference | ![]() |
化簡在體積(volume)資料(data)集(set)中的元素(element)個數。
Syntax
[nx,ny,nz,nv] = reducevolume(X,Y,Z,V,[Rx,Ry,Rz]) [nx,ny,nz,nv] = reducevolume(V,[Rx,Ry,Rz]) nv = reducevolume(...)
Description
[nx,ny,nz,nv] = reducevolume(X,Y,Z,V,[Rx,Ry,Rz])藉著固定每一個在x方向上的Rxth 元素、每一個在y方線上的Ryth元素和每一個在z方線上的Rzth元素來化簡體積中元素的個數。如果一個純量R被用來指出總數量或是用來取代三個元素(3-element)向量的化簡(reduction),則MATLAB假設化簡(reduction)是[R R R]。
陣列X、Y和Z定義了體積V上的座標。化簡的體積(volume)會被傳回在nv之中,同時化簡體積的座標會被傳回在nx、ny和nz之中。
[nx,ny,nz,nv] = reducevolume(V,[Rx,Ry,Rz])假設陣列X、Y和Z被定義成[X,Y,Z] = meshgrid(1:n,1:m,1:p)其中[m,n,p] = size(V)。
nv = reducevolume(...)只會傳回化簡的體積(reduced volume)。
Examples
這個範例使用了人類(human)頭蓋骨(skull)MRI切片(slices)的蒐集(collection)資料集(data set)。這個資料被多道手續給處理:
squeeze)到三個維度(three dimensions),同時會被化簡(reducevolume),所以留下的是每個在x和y方線上4th的元素以及每個在z方線上的元素。smooth3)p1)來產生的分離表面(isosurface),其頂點的法線(normals)是當光線啟動(applied)的時候為了改進(improve)外觀(appearance)而被重新估算過的(recalculated)(patch、isosurface、isonormals)。p2)畫出端點帽(end caps )(FaceColor、isocaps)。view、axis、daspect)。colormap)。camlight、lighting)。load mri
D = squeeze(D);
[x,y,z,D] = reducevolume(D,[4,4,1]);
D = smooth3(D);
p1 = patch(isosurface(x,y,z,D, 5,'verbose'),...
'FaceColor','red','EdgeColor','none');
isonormals(x,y,z,D,p1);
p2 = patch(isocaps(x,y,z,D, 5),...
'FaceColor','interp','EdgeColor','none');
view(3); axis tight; daspect([1,1,.4])
colormap(gray(100))
camlight; lighting gouraud
See Also
isosurface, isocaps, isonormals, smooth3, subvolume, reducepatch
| reducepatch | refresh | ![]() |