Class ValueSelection

java.lang.Object
com.eco.bio7.spatial.ValueSelection

public final class ValueSelection extends Object
The values of a stack which are displayed as a volume or an iso surface: all values (the default), a range of values (e.g., the threshold of the image in ImageJ: only the particles) or a list of values (the labels of a segmentation).

The iso surface of a range is the surface of the values at both limits (interpolated like the iso surface of a value), the iso surface of a list of labels is the surface of the voxels with one of the labels (the border between a selected and another voxel, half way between the centers of the voxels).

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final ValueSelection
    All values (no selection).
    static final ValueSelection
    The threshold of the image in ImageJ (the lower and the upper limit), read when the stack is loaded (see resolve).
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(double value)
    Returns true if the value is selected.
    boolean
     
    int
     
    boolean
    Returns true if all values are selected (no selection).
    boolean
    Returns true for the threshold of the image (resolved when a stack is loaded).
    boolean
    Returns true for a list of labels.
    boolean
    Returns true for a range of values.
    labels(double... labels)
    The labels of a segmentation (each value is an object or a class).
    labels(String list)
    The labels of a segmentation as a text: values and ranges separated by commas or spaces, e.g., "1, 5, 10-20" (a range includes both limits).
    range(double lower, double upper)
    The values from lower to upper (inclusive), e.g., a threshold.
    resolve(ij.ImagePlus imp)
    Returns the selection for a stack: the threshold of the image for IMAGE_THRESHOLD (ALL if no threshold is set or for RGB images), else this selection.
    Returns a description, e.g., "Threshold 50 - 255" or "Labels 1, 5, 10-20".

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • ALL

      public static final ValueSelection ALL
      All values (no selection).
    • IMAGE_THRESHOLD

      public static final ValueSelection IMAGE_THRESHOLD
      The threshold of the image in ImageJ (the lower and the upper limit), read when the stack is loaded (see resolve).
  • Method Details

    • range

      public static ValueSelection range(double lower, double upper)
      The values from lower to upper (inclusive), e.g., a threshold. The surface is interpolated at both limits.
      Parameters:
      lower - the lower limit (-Infinity: no lower limit)
      upper - the upper limit (Infinity: no upper limit)
    • labels

      public static ValueSelection labels(double... labels)
      The labels of a segmentation (each value is an object or a class).
      Parameters:
      labels - the selected values
    • labels

      public static ValueSelection labels(String list)
      The labels of a segmentation as a text: values and ranges separated by commas or spaces, e.g., "1, 5, 10-20" (a range includes both limits).
      Parameters:
      list - the labels
      Throws:
      IllegalArgumentException - if the text is not a list of labels
    • resolve

      public ValueSelection resolve(ij.ImagePlus imp)
      Returns the selection for a stack: the threshold of the image for IMAGE_THRESHOLD (ALL if no threshold is set or for RGB images), else this selection.
    • isAll

      public boolean isAll()
      Returns true if all values are selected (no selection).
    • isImageThreshold

      public boolean isImageThreshold()
      Returns true for the threshold of the image (resolved when a stack is loaded).
    • isRange

      public boolean isRange()
      Returns true for a range of values.
    • isLabels

      public boolean isLabels()
      Returns true for a list of labels.
    • contains

      public boolean contains(double value)
      Returns true if the value is selected.
    • toString

      public String toString()
      Returns a description, e.g., "Threshold 50 - 255" or "Labels 1, 5, 10-20".
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object