Package ij.gui

Examples of ij.gui.GenericDialog


            if (options.indexOf("gaussian=") >= 0) {
                oldMacro = true;
                Macro.setOptions(options.replaceAll("gaussian=", "radius="));
            }
        }
        GenericDialog gd = new GenericDialog(command);
        sigma = Math.abs(sigma);
        if (weight<0) weight = 0;
        if (weight>0.99) weight = 0.99;
        gd.addNumericField("Radius (Sigma)", sigma, 1, 6, "pixels");
        gd.addNumericField("Mask Weight (0.1-0.9)", weight,2);
        gd.addPreviewCheckbox(pfr);
        gd.addDialogListener(this);
        gd.showDialog();                        //input by the user (or macro) happens here
        if (gd.wasCanceled()) return DONE;
        if (oldMacro) sigma /= 2.5;
        IJ.register(this.getClass());           //protect static class variables (parameters) from garbage collection
        return IJ.setupDialog(imp, flags);      //ask whether to process all slices of stack (if a stack)
    }
View Full Code Here


    public int showDialog(ImagePlus imp, String command, PlugInFilterRunner pfr) {
    if (filterType == DESPECKLE) {
            filterType = MEDIAN;
            makeKernel(1.0);
    } else {
      GenericDialog gd = new GenericDialog(command+"...");
      gd.addNumericField("Radius", radius, 1, 6, "pixels");
      int digits = imp.getType() == ImagePlus.GRAY32 ? 2 : 0;
      if(filterType == OUTLIERS) {
        gd.addNumericField("Threshold", threshold, digits);
        gd.addChoice("Which Outliers", outlierStrings, outlierStrings[whichOutliers]);
      }
      gd.addPreviewCheckbox(pfr);    //passing pfr makes the filter ready for preview
      gd.addDialogListener(this);    //the DialogItemChanged method will be called on user input
      gd.showDialog();              //display the dialog; preview runs in the  now
      if (gd.wasCanceled()) return DONE;
      IJ.register(this.getClass());   //protect static class variables (filter parameters) from garbage collection
        }
    return IJ.setupDialog(imp, flags)//ask whether to process all slices of stack (if a stack)
    }
