Ejemplo n.º 1
0
 @Override
 public void run() {
   double[] sigmas = sigmas();
   @SuppressWarnings("unchecked")
   Img<T> target = (Img<T>) dataset.getImgPlus();
   Img<T> input = target.copy();
   ExtendedRandomAccessibleInterval<T, ?> paddedInput = Views.extendMirrorSingle(input);
   try {
     Gauss3.gauss(sigmas, paddedInput, target);
   } catch (Exception e) {
     cancel(e.getMessage());
   }
 }
Ejemplo n.º 2
0
  private boolean processSlice(
      final RandomAccessibleInterval<FloatType> src,
      final RandomAccessibleInterval<FloatType> dx,
      final RandomAccessibleInterval<FloatType> dy) {
    // Gaussian filter.
    final ExtendedRandomAccessibleInterval<FloatType, RandomAccessibleInterval<FloatType>>
        extended = Views.extendMirrorSingle(src);
    try {
      Gauss3.gauss(new double[] {sigma, sigma}, extended, src, numThreads);
    } catch (final IncompatibleTypeException e) {
      errorMessage = BASE_ERROR_MSG + "Incompatible types: " + e.getMessage();
      e.printStackTrace();
      return false;
    }

    // Derivatives
    PartialDerivative.gradientCentralDifference(extended, dx, 0);
    PartialDerivative.gradientCentralDifference(extended, dy, 1);

    return true;
  }