Class ViewTransforms

java.lang.Object
net.imglib2.view.ViewTransforms

public class ViewTransforms extends Object
Utility methods to create transformation for the common operations that are provided in Views.

Warning: The transformations used in Views are always inverse to the operations that are performed by the views.

  • Constructor Details

    • ViewTransforms

      public ViewTransforms()
  • Method Details

    • rotate

      public static Mixed rotate(int numDimensions, int fromAxis, int toAxis)
      Returns the transformation that is used by Views.rotate(RandomAccessible, int, int).

      Warning: The transformations used in Views are always inverse to the operations that are performed by the views.

      The rotation returned by this operation therefore is inverse to the rotation described in Views.rotate(RandomAccessible, int, int)

    • permute

      public static Mixed permute(int numDimensions, int fromAxis, int toAxis)
      Returns the transformation that is used by Views.permute(RandomAccessible, int, int).

      Warning: The transformations used in Views are always inverse to the operations that are performed by the views. But that's not important for this type of permutation. As the permutation stays the same when inverted.

    • hyperSlice

      public static MixedTransform hyperSlice(int numDimensions, int d, long pos)
      Returns the transformation that is used by Views.hyperSlice(RandomAccessible, int, long).

      Warning: The transformations used in Views are always inverse to the operations that are performed by the views.

      Parameters:
      numDimensions - Number of dimensions including that dimension that is sliced / inserted.
      d - Index of that dimension that is sliced / inserted.
      pos - Position of the slice / value of the coordinate that's inserted.
      Returns:
      Transformation that inserts a coordinate at the given index.
    • translate

      public static MixedTransform translate(long... translation)
      Returns the transformation that is used by Views.translate(RandomAccessible, long...).

      Warning: The transformation used by a view in Views is always inverse to the operation that is performed by the View.

      Therefore this method actually returns the inverse translation.

    • translateInverse

      public static MixedTransform translateInverse(long... translation)
      Returns the transformation that is used by Views.translateInverse(RandomAccessible, long...).

      Warning: The transformation used by a view in Views is always inverse to the operation that is performed by the View.

      Therefore this method actually returns the (not inverse) translation.

    • moveAxis

      public static MixedTransform moveAxis(int numDimensions, int fromAxis, int toAxis)
      Returns the transformation that is used by Views.moveAxis(RandomAccessible, int, int).

      Warning: The transformation used by a view in Views is always inverse to the operation that is performed by the View.

      Therefore the axis permutation return by this method is actually inverse as described in Views.moveAxis(RandomAccessible, int, int).

    • zeroMin

      public static MixedTransform zeroMin(Interval interval)
      Returns the transformation that is used by Views.zeroMin(RandomAccessibleInterval).

      Warning: The transformation used by a view in Views is always inverse to the operation that is performed by the View.

    • addDimension

      public static MixedTransform addDimension(int numDimensions)
      Returns the transformation that is used by Views.addDimension(RandomAccessible).

      Warning: The transformation used by a view in Views is always inverse to the operation that is performed by the View.

      Parameters:
      numDimensions - Number of dimensions without the coordinate that's added/removed.
      Returns:
      A transformation that removes the last coordinate.
    • invertAxis

      public static MixedTransform invertAxis(int numDimensions, int d)
      Returns the transformation that is used by Views.invertAxis(RandomAccessible, int).

      Warning: The transformation used by a view in Views is always inverse to the operation that is performed by the View. But that's not relevant here, because inverse of an axis inversion is the axis inversion itself.

      Parameters:
      numDimensions - Number of dimensions of the coordinate space.
      d - Index of the coordinate that's inverted.
      Returns:
      Transformation that inverts the specified coordinate.