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.

subvolumePurpose2subvolumeExtract subset of volume data setSyntaxDescriptionExamples[Nx,Ny,Nz,Nv] = subvolume(X,Y,Z,V,limits)[Nx,Ny,Nz,Nv] = subvolume(V,limits)Nv = subvolume(...)[Nx,Ny,Nz,Nv] = subvolume(X,Y,Z,V,limits) extracts a subset of thevolume data set V using the specified axis-aligned limits. limits =[xmin,xmax,ymin, ymax,zmin,zmax] (Any NaNs in the limits indicate that thevolume should not be cropped along that axis).The arrays X, Y, and Z define the coordinates for the volume V. The subvolumeis returned in NV and the coordinates of the subvolume are given in NX, NY, andNZ.[Nx,Ny,Nz,Nv] = subvolume(V,limits) assumes the arrays X, Y, and Z aredefined as [X,Y,Z] = meshgrid(1:N,1:M,1:P) where [M,N,P] = size(V).Nv = subvolume(...) returns only the subvolume.This example uses a data set that is a collection of MRI slices of a human skull.The data is processed in a variety of ways:• The 4-D array is squeezed (squeeze) into three dimensions and then a subsetof the data is extracted (subvolume).• 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 interpolated face color draws the end caps(FaceColor, isocaps).• The view of the object is set (view, axis, daspect).2-466

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

Saved successfully!

Ooh no, something went wrong!