Enum StackView.StackAccessMode
- java.lang.Object
-
- java.lang.Enum<StackView.StackAccessMode>
-
- net.imglib2.view.StackView.StackAccessMode
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<StackView.StackAccessMode>
public static enum StackView.StackAccessMode extends java.lang.Enum<StackView.StackAccessMode>
Describes how aRandomAccess
on the (n+1)-dimensionalStackView
maps position changes into position changes of the underlying n-dimensionalRandomAccess
es.Each
RandomAccess
on aStackView
keeps a list ofRandomAccess
es on all constituent hyper-slices of theStackView
.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DEFAULT
The default behavior is the following.MOVE_ALL_SLICE_ACCESSES
Alternative behavior for some special cases; this is faster assuming that we access in a loop over dimensions with the last dimension (the hyper-slice dimension) in the inner loop.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StackView.StackAccessMode
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static StackView.StackAccessMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DEFAULT
public static final StackView.StackAccessMode DEFAULT
The default behavior is the following.There is one "active" slice
RandomAccess
, namely the zthRandomAccess
, where z denotes the (n+1)th dimension of the current position.When changing any dimension of the position, except the (n+1)th, this position change is applied to the active slice
RandomAccess
. When changing the (n+1)th dimension of the position, a new sliceRandomAccess
becomes active is set to the position of the previously active sliceRandomAccess
.
-
MOVE_ALL_SLICE_ACCESSES
public static final StackView.StackAccessMode MOVE_ALL_SLICE_ACCESSES
Alternative behavior for some special cases; this is faster assuming that we access in a loop over dimensions with the last dimension (the hyper-slice dimension) in the inner loop. Works as follows.When changing any dimension of the position, except the (n+1)th, this position change is applied to the all slice
RandomAccess
es. The current (n+1)th dimension of the position is maintained as an index. Whenget()
is called it is forwarded to the sliceRandomAccess
at that index.The potential advantage of this approach is that it does not need to do a full
setPosition()
when changing slices. Only use this if you know what you are doing.
-
-
Method Detail
-
values
public static StackView.StackAccessMode[] 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 (StackView.StackAccessMode c : StackView.StackAccessMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static StackView.StackAccessMode 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 namejava.lang.NullPointerException
- if the argument is null
-
-