Enum Class OrientationChange

Object
Enum<OrientationChange>
OrientationChange
All Implemented Interfaces:
Serializable, Comparable<OrientationChange>, Constable

public enum OrientationChange extends Enum<OrientationChange>
Changes orientation of an image in the XY plane.

The corrections refer to what rotation should be applied to the natural XY byte ordering in an image file, to present in the orientation expected in the eventual image.

It is also possible for a mirroring to occur (X coordinates flipped in direction, but not in the Y dimension) for each respective orientation change.

Author:
Owen Feehan
  • Enum Constant Details

    • KEEP_UNCHANGED

      public static final OrientationChange KEEP_UNCHANGED
      No change in orientation.
    • MIRROR_WITHOUT_ROTATION

      public static final OrientationChange MIRROR_WITHOUT_ROTATION
      No change in orientation, but mirroring across the X dimension.
    • ROTATE_90_ANTICLOCKWISE

      public static final OrientationChange ROTATE_90_ANTICLOCKWISE
      Pixels should appear 90 degrees rotated in the anti-clockwise direction.
    • ROTATE_90_ANTICLOCKWISE_MIRROR

      public static final OrientationChange ROTATE_90_ANTICLOCKWISE_MIRROR
      Pixels should appear 90 degrees rotated in the anticlockwise direction, and then mirrored across the X-dimension.
    • ROTATE_180

      public static final OrientationChange ROTATE_180
      Pixels should appear 180 degrees rotated in the clockwise direction.
    • ROTATE_180_MIRROR

      public static final OrientationChange ROTATE_180_MIRROR
      Pixels should appear 180 degrees rotated in the clockwise direction, and then mirrored across the X-dimension.
    • ROTATE_90_CLOCKWISE

      public static final OrientationChange ROTATE_90_CLOCKWISE
      Pixels should appear 90 degrees rotated in the clockwise direction.

      This is equivalent to rotating 270 degrees anti-clockwise.

    • ROTATE_90_CLOCKWISE_MIRROR

      public static final OrientationChange ROTATE_90_CLOCKWISE_MIRROR
      Pixels should appear 90 degrees rotated clockwise, and then mirrored across the X-dimension.
  • Method Details

    • values

      public static OrientationChange[] 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 OrientationChange 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
    • index

      public abstract int index(int x, int y, Extent extent)
      Determines the index in a output-array to put an element after applying the orientation-change.
      Parameters:
      x - intended output voxel position on the x-axis, before any orientation-change.
      y - intended output voxel position on the y-axis, before any orientation-change.
      extent - image-size, before any orientation-change.
      Returns:
      the changed index.
    • index

      public abstract int index(int existingIndex, int x, int y, Extent extent)
      Like {#link determineOutputIndex(int,int,Extent)} but also accepts an index.
      Parameters:
      existingIndex - an index that is already correct, if no orientation-change is applied.
      x - intended output voxel position on the x-axis, before any orientation-change.
      y - intended output voxel position on the y-axis, before any orientation-change.
      extent - image-size, before any orientation-change.
      Returns:
      the changed index.
    • extent

      public abstract Extent extent(Extent extent)
      A Extent that describes extent after the orientation change.
      Parameters:
      extent - the unchanged size.
      Returns:
      either a newly created Extent if it is changed, or else extent if no change is needed.
    • resolution

      public abstract Resolution resolution(Resolution resolution)
      A Resolution that describes resolution after the orientation change.
      Parameters:
      resolution - the unchanged resolution.
      Returns:
      either a newly created Resolution if it is changed, or else resolution if no change is needed.
    • dimensions

      public Dimensions dimensions(Dimensions dimensions)
      A Dimensions that describes {code dimensions} after the orientation change.
      Parameters:
      dimensions - the unchanged dimensions.
      Returns:
      either a newly created Dimensions if it is changed, or else dimensions if no change is needed.