Package com.xinapse.image
Enum Class InterpolationType
- All Implemented Interfaces:
Serializable
,Comparable<InterpolationType>
,Constable
An enumeration of the types of interpolation that can be used for resampling images.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionLinear interpolation resampling.Nearest neighbour resampling.Sinc interpolation resampling.Sinc interpolation for in-plane resampling, and linear interpolation for between plane resampling.Spline interpolation. -
Method Summary
Modifier and TypeMethodDescriptionstatic final InterpolationType
Returns theInterpolationType
corresponding to the description supplied in the argument.static InterpolationType
getPreferredInterpolationType
(Preferences prefs, InterpolationType defaultType) Returns theInterpolationType
set in the preferences.static void
savePreferredInterpolationType
(Preferences prefs, InterpolationType interpolationType) Save anInterpolationType
to the preferences.Returns a short String describing this interpolation type.toString()
Returns a String describing this interpolation type.static InterpolationType
Returns the enum constant of this class with the specified name.static InterpolationType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
Linear interpolation resampling. The intensity at a new grid point is found by linear interpolation between the nearest two original grid points. -
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
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
Spline interpolation.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getPreferredInterpolationType
public static InterpolationType getPreferredInterpolationType(Preferences prefs, InterpolationType defaultType) Returns theInterpolationType
set in the preferences.- Parameters:
prefs
- thePreferences
in which to look.defaultType
- the defaultInterpolationType
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 anInterpolationType
to the preferences.- Parameters:
prefs
- thePreferences
in which to save the type.interpolationType
- the type to save in the Preferences.
-
toShortString
Returns a short String describing this interpolation type.- Returns:
- a short String describing this interpolation type.
-
toString
Returns a String describing this interpolation type.- Overrides:
toString
in classEnum<InterpolationType>
- Returns:
- a String describing this interpolation type.
-
getInstance
Returns theInterpolationType
corresponding to the description supplied in the argument.s
can be:- "Nearest neighbour", or "nn" for
NEAREST_NEIGHBOUR
. - "Linear" for
LINEAR
. - "Sinc" for
SINC
. - "Sinc in-plane, linear otherwise" or "sinc-linear" for
SINC_IN_PLANE_LINEAR_OTHERWISE
. - "Spline" for
SPLINE
.
s
is case-insensitive.- Parameters:
s
- aString
which describes theInterpolationType
.- Returns:
- the
InterpolationType
corresponding to the supplied argument. - Throws:
InvalidArgumentException
- if the supplied argument cannot be interpreted as anInterpolationType
.
- "Nearest neighbour", or "nn" for
-