Esempio n. 1
0
 float[] smooth(float[] a, int n) {
   FloatProcessor fp = new FloatProcessor(n, 1);
   for (int i = 0; i < n; i++) fp.setf(i, 0, a[i]);
   GaussianBlur gb = new GaussianBlur();
   gb.blur1Direction(fp, 2.0, 0.01, true, 0);
   for (int i = 0; i < n; i++) a[i] = fp.getf(i, 0);
   return a;
 }
  protected void copyProjectionViews() throws Exception {
    FloatProcessor currentProjection;
    for (int ip = 0; ip < nImages; ip++) {
      try {
        Grid2D projection = inputQueue.get(ip);
        currentProjection =
            new FloatProcessor(
                projection.getWidth(), projection.getHeight(), projection.getBuffer(), null);

        for (int iu = 0; iu <= maxU; iu++) {
          for (int iv = 0; iv <= maxV; iv++) {
            // there may be a problem
            projectionViews.setAtIndex(ip, iu, iv, currentProjection.getf(iu, iv));
          }
        }
      } catch (Exception e) {
        System.out.println("An error occured during copying projection views " + ip);
      }
    }
  }