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 instead
    static 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 instead
    static 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 in outputImage all the pixels connected to (x0,y0) that have the same pixel value in image, 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 instead
    static void floodFillFloat​(ij.process.ImageProcessor inputImage, int x0, int y0, ij.process.ImageProcessor outputImage, float value, int conn)
    Assigns in labelImage all the neighbor pixels of (x0,y0) that have the same pixel value in image, 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 propagated
      x0 - the x-coordinate of the seed pixel
      y0 - the y-coordinate of the seed pixel
      value - 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 propagated
      x0 - the x-coordinate of the seed pixel
      y0 - the y-coordinate of the seed pixel
      value - 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 in outputImage all the pixels connected to (x0,y0) that have the same pixel value in image, the specified new value (value), using the specified connectivity.
      Parameters:
      inputImage - original image to read the pixel values from
      x0 - the x-coordinate of the seed pixel
      y0 - the y-coordinate of the seed pixel
      outputImage - the label image to fill in
      value - filling value
      conn - 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 in labelImage all the neighbor pixels of (x0,y0) that have the same pixel value in image, the specified new label value (value), using the specified connectivity.
      Parameters:
      inputImage - original image to read the pixel values from
      x0 - the x-coordinate of the seed pixel
      y0 - the y-coordinate of the seed pixel
      outputImage - the label image to fill in
      value - filling value
      conn - 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 propagated
      x - the x-coordinate of the seed voxel
      y - the y-coordinate of the seed voxel
      z - the z-coordinate of the seed voxel
      value - 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 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 floating point value. Should work the same way for all type of images.
      Parameters:
      image - the 3D image in which floodfill will be propagated
      x - the x-coordinate of the seed voxel
      y - the y-coordinate of the seed voxel
      z - the z-coordinate of the seed voxel
      value - 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 instead
      Assign to all the neighbor voxels of (x,y,z) that have the same voxel value in image, the specified new label value ( value) in labelImage, using the specified connectivity.
      Parameters:
      inputImage - original image to read the voxel values from (should be integer based)
      x - x- coordinate of the seed voxel
      y - y- coordinate of the seed voxel
      z - z- coordinate of the seed voxel
      outputImage - output image to fill (should be integer based)
      value - filling value
      conn - 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 instead
      Assigns to all the neighbor voxels of (x,y,z) that have the same voxel value in image, the specified new label value ( value) in labelImage, using the specified connectivity.
      Parameters:
      inputImage - original image to read the voxel values from
      x - x- coordinate of the seed voxel
      y - y- coordinate of the seed voxel
      z - z- coordinate of the seed voxel
      outputImage - output label image (to fill)
      value - filling value
      conn - connectivity to use (6 or 26)