Enum Class InterpolationType

java.lang.Object
java.lang.Enum<InterpolationType>
com.xinapse.image.InterpolationType
All Implemented Interfaces:
Serializable, Comparable<InterpolationType>, Constable

public enum InterpolationType extends Enum<InterpolationType>
An enumeration of the types of interpolation that can be used for resampling images.
  • Enum Constant Details

    • NEAREST_NEIGHBOUR

      public static final InterpolationType NEAREST_NEIGHBOUR
      Nearest neighbour resampling. The intensity at a new grid point is the same as the intensity at the nearest original grid point.
    • LINEAR

      public static final InterpolationType LINEAR
      Linear interpolation resampling. The intensity at a new grid point is found by linear interpolation between the nearest two original grid points.
    • SINC

      public static final InterpolationType SINC
      Sinc interpolation resampling. The intensity at a new grid point is found by sinc interpolation with a Blackman-Harris apodisation function.
    • SINC_IN_PLANE_LINEAR_OTHERWISE

      public static final InterpolationType SINC_IN_PLANE_LINEAR_OTHERWISE
      Sinc interpolation for in-plane resampling, and linear interpolation for between plane resampling. Linear interpolation applies for any dimension that is not in-plane.
    • SPLINE

      public static final InterpolationType SPLINE
      Spline interpolation.
  • Method Details

    • values

      public static InterpolationType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static InterpolationType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getPreferredInterpolationType

      public static InterpolationType getPreferredInterpolationType(Preferences prefs, InterpolationType defaultType)
      Returns the InterpolationType set in the preferences.
      Parameters:
      prefs - the Preferences in which to look.
      defaultType - the default InterpolationType to return if not set in the Preferences.
      Returns:
      the InterpolationType set in the preferences, or the default.
    • savePreferredInterpolationType

      public static void savePreferredInterpolationType(Preferences prefs, InterpolationType interpolationType)
      Save an InterpolationType to the preferences.
      Parameters:
      prefs - the Preferences in which to save the type.
      interpolationType - the type to save in the Preferences.
    • toShortString

      public String toShortString()
      Returns a short String describing this interpolation type.
      Returns:
      a short String describing this interpolation type.
    • toString

      public String toString()
      Returns a String describing this interpolation type.
      Overrides:
      toString in class Enum<InterpolationType>
      Returns:
      a String describing this interpolation type.
    • getInstance

      public static final InterpolationType getInstance(String s) throws InvalidArgumentException
      Returns the InterpolationType corresponding to the description supplied in the argument. s can be: Interpretation of s is case-insensitive.
      Parameters:
      s - a String which describes the InterpolationType.
      Returns:
      the InterpolationType corresponding to the supplied argument.
      Throws:
      InvalidArgumentException - if the supplied argument cannot be interpreted as an InterpolationType.