Class MarkerControlledWatershedTransform3D

java.lang.Object
inra.ijpb.watershed.WatershedTransform3D
inra.ijpb.watershed.MarkerControlledWatershedTransform3D

public class MarkerControlledWatershedTransform3D
extends WatershedTransform3D
Marker-controlled version of the watershed transform (works for 2D and 3D images). References: [1] Fernand Meyer and Serge Beucher. "Morphological segmentation." Journal of visual communication and image representation 1.1 (1990): 21-46. [2] 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.
Author:
Ignacio Arganda-Carreras
  • Constructor Summary

    Constructors
    Constructor Description
    MarkerControlledWatershedTransform3D​(ij.ImagePlus input, ij.ImagePlus marker, ij.ImagePlus mask)
    Initialize a marker-controlled watershed transform
    MarkerControlledWatershedTransform3D​(ij.ImagePlus input, ij.ImagePlus marker, ij.ImagePlus mask, int connectivity)
    Initialize a marker-controlled watershed transform
    MarkerControlledWatershedTransform3D​(ij.ImagePlus input, ij.ImagePlus marker, ij.ImagePlus mask, int connectivity, double compactness)
    Initialize a marker-controlled watershed transform
  • Method Summary

    Modifier and Type Method Description
    ij.ImagePlus applyWithPriorityQueue()
    Apply watershed transform on inputImage, using the labeled markers from markerImage and restricted to the white areas of maskImage.
    ij.ImagePlus applyWithPriorityQueueAndDams()
    Apply watershed transform on inputImage, using the labeled markers from markerImage and restricted to the white areas of maskImage (optionally).
    ij.ImagePlus applyWithSortedList()
    Deprecated.
    The algorithm with a sorted list does not visit the voxels based on their h value and proximity to markers so it is not a true watershed method.
    ij.ImagePlus applyWithSortedListAndDams()
    Deprecated.
    The algorithm with a sorted list does not visit the voxels based on their h value and proximity to markers so it is not a true watershed method.
    java.util.LinkedList<VoxelRecord> extractVoxelValues​(ij.ImageStack inputStack, ij.ImageStack markerStack, int[][][] tabLabels)
    Extract voxel values from input and labeled marker images.
    java.util.PriorityQueue<VoxelRecord> extractVoxelValuesPriorityQueue​(ij.ImageStack inputStack, ij.ImageStack seedStack, int[][][] tabLabels)
    Extract voxel values from input and seed images

    Methods inherited from class inra.ijpb.watershed.WatershedTransform3D

    apply, apply, extractVoxelValues, getConnectivity, setConnectivity, setVerbose

    Methods inherited from class java.lang.Object

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

    • MarkerControlledWatershedTransform3D

      public MarkerControlledWatershedTransform3D​(ij.ImagePlus input, ij.ImagePlus marker, ij.ImagePlus mask)
      Initialize a marker-controlled watershed transform
      Parameters:
      input - grayscale image (usually a gradient image)
      marker - image containing the labeled markers to start the watershed
      mask - binary mask to restrict the region of interest (null to use whole input image)
    • MarkerControlledWatershedTransform3D

      public MarkerControlledWatershedTransform3D​(ij.ImagePlus input, ij.ImagePlus marker, ij.ImagePlus mask, int connectivity)
      Initialize a marker-controlled watershed transform
      Parameters:
      input - grayscale image (usually a gradient image)
      marker - image containing the labeled markers to start the watershed
      mask - binary mask to restrict the region of interest (null to use whole input image)
      connectivity - voxel connectivity (6 or 26)
    • MarkerControlledWatershedTransform3D

      public MarkerControlledWatershedTransform3D​(ij.ImagePlus input, ij.ImagePlus marker, ij.ImagePlus mask, int connectivity, double compactness)
      Initialize a marker-controlled watershed transform
      Parameters:
      input - grayscale image (usually a gradient image)
      marker - image containing the labeled markers to start the watershed
      mask - binary mask to restrict the region of interest (null to use whole input image)
      connectivity - voxel connectivity (6 or 26)
      compactness - compactness constrain parameter (values larger than 0 imply using compact watershed)
  • Method Details

    • applyWithSortedList

      @Deprecated public ij.ImagePlus applyWithSortedList()
      Deprecated.
      The algorithm with a sorted list does not visit the voxels based on their h value and proximity to markers so it is not a true watershed method.
      Apply watershed transform on inputImage, using the labeled markers from markerImage and restricted to the white areas of maskImage. This implementation visits all voxels by ascending gray value.
      Returns:
      watershed domains image (no dams)
    • applyWithSortedListAndDams

      @Deprecated public ij.ImagePlus applyWithSortedListAndDams()
      Deprecated.
      The algorithm with a sorted list does not visit the voxels based on their h value and proximity to markers so it is not a true watershed method.
      Apply watershed transform on inputImage, using the labeled markers from markerImage and restricted to the white areas of maskImage. This implementation visits all voxels by ascending gray value.
      Returns:
      watershed domains image (with dams)
    • applyWithPriorityQueue

      public ij.ImagePlus applyWithPriorityQueue()
      Apply watershed transform on inputImage, using the labeled markers from markerImage and restricted to the white areas of maskImage. This implementation visits first the voxels on the surroundings of the labeled markers.
      Returns:
      watershed domains image (no dams)
    • applyWithPriorityQueueAndDams

      public ij.ImagePlus applyWithPriorityQueueAndDams()
      Apply watershed transform on inputImage, using the labeled markers from markerImage and restricted to the white areas of maskImage (optionally). This implementation uses a priority queue to visit first the voxels on the surroundings of the labeled markers (Meyer's flooding algorithm). Meyer's flooding algorithm: Label the regional minima with different colors Repeat | Select a pixel p, not colored, not watershed, | adjacent to some colored pixels, | and having the lowest possible gray level | If p is adjacent to exactly one color then | label p with this color | If p is adjacent to more than one color then | label p as watershed Until no such pixel exists More information at - Serge Beucher's site: http://cmm.ensmp.fr/~beucher/wtshed.html - G. Bertrand's Topological Watershed site: http://www.esiee.fr/~info/tw/index.html
      Returns:
      watershed domains image (with dams)
    • extractVoxelValuesPriorityQueue

      public java.util.PriorityQueue<VoxelRecord> extractVoxelValuesPriorityQueue​(ij.ImageStack inputStack, ij.ImageStack seedStack, int[][][] tabLabels)
      Extract voxel values from input and seed images
      Parameters:
      inputStack - input stack
      seedStack - seed stack
      tabLabels - output label array
      Returns:
      priority queue of voxels neighboring the seeds
    • extractVoxelValues

      public java.util.LinkedList<VoxelRecord> extractVoxelValues​(ij.ImageStack inputStack, ij.ImageStack markerStack, int[][][] tabLabels)
      Extract voxel values from input and labeled marker images. The input grayscale values will be return in a list of VoxelRecrod and the markers will be stored in tabLabels.
      Parameters:
      inputStack - input grayscale stack (usually a gradient image)
      markerStack - labeled marker stack
      tabLabels - output label array
      Returns:
      list of input voxel values