/** * Sample only every <em>step</em><sup>th</sup> value of a source * {@link RandomAccessibleInterval}. This is effectively an integer scaling * and zero offset transformation. * * @param source * the source * @param step * the subsampling step size * @return a subsampled {@link RandomAccessibleInterval} with its origin * coordinates at zero */ public static < T > SubsampleIntervalView< T > subsample( final RandomAccessibleInterval< T > source, final long step ) { return new SubsampleIntervalView<>( source, step ); }
/** * Sample only every <em>step</em><sup>th</sup> value of a source * {@link RandomAccessibleInterval}. This is effectively an integer scaling * and zero offset transformation. * * @param source * the source * @param step * the subsampling step size * @return a subsampled {@link RandomAccessibleInterval} with its origin * coordinates at zero */ public static < T > SubsampleIntervalView< T > subsample( final RandomAccessibleInterval< T > source, final long step ) { return new SubsampleIntervalView<>( source, step ); }
/** * Sample only every <em>step<sub>d</sub></em><sup>th</sup> value of a * source {@link RandomAccessibleInterval}. This is effectively an integer * scaling and zero offset transformation. * * @param source * the source * @param steps * the subsampling step sizes * @return a subsampled {@link RandomAccessibleInterval} with its origin * coordinates at zero */ public static < T > SubsampleIntervalView< T > subsample( final RandomAccessibleInterval< T > source, final long... steps ) { assert steps.length >= source.numDimensions(): "Dimensions do not match."; return new SubsampleIntervalView<>( source, steps ); }
/** * Sample only every <em>step<sub>d</sub></em><sup>th</sup> value of a * source {@link RandomAccessibleInterval}. This is effectively an integer * scaling and zero offset transformation. * * @param source * the source * @param steps * the subsampling step sizes * @return a subsampled {@link RandomAccessibleInterval} with its origin * coordinates at zero */ public static < T > SubsampleIntervalView< T > subsample( final RandomAccessibleInterval< T > source, final long... steps ) { assert steps.length >= source.numDimensions(): "Dimensions do not match."; return new SubsampleIntervalView<>( source, steps ); }