Class LabelValues

java.lang.Object
inra.ijpb.label.LabelValues

public class LabelValues
extends java.lang.Object
Utility methods for combining label images and intensity images.
Author:
David Legland
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static class  LabelValues.Position3DValuePair
    Inner class for storing a value associated to a 3D position.
    static class  LabelValues.PositionValuePair
    Inner class for storing a value associated to a 2D position.
  • Method Summary

    Modifier and Type Method Description
    static LabelValues.Position3DValuePair[] findMaxValues​(ij.ImageStack valueImage, ij.ImageStack labelImage, int[] labels)
    For each label, finds the position of the 3D point belonging to label region defined by the 3D labelImage and with maximal value in intensity 3D image valueImage.
    static LabelValues.PositionValuePair[] findMaxValues​(ij.process.ImageProcessor valueImage, ij.process.ImageProcessor labelImage, int[] labels)
    For each label, finds the position of the point belonging to label region defined by labelImage and with maximal value in intensity image valueImage.
    static LabelValues.Position3DValuePair[] findMinValues​(ij.ImageStack valueImage, ij.ImageStack labelImage, int[] labels)
    For each label, finds the position of the 3D point belonging to 3D label region defined by labelImage and with minimal value in 3D intensity image valueImage.
    static LabelValues.PositionValuePair[] findMinValues​(ij.process.ImageProcessor valueImage, ij.process.ImageProcessor labelImage, int[] labels)
    For each label, finds the position of the point belonging to label region defined by labelImage and with minimal value in intensity image valueImage.
    static Cursor3D[] findPositionOfMaxValues​(ij.ImageStack valueImage, ij.ImageStack labelImage, int[] labels)
    For each label, finds the position of the point belonging to label region defined by labelImage and with maximal value in intensity image valueImage.
    static java.awt.Point[] findPositionOfMaxValues​(ij.process.ImageProcessor valueImage, ij.process.ImageProcessor labelImage, int[] labels)
    For each label, finds the position of the point belonging to label region defined by labelImage and with maximal value in intensity image valueImage.
    static Cursor3D[] findPositionOfMinValues​(ij.ImageStack valueImage, ij.ImageStack labelImage, int[] labels)
    For each label, finds the position of the point belonging to label region defined by labelImage and with minimal value in intensity image valueImage.
    static java.awt.Point[] findPositionOfMinValues​(ij.process.ImageProcessor valueImage, ij.process.ImageProcessor labelImage, int[] labels)
    For each label, finds the position of the point belonging to label region defined by labelImage and with minimal value in intensity image valueImage.
    static double[] maxValues​(ij.ImageStack image, ij.ImageStack labelImage, int[] labels)
    Find maximum value in intensity image for each label.
    static double[] maxValues​(ij.process.ImageProcessor image, ij.process.ImageProcessor labelImage, int[] labels)
    Find maximum value in intensity image for each label.
    static double maxValueWithinLabels​(ij.ImageStack valueImage, ij.ImageStack labelImage)
    Computes the largest value within the valueImage, using the strictly positive values in labelImage as mask.
    static double maxValueWithinLabels​(ij.process.ImageProcessor valueImage, ij.process.ImageProcessor labelImage)
    Computes the largest value within the valueImage, using the strictly positive values in labelImage as mask.

    Methods inherited from class java.lang.Object

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

    • maxValueWithinLabels

      public static final double maxValueWithinLabels​(ij.process.ImageProcessor valueImage, ij.process.ImageProcessor labelImage)
      Computes the largest value within the valueImage, using the strictly positive values in labelImage as mask. Can be used to setup min/max display value after computing a distance transform.
      Parameters:
      valueImage - the image containing values (e.g. a distance map)
      labelImage - the image containing strictly positive values for foreground
      Returns:
      the maximum value within the value image restricted to the label image
    • maxValueWithinLabels

      public static final double maxValueWithinLabels​(ij.ImageStack valueImage, ij.ImageStack labelImage)
      Computes the largest value within the valueImage, using the strictly positive values in labelImage as mask. Can be used to setup min/max display value after computing a distance transform.
      Parameters:
      valueImage - the image containing values (e.g. a distance map)
      labelImage - the image containing strictly positive values for foreground
      Returns:
      the maximum value within the value image restricted to the label image
    • maxValues

      public static final double[] maxValues​(ij.process.ImageProcessor image, ij.process.ImageProcessor labelImage, int[] labels)
      Find maximum value in intensity image for each label.
      Parameters:
      image - the intensity image
      labelImage - the image containing labels
      labels - the list of labels for which the values are computed
      Returns:
      an array of values corresponding to the maximum value within each label
    • maxValues

      public static final double[] maxValues​(ij.ImageStack image, ij.ImageStack labelImage, int[] labels)
      Find maximum value in intensity image for each label.
      Parameters:
      image - the intensity 3D image
      labelImage - the 3D image containing labels
      labels - the list of labels for which the values are computed
      Returns:
      an array of values corresponding to the maximum value within each label
    • findMaxValues

      public static final LabelValues.PositionValuePair[] findMaxValues​(ij.process.ImageProcessor valueImage, ij.process.ImageProcessor labelImage, int[] labels)
      For each label, finds the position of the point belonging to label region defined by labelImage and with maximal value in intensity image valueImage.
      Parameters:
      valueImage - the intensity image containing values to compare
      labelImage - the intensity image containing label of each pixel
      labels - the list of labels in the label image
      Returns:
      the position of maximum value in intensity image for each label
    • findMaxValues

      public static final LabelValues.Position3DValuePair[] findMaxValues​(ij.ImageStack valueImage, ij.ImageStack labelImage, int[] labels)
      For each label, finds the position of the 3D point belonging to label region defined by the 3D labelImage and with maximal value in intensity 3D image valueImage.
      Parameters:
      valueImage - the intensity image containing values to compare
      labelImage - the intensity image containing label of each pixel
      labels - the list of labels in the label image
      Returns:
      the position of maximum value in intensity image for each label
    • findMinValues

      public static final LabelValues.PositionValuePair[] findMinValues​(ij.process.ImageProcessor valueImage, ij.process.ImageProcessor labelImage, int[] labels)
      For each label, finds the position of the point belonging to label region defined by labelImage and with minimal value in intensity image valueImage.
      Parameters:
      valueImage - the intensity image containing values to compare
      labelImage - the intensity image containing label of each pixel
      labels - the list of labels in the label image
      Returns:
      the position of minimum value in intensity image for each label
    • findMinValues

      public static final LabelValues.Position3DValuePair[] findMinValues​(ij.ImageStack valueImage, ij.ImageStack labelImage, int[] labels)
      For each label, finds the position of the 3D point belonging to 3D label region defined by labelImage and with minimal value in 3D intensity image valueImage.
      Parameters:
      valueImage - the intensity image containing values to compare
      labelImage - the intensity image containing label of each pixel
      labels - the list of labels in the label image
      Returns:
      the position of minimum value in intensity image for each label
    • findPositionOfMaxValues

      public static final java.awt.Point[] findPositionOfMaxValues​(ij.process.ImageProcessor valueImage, ij.process.ImageProcessor labelImage, int[] labels)
      For each label, finds the position of the point belonging to label region defined by labelImage and with maximal value in intensity image valueImage.
      Parameters:
      valueImage - the intensity image containing values to compare
      labelImage - the intensity image containing label of each pixel
      labels - the list of labels in the label image
      Returns:
      the position of maximum value in intensity image for each label
    • findPositionOfMaxValues

      public static final Cursor3D[] findPositionOfMaxValues​(ij.ImageStack valueImage, ij.ImageStack labelImage, int[] labels)
      For each label, finds the position of the point belonging to label region defined by labelImage and with maximal value in intensity image valueImage.
      Parameters:
      valueImage - the intensity image containing values to compare
      labelImage - the intensity image containing label of each pixel
      labels - the list of labels in the label image
      Returns:
      the position of maximum value in intensity image for each label
    • findPositionOfMinValues

      public static final java.awt.Point[] findPositionOfMinValues​(ij.process.ImageProcessor valueImage, ij.process.ImageProcessor labelImage, int[] labels)
      For each label, finds the position of the point belonging to label region defined by labelImage and with minimal value in intensity image valueImage.
      Parameters:
      valueImage - the intensity image containing values to compare
      labelImage - the intensity image containing label of each pixel
      labels - the list of labels in the label image
      Returns:
      the position of minimum value in intensity image for each label
    • findPositionOfMinValues

      public static final Cursor3D[] findPositionOfMinValues​(ij.ImageStack valueImage, ij.ImageStack labelImage, int[] labels)
      For each label, finds the position of the point belonging to label region defined by labelImage and with minimal value in intensity image valueImage.
      Parameters:
      valueImage - the intensity image containing values to compare
      labelImage - the intensity image containing label of each pixel
      labels - the list of labels in the label image
      Returns:
      the position of minimum value in intensity image for each label