12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

educevolumePurpose2reducevolumeReduce the number of elements in a volume data setSyntaxDescriptionExamples[nx,ny,nz,nv] = reducevolume(X,Y,Z,V,[Rx,Ry,Rz])[nx,ny,nz,nv] = reducevolume(V,[Rx,Ry,Rz])nv = reducevolume(...)[nx,ny,nz,nv] = reducevolume(X,Y,Z,V,[Rx,Ry,Rz]) reduces the numberof elements in the volume by retaining every Rx th element in the x direction,every Ry th element in the y direction, and every Rz th element in the z direction.If a scalar R is used to indicate the amount or reduction instead of a 3-elementvector, <strong>MATLAB</strong> assumes the reduction to be [R R R].The arrays X, Y, and Z define the coordinates for the volume V. The reducedvolume is returned in nv and the coordinates of the reduced volume arereturned in nx, ny, and nz.[nx,ny,nz,nv] = reducevolume(V,[Rx,Ry,Rz]) assumes the arrays X, Y, andZ are defined as [X,Y,Z] = meshgrid(1:n,1:m,1:p) where [m,n,p] =size(V).nv = reducevolume(...) returns only the reduced volume.This example uses a data set that is a collection of MRI slices of a human skull.This data is processed in a variety of ways:• The 4-D array is squeezed (squeeze) into three dimensions and then reduced(reducevolume) so that what remains is every 4 th element in the x and ydirections and every element in the z direction.• The reduced data is smoothed (smooth3).• The outline of the skull is an isosurface generated as a patch (p1) whosevertex normals are recalculated to improve the appearance when lighting isapplied (patch, isosurface, isonormals).• A second patch (p2) with an interpolated face color draws the end caps(FaceColor, isocaps).• The view of the object is set (view, axis, daspect).2-403

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!