[Top] [Up] [Prev] [Next] [Up] [Basic Concepts] [Demonstrations] [Functions] SDC Morphology Toolbox V1.1 15Jan02

mm3d - 3D processing.


Synopsis
mm3d
Description
Most functions in the SDC Morphology Toolbox operate in 3D. The image must be a binary or gray-scale image with a third dimension. A typical example is a CT or MRI image of many slices (2D) stacked together in the third dimension. To create a 3D structuring element, use mmsedisk or mmimg2se. There are a few functions that do not work in 3D yet, for instance, mmwatershed only works for 2D whereas mmcwatershed and mmswatershed work in 3D.
Examples

Creating 6-neighbors 3D structuring element

b6=mmsedisk(1,'3D','city-block');
mmseshow(b6)

ans(:,:,1) =
     0     0     0
     0     1     0
     0     0     0
ans(:,:,2) =
     0     1     0
     1     1     1
     0     1     0
ans(:,:,3) =
     0     0     0
     0     1     0
     0     0     0

Creating 26-neighbors 3D structuring element

b26=mmsedisk(1,'3D','chessboard');
mmseshow(b26)

ans(:,:,1) =
     1     1     1
     1     1     1
     1     1     1
ans(:,:,2) =
     1     1     1
     1     1     1
     1     1     1
ans(:,:,3) =
     1     1     1
     1     1     1
     1     1     1

Creating 18-neighbors 3D structuring element

b18=mmsedisk(1,'3D','EUCLIDEAN');
mmseshow(b18)

ans(:,:,1) =
     0     1     0
     1     1     1
     0     1     0
ans(:,:,2) =
     1     1     1
     1     1     1
     1     1     1
ans(:,:,3) =
     0     1     0
     1     1     1
     0     1     0

3D Euclidean distance transform

f=logical(uint8(ones(50,50,50)));
f(25,25,25)=0;
d6=mmdist(f,b26,'EUCLIDEAN');
clf;
p = patch(isosurface(d6, 20), ...
    'FaceColor', 'red',...
    'EdgeColor', 'none');
view(3);
daspect([1,1,1]);
camlight;
grid on;
image
(isosurface(d6,20))
See Also
mmimg2se - Create a structuring element from a pair of images.
mmsedisk - Create a disk or a semi-sphere structuring element.
Source code
mm3d.m

[Top] [Up] [Prev] [Next] [Up] [Basic Concepts] [Demonstrations] [Functions] Valid XHTML 1.0!
Copyright (c) 1998-2002 by SDC Information Systems