Package inra.ijpb.morphology
Class FloodFill
java.lang.Object
inra.ijpb.morphology.FloodFill
public class FloodFill
extends java.lang.Object
Implements various flood-fill algorithms, for planar images. Rewritten from ij.process.FloodFiller. Also support floating point images. The FloodFill3D class provides support for 3D flood-fill algorithms.
Check also "http://en.wikipedia.org/wiki/Flood_fill".
- Author:
- David Legland
- See Also:
FloodFill3D
,MinimaAndMaxima
,RegionalExtremaByFlooding
,BinaryImages.componentsLabeling(ImageProcessor, int, int)
-
Method Summary
Modifier and Type Method Description static void
floodFill(ij.ImageStack image, int x, int y, int z, double value, int conn)
Deprecated.use FLoodFill3D.floodFill insteadstatic void
floodFill(ij.ImageStack image, int x, int y, int z, int value, int conn)
Deprecated.use FloodFill3D.floodFill instead.static void
floodFill(ij.ImageStack inputImage, int x, int y, int z, ij.ImageStack outputImage, int value, int conn)
Deprecated.use FloodFill3D.floodFill insteadstatic void
floodFill(ij.process.ImageProcessor image, int x0, int y0, float value, int conn)
Replaces all the neighbor pixels of (x,y) that have the same values by the specified integer value, using the specified connectivity.static void
floodFill(ij.process.ImageProcessor image, int x0, int y0, int value, int conn)
Replaces all the neighbor pixels of (x0,y0) that have the same values by the specified integer value, using the specified connectivity.static void
floodFill(ij.process.ImageProcessor inputImage, int x0, int y0, ij.process.ImageProcessor outputImage, int value, int conn)
Assigns inoutputImage
all the pixels connected to (x0,y0) that have the same pixel value inimage
, the specified new value (value
), using the specified connectivity.static void
floodFillFloat(ij.ImageStack inputImage, int x, int y, int z, ij.ImageStack outputImage, float value, int conn)
Deprecated.use FloodFill3D.floodFillFloat insteadstatic void
floodFillFloat(ij.process.ImageProcessor inputImage, int x0, int y0, ij.process.ImageProcessor outputImage, float value, int conn)
Assigns inlabelImage
all the neighbor pixels of (x0,y0) that have the same pixel value inimage
, the specified new label value (value
), 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.process.ImageProcessor image, int x0, int y0, int value, int conn)Replaces all the neighbor pixels of (x0,y0) that have the same values by the specified integer value, using the specified connectivity.- Parameters:
image
- the image in which floodfill will be propagatedx0
- the x-coordinate of the seed pixely0
- the y-coordinate of the seed pixelvalue
- the new value of the connected component at (x,y)conn
- the connectivity to use, either 4 or 8
-
floodFill
public static final void floodFill(ij.process.ImageProcessor image, int x0, int y0, float value, int conn)Replaces all the neighbor pixels of (x,y) that have the same values by the specified integer value, using the specified connectivity.- Parameters:
image
- the image in which floodfill will be propagatedx0
- the x-coordinate of the seed pixely0
- the y-coordinate of the seed pixelvalue
- the new value of the connected component at (x,y)conn
- the connectivity to use, either 4 or 8
-
floodFill
public static final void floodFill(ij.process.ImageProcessor inputImage, int x0, int y0, ij.process.ImageProcessor outputImage, int value, int conn)Assigns inoutputImage
all the pixels connected to (x0,y0) that have the same pixel value inimage
, the specified new value (value
), using the specified connectivity.- Parameters:
inputImage
- original image to read the pixel values fromx0
- the x-coordinate of the seed pixely0
- the y-coordinate of the seed pixeloutputImage
- the label image to fill invalue
- filling valueconn
- connectivity to use (4 or 8)
-
floodFillFloat
public static final void floodFillFloat(ij.process.ImageProcessor inputImage, int x0, int y0, ij.process.ImageProcessor outputImage, float value, int conn)Assigns inlabelImage
all the neighbor pixels of (x0,y0) that have the same pixel value inimage
, the specified new label value (value
), using the specified connectivity.- Parameters:
inputImage
- original image to read the pixel values fromx0
- the x-coordinate of the seed pixely0
- the y-coordinate of the seed pixeloutputImage
- the label image to fill invalue
- filling valueconn
- connectivity to use (4 or 8)
-
floodFill
@Deprecated public static final void floodFill(ij.ImageStack image, int x, int y, int z, int value, int conn)Deprecated.use FloodFill3D.floodFill instead.Replaces all the pixels in the 6-neighborhood of (x,y,z) that have the same values as the pixel in (x,y,z) by the specified value. Should work for all integer based 3D images.- Parameters:
image
- the 3D image in which floodfill will be propagatedx
- the x-coordinate of the seed voxely
- the y-coordinate of the seed voxelz
- 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
@Deprecated public static final void floodFill(ij.ImageStack image, int x, int y, int z, double value, int conn)Deprecated.use FLoodFill3D.floodFill insteadReplaces all the pixels in the 6-neighborhood of (x,y,z) that have the same values as the pixel in (x,y,z) 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 propagatedx
- the x-coordinate of the seed voxely
- the y-coordinate of the seed voxelz
- 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
@Deprecated public static final void floodFill(ij.ImageStack inputImage, int x, int y, int z, ij.ImageStack outputImage, int value, int conn)Deprecated.use FloodFill3D.floodFill insteadAssign to all the neighbor voxels of (x,y,z) that have the same voxel value inimage
, the specified new label value (value
) inlabelImage
, using the specified connectivity.- Parameters:
inputImage
- original image to read the voxel values from (should be integer based)x
- x- coordinate of the seed voxely
- y- coordinate of the seed voxelz
- z- coordinate of the seed voxeloutputImage
- output image to fill (should be integer based)value
- filling valueconn
- connectivity to use (6 or 26)
-
floodFillFloat
@Deprecated public static final void floodFillFloat(ij.ImageStack inputImage, int x, int y, int z, ij.ImageStack outputImage, float value, int conn)Deprecated.use FloodFill3D.floodFillFloat insteadAssigns to all the neighbor voxels of (x,y,z) that have the same voxel value inimage
, the specified new label value (value
) inlabelImage
, using the specified connectivity.- Parameters:
inputImage
- original image to read the voxel values fromx
- x- coordinate of the seed voxely
- y- coordinate of the seed voxelz
- z- coordinate of the seed voxeloutputImage
- output label image (to fill)value
- filling valueconn
- connectivity to use (6 or 26)
-