Class MultiDimensionalResampling<V>

  • Type Parameters:
    V - the type of the tensor values to resample

    public class MultiDimensionalResampling<V>
    extends java.lang.Object
    Combines several one-dimensional resamplers and creates the fully resampled object from them. The final resampling is created by chaining pairs of dimension+resamplers like:
     
     MultiDimensionalResampling<V> resampling = MultiDimensionalResampling.resample(Coord1.class, coord1Resampler)
                                                                          .then(Coord2.class, coord2Resampler)
                                                                          [...];
     
     
    Note: The order is very relevant here!

    The actual resampled object can finally be created by calling te resample(Tensor) method.

    See Also:
    resample(Class, SingleDimensionResampler), then(Class, SingleDimensionResampler)
    • Method Detail

      • resample

        public static final <C,​V> MultiDimensionalResampling<V> resample​(java.lang.Class<C> dimension,
                                                                               SingleDimensionResampler<C,​V> resampler)
        Starting point for chaining several dimensino-resampler pairs.
        Parameters:
        dimension - the dimension for which the given resampler shall be applied.
        resampler - the resampler to apply for the given dimension
        Returns:
        a new (immutable) multidimensional resampling, with exactly one dimension resampled
        Throws:
        java.lang.NullPointerException - if one of the given arguments is null
      • then

        public final <C> MultiDimensionalResampling<V> then​(java.lang.Class<C> dimension,
                                                            SingleDimensionResampler<C,​V> dimensionComparator)
        Creates a new instance of a multidimensional resamplings, containing the resamplers from this multidimensional resampling plus the given one.
        Parameters:
        dimension - the dimension for which the given resampler shall be used
        dimensionComparator - the resampler which shall be used for the given dimension
        Returns:
        a new multidimensional resampling object, containing all the resamplers of this object plus the given one.
      • resample

        public Tensoric<V> resample​(Tensor<V> original)
        Produces a resampled tensoric object out of the given tensor, by applying the resamplers configured in this object.
        Parameters:
        original - the tensor on which the resampling shall be applied
        Returns:
        a tensoric object, created from the given original tensor with all the resamplers applied