com.xinapse.multisliceimage
Enum SubSampleType

java.lang.Object
  extended by java.lang.Enum<SubSampleType>
      extended by com.xinapse.multisliceimage.SubSampleType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SubSampleType>

public enum SubSampleType
extends java.lang.Enum<SubSampleType>

An enumeration of the types of sub-sampling to be used for resampling images.


Enum Constant Summary
BY_AVERAGING
          Sub-sampling by averaging across nearest pixels.
LPF
          Sub-sampling by low-pass filtering and sinc interpolation.
NN
          Sub-sampling by selecting the nearest neighbour.
 
Method Summary
static SubSampleType getInstance(java.lang.String s)
          Returns the SubSampleType corresponding to a String representation.
static SubSampleType getPreferredSubSampleType(java.util.prefs.Preferences prefs, SubSampleType defaultType)
          Returns the SubSampleType set in the preferences.
static void savePreferredSubSampleType(java.util.prefs.Preferences prefs, SubSampleType subSampleType)
          Save a SubSampleType to the preferences.
 java.lang.String toString()
          Returns a String describing this sub sampling type.
static SubSampleType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static SubSampleType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NN

public static final SubSampleType NN
Sub-sampling by selecting the nearest neighbour.


BY_AVERAGING

public static final SubSampleType BY_AVERAGING
Sub-sampling by averaging across nearest pixels.


LPF

public static final SubSampleType LPF
Sub-sampling by low-pass filtering and sinc interpolation.

Method Detail

values

public static SubSampleType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SubSampleType c : SubSampleType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SubSampleType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getInstance

public static SubSampleType getInstance(java.lang.String s)
                                 throws com.xinapse.util.InvalidArgumentException
Returns the SubSampleType corresponding to a String representation.

Parameters:
s - a String which has been obtained by a SubSampleType's toString() method. Case is ignored.
Returns:
the SubSampleType corresponding to a String representation.
Throws:
com.xinapse.util.InvalidArgumentException - if the String is invalid.

getPreferredSubSampleType

public static SubSampleType getPreferredSubSampleType(java.util.prefs.Preferences prefs,
                                                      SubSampleType defaultType)
Returns the SubSampleType set in the preferences.

Parameters:
prefs - the Preferences in which to look.
defaultType - the default SubSampleType to return if not set in the Preferences.
Returns:
the SubSampleType set in the preferences, or the default.

savePreferredSubSampleType

public static void savePreferredSubSampleType(java.util.prefs.Preferences prefs,
                                              SubSampleType subSampleType)
Save a SubSampleType to the preferences.

Parameters:
prefs - the Preferences in which to save the type.
subSampleType - the type to save in in the Preferences.

toString

public java.lang.String toString()
Returns a String describing this sub sampling type.

Overrides:
toString in class java.lang.Enum<SubSampleType>
Returns:
a String describing this sub sampling type.


Copyright 2006-2011 Xinapse Systems Limited. All Rights Reserved.