@Override
  public void process(int z, int t, int p) {
    // called for each z,t,p by DatasetIterator.iterateAll();
    System.out.println("MagOrientProcessor.process(" + z + "," + t + "," + p + ")");
    ArrayList<TaggedImage> sampleImgs = new ArrayList<TaggedImage>();
    for (int i = 0; i < numSamples; i++) {
      TaggedImage img = mda.getImageCache().getImage(i + 2, z, t, p);
      if (img == null) {
        System.out.println(
            "**** " + "img==null at submit  i: " + i + "  z: " + z + "  t: " + t + "  p: " + p);
      }
      sampleImgs.add(img);
    }

    // Assuming channels : {mag,ort,0,1,2,3,4}
    //		TaggedImage magImage = in.getImage(0, z, t, p);
    //		TaggedImage ortImage = in.getImage(1, z, t, p);

    // Set Parameters...
    Map<String, Object> parameters = new HashMap<String, Object>();
    parameters.put("Swing", 0.03);
    parameters.put("BkgdCorrected", true);
    parameters.put("summaryMetadata", mda.getImageCache().getSummaryMetadata());
    parameters.put("sampleImages", sampleImgs);
    // proc.setInputParameters(parameters);
    IProcess proc = new ProcessMagOrt(this.parameters, this.data);
    proc.process();
    processResult(proc);
  }
 private DerivedFrom createDerivedFrom(IProcess proc) {
   Transform xform = new Transform(proc.getName(), proc.getInputParameters());
   String antecentPath = mda.getImageCache().getDiskLocation();
   String resultPath = mdg.getImageCache().getDiskLocation();
   String relPath = PathUtils.getRelativePath(antecentPath, resultPath);
   DerivedFrom df =
       DerivedFrom.createDerivedFrom(
           relPath, (List<TaggedImage>) proc.getInputParameters().get("sampleImages"), xform);
   return df;
 }
 public void processResult(IProcess proc) {
   DerivedFrom df = null; // createDerivedFrom(proc);
   TaggedImage magImg = (TaggedImage) proc.getOutputParameters().get("ImgMag");
   TaggedImage ortImg = (TaggedImage) proc.getOutputParameters().get("ImgOrt");
   this.saveToDataset(0, "Mag", magImg, df);
   this.saveToDataset(1, "Ort", ortImg, df);
 }