View Full Code Here

    // Set default bounds.
    startSlice = 1;
    stopSlice  = imp.getStackSize();

    // Build control dialog.
    GenericDialog gd = buildControlDialog(startSlice,stopSlice);
    gd.showDialog();
    if(gd.wasCanceled()) return;

    if(!imp.lock()) return;   // exit if in use
    long tstart = System.currentTimeMillis();
    setStartSlice((int)gd.getNextNumber());
    setStopSlice((int)gd.getNextNumber());
    method = gd.getNextChoiceIndex();
    if (imp.getType()==ImagePlus.COLOR_RGB) {
      if(method==SUM_METHOD || method==SD_METHOD || method==MEDIAN_METHOD) {
          IJ.error("ZProjection", "Sum, StdDev and Median methods \nnot available with RGB stacks.");
          imp.unlock();
          return;
View Full Code Here

    /** Builds dialog to query users for projection parameters.
  @param start starting slice to display
  @param stop last slice */
    protected GenericDialog buildControlDialog(int start, int stop) {
    GenericDialog gd = new GenericDialog("ZProjection",IJ.getInstance());
    gd.addNumericField("Start slice:",startSlice,0/*digits*/);
    gd.addNumericField("Stop slice:",stopSlice,0/*digits*/);

    // Different kinds of projections.
    gd.addChoice("Projection Type", METHODS, METHODS[method]);

    return gd;
    }
View Full Code Here

                "No image has been selected", "Error",
                JOptionPane.ERROR_MESSAGE);
            return;
          }
          String[] choices = { "Dump to textfile", "Apply to image" };
          GenericDialog gd = new GenericDialog(" Z stamps");
          gd.addChoice("Stamps destination : ", choices,
              "Apply to image");
          gd.showDialog();
          if (gd.wasCanceled()) {
            return;
          }
          String choice = gd.getNextChoice();
          for (int i = 0; i < imageVals.length; i++) {
            Vector v = id.getImageGroupIDs(imageVals[i]);

            for (int j = 0; j < v.size(); j++) {
View Full Code Here

                "No image has been selected", "Error",
                JOptionPane.ERROR_MESSAGE);
            return;
          }
          String[] choices = { "Dump to textfile", "Apply to image" };
          GenericDialog gd = new GenericDialog("Time stamps");
          gd.addChoice("Stamps destination : ", choices,
              "Apply to image");
          gd.showDialog();
          if (gd.wasCanceled()) {
            return;
          }
          String choice = gd.getNextChoice();
          for (int i = 0; i < imageVals.length; i++) {
            Vector v = id.getImageGroupIDs(imageVals[i]);

            for (int j = 0; j < v.size(); j++) {
View Full Code Here

                "No image has been selected", "Error",
                JOptionPane.ERROR_MESSAGE);
            return;
          }
          String[] choices = { "Dump to textfile", "Apply to image" };
          GenericDialog gd = new GenericDialog("Lambdastamps");
          gd.addChoice("Stamps destination : ", choices,
              "Apply to image");
          gd.showDialog();
          if (gd.wasCanceled()) {
            return;
          }
          String choice = gd.getNextChoice();
          for (int i = 0; i < imageVals.length; i++) {
            Vector v = id.getImageGroupIDs(imageVals[i]);

            for (int j = 0; j < v.size(); j++) {
View Full Code Here

   
    public void run(String arg) {
        OpenDialog od = new OpenDialog("Select a file in source folder...", "");
        if (od.getFileName()==null) return;
        String dir1 = od.getDirectory();
        GenericDialog gd = new GenericDialog("LSM Batch Converter", IJ.getInstance());
        gd.addChoice("Convert to: ", choices, format);
        gd.showDialog();
        if (gd.wasCanceled())
            return;
        format = gd.getNextChoice();
        SaveDialog sd = new SaveDialog("Open destination folder...", "dummy name (required)", "");
        if (sd.getFileName()==null) return;
        String dir2 = sd.getDirectory();
        convert(dir1, dir2, format);
    }
View Full Code Here

  public int showDialog(ImagePlus imp, String command, PlugInFilterRunner pfr) {
    if (filterType == DESPECKLE) {
      filterType = MEDIAN;
      radius = 1.0;
    } else {
      GenericDialog gd = new GenericDialog(command+"...");
      radius = lastRadius[filterType]<=0 ? 2 :  lastRadius[filterType];
      gd.addNumericField("Radius", radius, 1, 6, "pixels");
      int digits = imp.getType() == ImagePlus.GRAY32 ? 2 : 0;
      if (filterType==OUTLIERS) {
        gd.addNumericField("Threshold", lastThreshold, digits);
        gd.addChoice("Which outliers", outlierStrings, outlierStrings[lastWhichOutliers]);
        gd.addHelp(IJ.URL+"/docs/menus/process.html#outliers");
      } else if (filterType==REMOVE_NAN)
        gd.addHelp(IJ.URL+"/docs/menus/process.html#nans");
      gd.addPreviewCheckbox(pfr);    //passing pfr makes the filter ready for preview
      gd.addDialogListener(this);    //the DialogItemChanged method will be called on user input
      gd.showDialog();        //display the dialog; preview runs in the  now
      if (gd.wasCanceled()) return DONE;
      IJ.register(this.getClass())//protect static class variables (filter parameters) from garbage collection
      if (Macro.getOptions() == null) { //interactive only: remember parameters entered
          lastRadius[filterType] = radius;
          if (filterType == OUTLIERS) {
              lastThreshold = threshold;
View Full Code Here

            if (options.indexOf("gaussian=") >= 0) {
                oldMacro = true;
                Macro.setOptions(options.replaceAll("gaussian=", "radius="));
            }
        }
        GenericDialog gd = new GenericDialog(command);
        sigma = Math.abs(sigma);
        if (weight<0) weight = 0;
        if (weight>0.99) weight = 0.99;
        gd.addNumericField("Radius (Sigma)", sigma, 1, 6, "pixels");
        gd.addNumericField("Mask Weight (0.1-0.9)", weight,2);
        gd.addPreviewCheckbox(pfr);
        gd.addDialogListener(this);
        gd.showDialog();                        //input by the user (or macro) happens here
        if (gd.wasCanceled()) return DONE;
        if (oldMacro) sigma /= 2.5;
        IJ.register(this.getClass());           //protect static class variables (parameters) from garbage collection
        return IJ.setupDialog(imp, flags);      //ask whether to process all slices of stack (if a stack)
    }
View Full Code Here

TOP

Related Classes of ij.gui.GenericDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.