Package inra.ijpb.morphology
Class FloodFill3D
java.lang.Object
inra.ijpb.morphology.FloodFill3D
public class FloodFill3D
extends java.lang.Object
Implements various flood-fill algorithms for 3D stacks. Rewritten from ij.process.FloodFiller and adapted to 3D stacks. Also support floating point stacks.
Check also "http://en.wikipedia.org/wiki/Flood_fill".
- Author:
- David Legland
- See Also:
FloodFill
,MinimaAndMaxima3D
,RegionalExtrema3DByFlooding
,BinaryImages.componentsLabeling(ImageStack, int, int)
-
Method Summary
Modifier and Type Method Description static void
floodFill(ij.ImageStack image, int x0, int y0, int z0, double value, int conn)
Replaces all the pixels in the 6-neighborhood of (x0,y0,z0) that have the same values as the pixel in (x0,y0,z0) by the specified floating point value.static void
floodFill(ij.ImageStack image, int x0, int y0, int z0, int value, int conn)
Replaces all the pixels in the 6-neighborhood of (x0,y0,z0) that have the same values as the pixel in (x0,y0,z0) by the specified value.static void
floodFill(ij.ImageStack inputImage, int x0, int y0, int z0, ij.ImageStack outputImage, int value, int conn)
Assign to all the neighbor voxels of (x0,y0,z0) that have the same voxel value ininputImage
, the specified new value (value
) inoutputImage
, using the specified connectivity.static void
floodFillFloat(ij.ImageStack inputImage, int x0, int y0, int z0, ij.ImageStack outputImage, float value, int conn)
Assigns to all the neighbor voxels of (x0,y0,z0) that have the same voxel value ininputImage
, the specified new value (value
) inoutputImage
, using the specified connectivity.static void
floodFillFloat(Image3D inputImage, int x0, int y0, int z0, Image3D outputImage, float value, int conn)
Assigns to all the neighbor voxels of (x0,y0,z0) that have the same voxel value ininputImage
, the specified new value (value
) inoutputImage
, using the specified connectivity.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
floodFill
public static final void floodFill(ij.ImageStack image, int x0, int y0, int z0, int value, int conn)Replaces all the pixels in the 6-neighborhood of (x0,y0,z0) that have the same values as the pixel in (x0,y0,z0) by the specified value. Should work for all integer based 3D images.- Parameters:
image
- the 3D image in which floodfill will be propagatedx0
- the x-coordinate of the seed voxely0
- the y-coordinate of the seed voxelz0
- the z-coordinate of the seed voxelvalue
- the new value of the connected component at (x,y,z)conn
- the connectivity to use, either 6 or 26
-
floodFill
public static final void floodFill(ij.ImageStack image, int x0, int y0, int z0, double value, int conn)Replaces all the pixels in the 6-neighborhood of (x0,y0,z0) that have the same values as the pixel in (x0,y0,z0) by the specified floating point value. Should work the same way for all type of images.- Parameters:
image
- the 3D image in which floodfill will be propagatedx0
- the x-coordinate of the seed voxely0
- the y-coordinate of the seed voxelz0
- the z-coordinate of the seed voxelvalue
- the new value of the connected component at (x,y,z)conn
- the connectivity to use, either 6 or 26
-
floodFill
public static final void floodFill(ij.ImageStack inputImage, int x0, int y0, int z0, ij.ImageStack outputImage, int value, int conn)Assign to all the neighbor voxels of (x0,y0,z0) that have the same voxel value ininputImage
, the specified new value (value
) inoutputImage
, using the specified connectivity.- Parameters:
inputImage
- the original image to read the voxel values from (should be integer based)x0
- the x-coordinate of the seed voxely0
- the y-coordinate of the seed voxelz0
- the z-coordinate of the seed voxeloutputImage
- the output image to fill (should be integer based)value
- the fill valueconn
- the connectivity to use (6 or 26)
-
floodFillFloat
public static final void floodFillFloat(ij.ImageStack inputImage, int x0, int y0, int z0, ij.ImageStack outputImage, float value, int conn)Assigns to all the neighbor voxels of (x0,y0,z0) that have the same voxel value ininputImage
, the specified new value (value
) inoutputImage
, using the specified connectivity.- Parameters:
inputImage
- the original image to read the voxel values fromx0
- the x-coordinate of the seed voxely0
- the y-coordinate of the seed voxelz0
- the z-coordinate of the seed voxeloutputImage
- the output image (to fill)value
- the fill valueconn
- the connectivity to use (6 or 26)
-
floodFillFloat
public static final void floodFillFloat(Image3D inputImage, int x0, int y0, int z0, Image3D outputImage, float value, int conn)Assigns to all the neighbor voxels of (x0,y0,z0) that have the same voxel value ininputImage
, the specified new value (value
) inoutputImage
, using the specified connectivity.- Parameters:
inputImage
- the original image to read the voxel values fromx0
- the x-coordinate of the seed voxely0
- the y-coordinate of the seed voxelz0
- the z-coordinate of the seed voxeloutputImage
- the output image (to fill)value
- the fill valueconn
- the connectivity to use (6 or 26)
-