3.0

3.0 | 3 ratings Rate this file 4 Downloads (last 30 days) File Size: 949.22 KB File ID: #12184

FloodFill3D

by F Dinath

 

05 Sep 2006 (Updated 06 Sep 2006)

This program flood fills a 3D region in a binary matrix

| Watch this File

File Information
Description

[B] = FloodFill3D(A, slice);

This program flood fills a 3D region. The input matrix MUST be binary. The user will select a seed (point) in the matrix to initiate the flood fill. You must specify the matrix slice in which you wish to place the seed.

A = binary matrix
slice = a chosen slice in the matrix where you wish to place the seed.

Enjoy,
F. Dinath

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
07 Sep 2006 Michal Kvasnicka

On Matlab 2006a the following error message is generated:

??? Undefined function or variable "a".

Error in ==> FloodFill3D at 75
b = cell2mat(a);

Error in ==> FloodFill3Dexample at 12
Extract = FloodFill3D(B,60);

07 Sep 2006 John D'Errico

If you just read the help for FloodFill3D, you will not be successful in using it. The demo script helps, so clearly the help is lacking. A few extra comments would make it much easier to use. Once you figure out how to use it, the code did seem to work.

The code places an artificial border around the image, preventing two regions that are connected only by the border from filling. I suppose this may not be a serious problem if this code is used on well targeted images.

Efficiency is an interesting question. The author appears to have taken some care in making it reasonably efficient. While I wanted to rate this code somewhere between 3 and 4 due to my questions about the help, the code seems decent so I chose to round up to a 4.

08 Sep 2006 a non

Re: Michal Kvasnicka

That error message means you are trying to flood fill a region that does not exist. Try running the example script and click on one of the great big red blobs which appear.

09 Sep 2006 Michal Kvasnicka

Of course I know that, but I think that thic spacial case must be properly treated.

11 Oct 2006 J Dunn

Found it nearly works perfectly for my images - except that it misses out the first & last slices of the 3D volume.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
morphology F Dinath 22 Oct 2008 08:37:36
segmentation F Dinath 22 Oct 2008 08:37:36
flood fill floodfill 3d F Dinath 22 Oct 2008 08:37:36

Contact us at files@mathworks.com