Class Watershed

java.lang.Object
inra.ijpb.watershed.Watershed

public class Watershed
extends java.lang.Object
Several static methods for computing watershed in 2D/3D images.
Author:
Ignacio Arganda-Carreras
  • Constructor Summary

    Constructors
    Constructor Description
    Watershed()  
  • Method Summary

    Modifier and Type Method Description
    static ij.ImagePlus computeWatershed​(ij.ImagePlus input, ij.ImagePlus mask, int connectivity)
    Compute fast watershed using flooding simulations, as described by Soille, Pierre, and Luc M.
    static ij.ImagePlus computeWatershed​(ij.ImagePlus input, ij.ImagePlus marker, int connectivity, boolean getDams)
    Compute watershed with markers.
    static ij.ImagePlus computeWatershed​(ij.ImagePlus input, ij.ImagePlus marker, int connectivity, boolean getDams, boolean verbose)
    Compute watershed with markers
    static ij.ImagePlus computeWatershed​(ij.ImagePlus input, ij.ImagePlus mask, int connectivity, double hMin, double hMax)
    Compute fast watershed using flooding simulations, as described by Soille, Pierre, and Luc M.
    static ij.ImagePlus computeWatershed​(ij.ImagePlus input, ij.ImagePlus mask, int connectivity, double hMin, double hMax, boolean verbose)
    Compute fast watershed using flooding simulations, as described by Soille, Pierre, and Luc M.
    static ij.ImagePlus computeWatershed​(ij.ImagePlus input, ij.ImagePlus marker, ij.ImagePlus binaryMask, int connectivity, boolean getDams)
    Compute watershed with markers with an optional binary mask to restrict the regions of application.
    static ij.ImagePlus computeWatershed​(ij.ImagePlus input, ij.ImagePlus marker, ij.ImagePlus binaryMask, int connectivity, boolean getDams, boolean verbose)
    Compute watershed with markers with an optional binary mask to restrict the regions of application.
    static ij.ImagePlus computeWatershed​(ij.ImagePlus input, ij.ImagePlus marker, ij.ImagePlus binaryMask, int connectivity, boolean getDams, double compactness, boolean verbose)
    Compute watershed with markers with an optional binary mask to restrict the regions of application.
    static ij.ImageStack computeWatershed​(ij.ImageStack input, ij.ImageStack mask, boolean verbose, int connectivity)
    Compute fast watershed using flooding simulations, as described by Soille, Pierre, and Luc M.
    static ij.ImageStack computeWatershed​(ij.ImageStack input, ij.ImageStack mask, int connectivity)
    Compute fast watershed using flooding simulations, as described by Soille, Pierre, and Luc M.
    static ij.ImageStack computeWatershed​(ij.ImageStack input, ij.ImageStack marker, int connectivity, boolean getDams)
    Compute watershed with markers.
    static ij.ImageStack computeWatershed​(ij.ImageStack input, ij.ImageStack marker, int connectivity, boolean getDams, boolean verbose)
    Compute watershed with markers.
    static ij.ImageStack computeWatershed​(ij.ImageStack input, ij.ImageStack marker, ij.ImageStack binaryMask, int connectivity, boolean getDams)
    Compute watershed with markers with an optional binary mask to restrict the regions of application.
    static ij.ImageStack computeWatershed​(ij.ImageStack input, ij.ImageStack marker, ij.ImageStack binaryMask, int connectivity, boolean getDams, boolean verbose)
    Compute watershed with markers with an optional binary mask to restrict the regions of application
    static ij.process.ImageProcessor computeWatershed​(ij.process.ImageProcessor input, ij.process.ImageProcessor mask, boolean verbose, int connectivity)
    Compute fast watershed using flooding simulations, as described by Soille, Pierre, and Luc M.
    static ij.process.ImageProcessor computeWatershed​(ij.process.ImageProcessor input, ij.process.ImageProcessor mask, int connectivity)
    Compute fast watershed using flooding simulations, as described by Soille, Pierre, and Luc M.
    static ij.process.ImageProcessor computeWatershed​(ij.process.ImageProcessor input, ij.process.ImageProcessor marker, int connectivity, boolean getDams)
    Compute watershed with markers.
    static ij.process.ImageProcessor computeWatershed​(ij.process.ImageProcessor input, ij.process.ImageProcessor marker, int connectivity, boolean getDams, boolean verbose)
    Compute watershed with markers.
    static ij.process.ImageProcessor computeWatershed​(ij.process.ImageProcessor input, ij.process.ImageProcessor marker, ij.process.ImageProcessor binaryMask, int connectivity, boolean getDams)
    Compute watershed with markers with an optional binary mask to restrict the regions of application.
    static ij.process.ImageProcessor computeWatershed​(ij.process.ImageProcessor input, ij.process.ImageProcessor marker, ij.process.ImageProcessor binaryMask, int connectivity, boolean getDams, boolean verbose)
    Compute watershed with markers with an optional binary mask to restrict the regions of application.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Watershed

      public Watershed()
  • Method Details

    • computeWatershed

      public static ij.ImagePlus computeWatershed​(ij.ImagePlus input, ij.ImagePlus mask, int connectivity)
      Compute fast watershed using flooding simulations, as described by Soille, Pierre, and Luc M. Vincent. "Determining watersheds in digital pictures via flooding simulations." Lausanne-DL tentative. International Society for Optics and Photonics, 1990.
      Parameters:
      input - original grayscale image (usually a gradient image)
      mask - binary mask to restrict the regions of interest
      connectivity - voxel connectivity to define neighborhoods
      Returns:
      image of labeled catchment basins with dams (labels are 1, 2, ...)
    • computeWatershed

      public static ij.ImagePlus computeWatershed​(ij.ImagePlus input, ij.ImagePlus mask, int connectivity, double hMin, double hMax)
      Compute fast watershed using flooding simulations, as described by Soille, Pierre, and Luc M. Vincent. "Determining watersheds in digital pictures via flooding simulations." Lausanne-DL tentative. International Society for Optics and Photonics, 1990. Note: it outputs step messages in the Log window.
      Parameters:
      input - original grayscale image (usually a gradient image)
      mask - binary mask to restrict the regions of interest
      connectivity - voxel connectivity to define neighborhoods
      hMin - the minimum value for dynamic
      hMax - the maximum value for dynamic
      Returns:
      image of labeled catchment basins with dams (labels are 1, 2, ...)
    • computeWatershed

      public static ij.ImagePlus computeWatershed​(ij.ImagePlus input, ij.ImagePlus mask, int connectivity, double hMin, double hMax, boolean verbose)
      Compute fast watershed using flooding simulations, as described by Soille, Pierre, and Luc M. Vincent. "Determining watersheds in digital pictures via flooding simulations." Lausanne-DL tentative. International Society for Optics and Photonics, 1990.
      Parameters:
      input - original grayscale image (usually a gradient image)
      mask - binary mask to restrict the regions of interest
      connectivity - voxel connectivity to define neighborhoods
      hMin - the minimum value for dynamic
      hMax - the maximum value for dynamic
      verbose - flag to output step messages in Log window
      Returns:
      image of labeled catchment basins with dams (labels are 1, 2, ...)
    • computeWatershed

      public static ij.ImageStack computeWatershed​(ij.ImageStack input, ij.ImageStack mask, boolean verbose, int connectivity)
      Compute fast watershed using flooding simulations, as described by Soille, Pierre, and Luc M. Vincent. "Determining watersheds in digital pictures via flooding simulations." Lausanne-DL tentative. International Society for Optics and Photonics, 1990.
      Parameters:
      input - original grayscale image (usually a gradient image)
      mask - binary mask to restrict the regions of interest
      verbose - flag to output step messages in Log window
      connectivity - voxel connectivity to define neighborhoods
      Returns:
      image of labeled catchment basins with dams (labels are 1, 2, ...)
    • computeWatershed

      public static ij.ImageStack computeWatershed​(ij.ImageStack input, ij.ImageStack mask, int connectivity)
      Compute fast watershed using flooding simulations, as described by Soille, Pierre, and Luc M. Vincent. "Determining watersheds in digital pictures via flooding simulations." Lausanne-DL tentative. International Society for Optics and Photonics, 1990. Note: it outputs step messages in the Log window.
      Parameters:
      input - original grayscale image (usually a gradient image)
      mask - binary mask to restrict the regions of interest
      connectivity - voxel connectivity to define neighborhoods
      Returns:
      image of labeled catchment basins with dams (labels are 1, 2, ...)
    • computeWatershed

      public static ij.process.ImageProcessor computeWatershed​(ij.process.ImageProcessor input, ij.process.ImageProcessor mask, boolean verbose, int connectivity)
      Compute fast watershed using flooding simulations, as described by Soille, Pierre, and Luc M. Vincent. "Determining watersheds in digital pictures via flooding simulations." Lausanne-DL tentative. International Society for Optics and Photonics, 1990.
      Parameters:
      input - original grayscale image (usually a gradient image)
      mask - binary mask to restrict the regions of interest
      verbose - flag to output step messages in Log window
      connectivity - pixel connectivity to define neighborhoods (4 or 8)
      Returns:
      image of labeled catchment basins with dams (labels are 1, 2, ...)
    • computeWatershed

      public static ij.process.ImageProcessor computeWatershed​(ij.process.ImageProcessor input, ij.process.ImageProcessor mask, int connectivity)
      Compute fast watershed using flooding simulations, as described by Soille, Pierre, and Luc M. Vincent. "Determining watersheds in digital pictures via flooding simulations." Lausanne-DL tentative. International Society for Optics and Photonics, 1990. Note: it outputs step messages in Log window.
      Parameters:
      input - original grayscale image (usually a gradient image)
      mask - binary mask to restrict the regions of interest
      connectivity - pixel connectivity to define neighborhoods (4 or 8)
      Returns:
      image of labeled catchment basins with dams (labels are 1, 2, ...)
    • computeWatershed

      public static ij.ImagePlus computeWatershed​(ij.ImagePlus input, ij.ImagePlus marker, ij.ImagePlus binaryMask, int connectivity, boolean getDams)
      Compute watershed with markers with an optional binary mask to restrict the regions of application. Note: it outputs step messages in Log window.
      Parameters:
      input - original grayscale image (usually a gradient image)
      marker - image with labeled markers
      binaryMask - binary mask to restrict the regions of interest
      connectivity - voxel connectivity to define neighborhoods (4 or 8 for 2D, 6 or 26 for 3D)
      getDams - select/deselect the calculation of dams
      Returns:
      image of labeled catchment basins (labels are 1, 2, ...)
    • computeWatershed

      public static ij.ImagePlus computeWatershed​(ij.ImagePlus input, ij.ImagePlus marker, ij.ImagePlus binaryMask, int connectivity, boolean getDams, boolean verbose)
      Compute watershed with markers with an optional binary mask to restrict the regions of application.
      Parameters:
      input - original grayscale image (usually a gradient image)
      marker - image with labeled markers
      binaryMask - binary mask to restrict the regions of interest
      connectivity - voxel connectivity to define neighborhoods (4 or 8 for 2D, 6 or 26 for 3D)
      getDams - select/deselect the calculation of dams
      verbose - flag to display messages in the log window
      Returns:
      image of labeled catchment basins (labels are 1, 2, ...)
    • computeWatershed

      public static ij.ImagePlus computeWatershed​(ij.ImagePlus input, ij.ImagePlus marker, ij.ImagePlus binaryMask, int connectivity, boolean getDams, double compactness, boolean verbose)
      Compute watershed with markers with an optional binary mask to restrict the regions of application. If the compactness constraint is larger than 0, the Compact Watershed algorithm will be executed (Peer Neubert and Peter Protzel. "Compact Watershed and Preemptive SLIC: On improving trade-offs of superpixel segmentation algorithms." 22nd international conference on pattern recognition. IEEE, 2014).
      Parameters:
      input - original grayscale image (usually a gradient image)
      marker - image with labeled markers
      binaryMask - binary mask to restrict the regions of interest
      connectivity - voxel connectivity to define neighborhoods (4 or 8 for 2D, 6 or 26 for 3D)
      getDams - select/deselect the calculation of dams
      compactness - compactness constrain parameter (values larger than 0 involve using compact watershed)
      verbose - flag to display messages in the log window
      Returns:
      image of labeled catchment basins (labels are 1, 2, ...)
    • computeWatershed

      public static ij.ImageStack computeWatershed​(ij.ImageStack input, ij.ImageStack marker, ij.ImageStack binaryMask, int connectivity, boolean getDams)
      Compute watershed with markers with an optional binary mask to restrict the regions of application. Note: it outputs step messages in Log window.
      Parameters:
      input - original grayscale image (usually a gradient image)
      marker - image with labeled markers
      binaryMask - binary mask to restrict the regions of interest
      connectivity - voxel connectivity to define neighborhoods
      getDams - select/deselect the calculation of dams
      Returns:
      image of labeled catchment basins (labels are 1, 2, ...)
    • computeWatershed

      public static ij.ImageStack computeWatershed​(ij.ImageStack input, ij.ImageStack marker, ij.ImageStack binaryMask, int connectivity, boolean getDams, boolean verbose)
      Compute watershed with markers with an optional binary mask to restrict the regions of application
      Parameters:
      input - original grayscale image (usually a gradient image)
      marker - image with labeled markers
      binaryMask - binary mask to restrict the regions of interest
      connectivity - voxel connectivity to define neighborhoods
      getDams - select/deselect the calculation of dams
      verbose - flag to display messages in the log window
      Returns:
      image of labeled catchment basins (labels are 1, 2, ...)
    • computeWatershed

      public static ij.process.ImageProcessor computeWatershed​(ij.process.ImageProcessor input, ij.process.ImageProcessor marker, ij.process.ImageProcessor binaryMask, int connectivity, boolean getDams)
      Compute watershed with markers with an optional binary mask to restrict the regions of application. Note: it outputs step messages in Log window.
      Parameters:
      input - original grayscale image (usually a gradient image)
      marker - image with labeled markers
      binaryMask - binary mask to restrict the regions of interest
      connectivity - voxel connectivity to define neighborhoods
      getDams - select/deselect the calculation of dams
      Returns:
      image of labeled catchment basins (labels are 1, 2, ...)
    • computeWatershed

      public static ij.process.ImageProcessor computeWatershed​(ij.process.ImageProcessor input, ij.process.ImageProcessor marker, ij.process.ImageProcessor binaryMask, int connectivity, boolean getDams, boolean verbose)
      Compute watershed with markers with an optional binary mask to restrict the regions of application.
      Parameters:
      input - original grayscale image (usually a gradient image)
      marker - image with labeled markers
      binaryMask - binary mask to restrict the regions of interest
      connectivity - voxel connectivity to define neighborhoods
      getDams - select/deselect the calculation of dams
      verbose - flag to display log messages
      Returns:
      image of labeled catchment basins (labels are 1, 2, ...)
    • computeWatershed

      public static ij.ImagePlus computeWatershed​(ij.ImagePlus input, ij.ImagePlus marker, int connectivity, boolean getDams, boolean verbose)
      Compute watershed with markers
      Parameters:
      input - original grayscale image (usually a gradient image)
      marker - image with labeled markers
      connectivity - voxel connectivity to define neighborhoods
      getDams - select/deselect the calculation of dams
      verbose - flag to output step messages in Log window.
      Returns:
      image of labeled catchment basins (labels are 1, 2, ...)
    • computeWatershed

      public static ij.ImagePlus computeWatershed​(ij.ImagePlus input, ij.ImagePlus marker, int connectivity, boolean getDams)
      Compute watershed with markers. Note: it outputs step messages in the Log window.
      Parameters:
      input - original grayscale image (usually a gradient image)
      marker - image with labeled markers
      connectivity - voxel connectivity to define neighborhoods
      getDams - select/deselect the calculation of dams
      Returns:
      image of labeled catchment basins (labels are 1, 2, ...)
    • computeWatershed

      public static ij.ImageStack computeWatershed​(ij.ImageStack input, ij.ImageStack marker, int connectivity, boolean getDams, boolean verbose)
      Compute watershed with markers.
      Parameters:
      input - original grayscale image (usually a gradient image)
      marker - image with labeled markers
      connectivity - voxel connectivity to define neighborhoods
      getDams - select/deselect the calculation of dams
      verbose - flag to output step message in the Log window
      Returns:
      image of labeled catchment basins (labels are 1, 2, ...)
    • computeWatershed

      public static ij.ImageStack computeWatershed​(ij.ImageStack input, ij.ImageStack marker, int connectivity, boolean getDams)
      Compute watershed with markers. Note: it outputs step messages in the Low window.
      Parameters:
      input - original grayscale image (usually a gradient image)
      marker - image with labeled markers
      connectivity - voxel connectivity to define neighborhoods
      getDams - select/deselect the calculation of dams
      Returns:
      image of labeled catchment basins (labels are 1, 2, ...)
    • computeWatershed

      public static ij.process.ImageProcessor computeWatershed​(ij.process.ImageProcessor input, ij.process.ImageProcessor marker, int connectivity, boolean getDams, boolean verbose)
      Compute watershed with markers.
      Parameters:
      input - original grayscale image (usually a gradient image)
      marker - image with labeled markers
      connectivity - voxel connectivity to define neighborhoods
      getDams - select/deselect the calculation of dams
      verbose - flag to output step messages in the Low window
      Returns:
      image of labeled catchment basins (labels are 1, 2, ...)
    • computeWatershed

      public static ij.process.ImageProcessor computeWatershed​(ij.process.ImageProcessor input, ij.process.ImageProcessor marker, int connectivity, boolean getDams)
      Compute watershed with markers. Note: it outputs step message in the Low window.
      Parameters:
      input - original grayscale image (usually a gradient image)
      marker - image with labeled markers
      connectivity - voxel connectivity to define neighborhoods
      getDams - select/deselect the calculation of dams
      Returns:
      image of labeled catchment basins (labels are 1, 2, ...)