Class SequentializeTransform

  • All Implemented Interfaces:
    InvertibleTransform, Transform

    public class SequentializeTransform
    extends java.lang.Object
    implements InvertibleTransform
    Transform n-dimensional to m-dimensional coordinates (m<n) by flattening dimensions >m. An example of this transformation is the way, a 2D image is flattened out as a 1D array in memory.
    Author:
    Tobias Pietzsch
    • Field Detail

      • numSourceDimensions

        protected final int numSourceDimensions
        dimension of source vector.
      • numTargetDimensions

        protected final int numTargetDimensions
        dimension of target vector.
      • maxSourceDimension

        protected final int maxSourceDimension
      • maxTargetDimension

        protected final int maxTargetDimension
      • seqDimensions

        protected final long[] seqDimensions
    • Constructor Detail

      • SequentializeTransform

        public SequentializeTransform​(long[] sourceDimensions,
                                      int numTargetDimensions)
    • Method Detail

      • numSourceDimensions

        public int numSourceDimensions()
        Description copied from interface: Transform
        Returns n, the dimension of the source vector.
        Specified by:
        numSourceDimensions in interface Transform
        Returns:
        the dimension of the source vector.
      • numTargetDimensions

        public int numTargetDimensions()
        Description copied from interface: Transform
        Returns m, the dimension of the target vector.
        Specified by:
        numTargetDimensions in interface Transform
        Returns:
        the dimension of the target vector.
      • apply

        public void apply​(long[] source,
                          long[] target)
        Description copied from interface: Transform
        Apply the Transform to a source vector to obtain a target vector.
        Specified by:
        apply in interface Transform
        Parameters:
        source - source coordinates.
        target - set this to the target coordinates.
      • apply

        public void apply​(int[] source,
                          int[] target)
        Description copied from interface: Transform
        Apply the Transform to a source vector to obtain a target vector.
        Specified by:
        apply in interface Transform
        Parameters:
        source - source coordinates.
        target - set this to the target coordinates.
      • applyInverse

        public void applyInverse​(long[] source,
                                 long[] target)
        Description copied from interface: InvertibleTransform
        Apply the inverse transform to a target vector to obtain a source vector.
        Specified by:
        applyInverse in interface InvertibleTransform
        Parameters:
        source - set this to the source coordinates.
        target - target coordinates.
      • applyInverse

        public void applyInverse​(int[] source,
                                 int[] target)
        Description copied from interface: InvertibleTransform
        Apply the inverse transform to a target vector to obtain a source vector.
        Specified by:
        applyInverse in interface InvertibleTransform
        Parameters:
        source - set this to the source coordinates.
        target - target coordinates.