Ejemplo n.º 1
0
  /** Execute algorithm */
  public void evaluate(Flow flow, FlowExec exec) throws Exception {
    Map<String, Object> lastOutput = exec.getLastOutputCleared(this);
    AnyEvImage a = (AnyEvImage) flow.getInputValue(this, exec, "image");

    AnyEvImage out = new EvOpThresholdOtsu2D().exec1Untyped(exec.ph, a);
    lastOutput.put("out", out);
  }
  /** Execute algorithm */
  public void evaluate(Flow flow, FlowExec exec) throws Exception {
    Map<String, Object> lastOutput = exec.getLastOutputCleared(this);

    AnyEvImage a = (AnyEvImage) flow.getInputValue(this, exec, "image");
    MorphKernel kernel = (MorphKernel) flow.getInputValue(this, exec, "kernel");

    lastOutput.put("out", new EvOpMorphGradientWhole2D(kernel).exec1Untyped(a));
  }
  /** Execute algorithm */
  public void evaluate(Flow flow, FlowExec exec) throws Exception {
    Map<String, Object> lastOutput = exec.getLastOutputCleared(this);
    AnyEvImage inReal = (AnyEvImage) flow.getInputValue(this, exec, "inReal");
    Maybe<AnyEvImage> inImag = flow.getInputValueMaybe(this, exec, "inImag", AnyEvImage.class);
    //		Object inImag=flow.getInputValue(this, exec, "inImag");

    //	checkNotNull(inReal);

    if (!inImag.hasValue()) {
      AnyEvImage[] outs = new EvOpFourierRealInverseFull3D(true).execUntyped(inReal);
      lastOutput.put("outReal", outs[0]);
      lastOutput.put("outImag", outs[1]); // Could use half-inverse and generate special image?
    } else {
      AnyEvImage[] outs = new EvOpFourierComplexInverse3D(true).execUntyped(inReal, inImag.get());
      lastOutput.put("outReal", outs[0]);
      lastOutput.put("outImag", outs[1]);
    }
  }
  /** Execute algorithm */
  public void evaluate(Flow flow, FlowExec exec) throws Exception {
    Map<String, Object> lastOutput = exec.getLastOutputCleared(this);

    // Object a=flow.getInputValue(this, exec, "image");
    AnyEvImage in = (AnyEvImage) flow.getInputValue(this, exec, "image");

    if (in instanceof EvPixels) {
      EvStack stack = new EvStack();
      stack.setTrivialResolution();
      stack.putInt(0, new EvImage((EvPixels) in));
      EvChannel chan = new EvChannel();
      chan.imageLoader.put(new EvDecimal(0), stack);
      lastOutput.put("out", chan);
    } else if (in instanceof EvStack) {
      EvChannel chan = new EvChannel();
      chan.imageLoader.put(new EvDecimal(0), (EvStack) in);
      lastOutput.put("out", chan);
    } else if (in instanceof EvChannel) lastOutput.put("out", in);
  }