File Exchange

image thumbnail

blockPlot - A block-like 3D drawer for binary masks

version 1.0 (2.68 KB) by

Creates a 3D stacked block drawing of a binary mask, such one from a structure outlined in an MRI/CT



View License

This function creates a 3D stacked block drawing of a binary mask by drawing square patch objects at each face of the mask which borders empty space. It is similar to isosurface, and useful for visualizing a 3D binary mask in its entirety (with no interpolation as in isosurface).

function xface=blockPlot(mask, offset, varargin)

mask - a 3D logical array or a 3D binary mask. The function will draw
boxes around all points (1's) in the mask which border empty
space (0's).
Interior points which do not border any empty space will not be
If no input is given, draws an example (wavy cone)
offset - 3-component vector added to the coordinate of all patches drawn
(default=[0 0 0])
Useful if the user wants to pass only part of the figure to be
drawn, but have the coordinates correct to match another plot
varagin - pair of plot style properties to pass to the patch command.
ex: (...,'color','r'), (...,'facealpha',.5),
(...,'edgecolor','none'), etc
xface - returns patch object that was drawn

p=blockPlot(ones([10 10 10]));
p=blockPlot(ones([10 10 10]), [0 0 0], 'facecolor','r', 'facealpha',.5)

Comments and Ratings (1)


MATLAB Release
MATLAB 7.12 (R2011a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video