@Override
 public Img<BitType> createOutput(final I input) {
   final BitType type = new BitType();
   try {
     return input.factory().imgFactory(type).create(input, type);
   } catch (final IncompatibleTypeException exc) {
     throw new IllegalArgumentException(exc);
   }
 }
示例#2
0
  /**
   * create the output based on the input. If fast=true the size is determined such that the
   * underlying FFT implementation will run as fast as possible. If fast=false the size is
   * determined such that the underlying FFT implementation will use the smallest amount of memory
   * possible.
   */
  @Override
  public O createOutput(I input) {

    long[] inputSize = new long[input.numDimensions()];

    for (int d = 0; d < input.numDimensions(); d++) {
      inputSize[d] = input.dimension(d);

      if (borderSize != null) {
        inputSize[d] += borderSize[d];
      }
    }

    if (fast) {
      computeFFTFastSize(inputSize);
    } else {
      computeFFTSmallSize(inputSize);
    }

    return createFFTImg(input.factory());
  }