예제 #1
0
  /**
   * Run the function and open the graphical interface
   *
   * @return the ROI data
   */
  public JEXData doit() {
    if (!auto) {
      wrap.start();
    } else {
      finishIT();
    }

    return output;
  }
예제 #2
0
  AdjustImageHelperFunction(
      JEXData imset, JEXEntry entry, TypeName[] outputNames, ParameterSet parameters) {
    // Pass the variables
    this.imset = imset;
    this.params = parameters;
    this.entry = entry;
    this.outputNames = outputNames;

    // //// Get params
    auto = Boolean.parseBoolean(params.getValueOfParameter("Automatic"));
    oldMin = Double.parseDouble(params.getValueOfParameter("Old Min"));
    oldMax = Double.parseDouble(params.getValueOfParameter("Old Max"));
    newMin = Double.parseDouble(params.getValueOfParameter("New Min"));
    newMax = Double.parseDouble(params.getValueOfParameter("New Max"));
    gamma = Double.parseDouble(params.getValueOfParameter("Gamma"));
    depth = Integer.parseInt(params.getValueOfParameter("Output Bit Depth"));

    TreeMap<DimensionMap, JEXDataSingle> map = imset.getDataMap();
    int length = map.size();

    images = new String[length];
    dimensions = new DimensionMap[length];
    int i = 0;
    TreeMap<DimensionMap, String> pathMap = ImageReader.readObjectToImagePathTable(imset);
    for (DimensionMap dim : pathMap.keySet()) {
      String path = pathMap.get(dim);
      dimensions[i] = dim;
      images[i] = path;
      i++;
    }

    // Prepare the graphics
    imagepanel = new ImagePanel(this, "Adjust image");
    displayImage(index);
    wrap = new GraphicalFunctionWrap(this, params);
    wrap.addStep(
        0,
        "Select roi",
        new String[] {"Automatic", "Old Min", "Old Max", "New Min", "New Max", "Output Bit Depth"});
    wrap.setInCentralPanel(imagepanel);
    wrap.setDisplayLoopPanel(true);
  }
예제 #3
0
 public void startIT() {
   wrap.displayUntilStep();
 }