本文整理匯總了Java中ij.gui.GenericDialog類的典型用法代碼示例。如果您正苦於以下問題:Java GenericDialog類的具體用法?Java GenericDialog怎麽用?Java GenericDialog使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
GenericDialog類屬於ij.gui包,在下文中一共展示了GenericDialog類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: xDialog2STICS
import ij.gui.GenericDialog; //導入依賴的package包/類
/**
* Dialog displaying options of 2D correlation
* **/
public boolean xDialog2STICS()
{
GenericDialog x2DDial = new GenericDialog("Spatio-temporal image correlation 2D");
String [] itemsC = new String [] {
"Direct cross-correlation (slow)","FFT cross-correlation (fast)"};
x2DDial.addNumericField("Max delay (zero=half of stack)", Prefs.get("Correlescence.2DSTICSMaxDelay", 0), 0, 4, " frames");
x2DDial.addChoice("Calculation method:", itemsC, Prefs.get("Correlescence.2Dcorrmethod", "FFT cross-correlation (fast)"));
x2DDial.setResizable(false);
x2DDial.showDialog();
if (x2DDial.wasCanceled())
return false;
nMaxUserDelay = (int)x2DDial.getNextNumber();
Prefs.set("Correlescence.2DSTICSMaxDelay", nMaxUserDelay);
nCalcMethod = x2DDial.getNextChoiceIndex();
Prefs.set("Correlescence.2Dcorrmethod", itemsC[nCalcMethod]);
return true;
}
示例2: selectOpenImage
import ij.gui.GenericDialog; //導入依賴的package包/類
/**
* Opens a dialog to let the user select one of the currently open images.
* @param title string to show in the dialog
* @return An ImagePlus object, use the getProcessor method to obtain the associated ImageProcessor
*/
public static ImagePlus selectOpenImage(String title) {
ImagePlus[] openImages = getOpenImages(true, null);
String[] imageNames = getImageShortTitles(openImages);
if (title == null) {
title = "image:";
}
GenericDialog gd = new GenericDialog("Select image");
gd.addChoice(title, imageNames, imageNames[0]);
gd.showDialog();
if (gd.wasCanceled())
return null;
else {
return openImages[gd.getNextChoiceIndex()];
}
}
示例3: showDialog
import ij.gui.GenericDialog; //導入依賴的package包/類
/**
* Show dialog.
*
* @return the parameter
*/
public Parameter showDialog(){
gd = new GenericDialog("Add Parameter");
gd.setResizable(true);
gd.pack();
gd.addStringField("id:", "");
gd.addNumericField("value:", 0, 1);
gd.addChoice("units:", units, null);
gd.addRadioButtonGroup("constant:", bool, 1,2,"true");
gd.showDialog();
if(gd.wasCanceled())
return null;
parameter = model.createParameter();
setParameterData();
return parameter;
}
示例4: showDialog
import ij.gui.GenericDialog; //導入依賴的package包/類
/**
* Show dialog.
*
* @return the parameter
*/
public Parameter showDialog(){
gd = new GenericDialog("Add Advection Coefficient");
gd.setResizable(true);
gd.pack();
gd.addStringField("id:", "");
gd.addNumericField("value:", 0, 1);
gd.addRadioButtonGroup("constant:", bool, 1, 2, "true");
gd.addChoice("species:", SBMLProcessUtil.listIdToStringArray(model.getListOfSpecies()), null);
gd.addChoice("coordinate:", SBMLProcessUtil.lcoord, null);
gd.showDialog();
if(gd.wasCanceled())
return null;
parameter = model.createParameter();
setParameterData();
return parameter;
}
示例5: showDialog
import ij.gui.GenericDialog; //導入依賴的package包/類
/**
* Show dialog.
*
* @return the species
* @throws IllegalArgumentException the illegal argument exception
* @throws IdentifierException the identifier exception
*/
public Species showDialog()throws IllegalArgumentException, IdentifierException{
gd = new GenericDialog("Add Species");
gd.setResizable(true);
gd.pack();
gd.addStringField("id:", "");
gd.addRadioButtonGroup("initial:", initial, 1, 2, "amount");
gd.addNumericField("quantity:", 0, 1);
gd.addChoice("compartment:", SBMLProcessUtil.listIdToStringArray(model.getListOfCompartments()), null);
gd.addChoice("substanceUnit:", units, null);
gd.addRadioButtonGroup("boundaryCondition:",bool,1,2,"false");
gd.addRadioButtonGroup("constant:",bool,1,2,"false");
gd.showDialog();
if(gd.wasCanceled())
return null;
species = model.createSpecies();
setSpeciesData();
return species;
}
示例6: showDialog
import ij.gui.GenericDialog; //導入依賴的package包/類
/**
* Show dialog.
*
* @return the parameter
* @throws IllegalArgumentException the illegal argument exception
*/
public Parameter showDialog() throws IllegalArgumentException{
gd = new GenericDialog("Add Boundary Condition");
gd.setResizable(true);
gd.pack();
gd.addStringField("id:", "");
gd.addNumericField("value:", 0, 1);
gd.addRadioButtonGroup("constant:", bool, 1, 2, "true");
gd.addChoice("species:", SBMLProcessUtil.listIdToStringArray(model.getListOfSpecies()), null);
gd.addChoice("type:", SBMLProcessUtil.boundType, null);
gd.addChoice("boundary:", getAllBoundAsString(), null);
gd.showDialog();
if(gd.wasCanceled())
return null;
parameter = model.createParameter();
setParameterData();
return parameter;
}
示例7: showDialog
import ij.gui.GenericDialog; //導入依賴的package包/類
/**
* Show dialog.
*
* @return the parameter
*/
public Parameter showDialog(){
gd = new GenericDialog("Add Diffusion Coeffcient");
gd.setResizable(true);
gd.pack();
gd.addStringField("id:", "");
gd.addNumericField("value:", 0, 1);
gd.addRadioButtonGroup("constant:", bool, 1,2,"true");
gd.addChoice("species:", SBMLProcessUtil.listIdToStringArray(model.getListOfSpecies()), null);
gd.addChoice("type:", SBMLProcessUtil.diffType, null);
gd.addChoice("coordinate1:", SBMLProcessUtil.lcoord, null);
gd.addChoice("coordinate2:", SBMLProcessUtil.lcoord, null);
gd.showDialog();
if(gd.wasCanceled())
return null;
parameter = model.createParameter();
setParameterData();
return parameter;
}
示例8: dialogItemChanged
import ij.gui.GenericDialog; //導入依賴的package包/類
public boolean dialogItemChanged (GenericDialog gd, AWTEvent e) {
iterations = (int)gd.getNextNumber();
count = (int)gd.getNextNumber();
boolean bb = Prefs.blackBackground;
Prefs.blackBackground = gd.getNextBoolean();
if ( Prefs.blackBackground!=bb)
ThresholdAdjuster.update();
Prefs.padEdges = gd.getNextBoolean();
EDM.setOutputType(gd.getNextChoiceIndex());
boolean isInvalid = gd.invalidNumber();
if (iterations<1) {iterations = 1; isInvalid = true;}
if (iterations>MAX_ITERATIONS) {iterations = MAX_ITERATIONS; isInvalid = true;}
if (count < 1) {count = 1; isInvalid = true;}
if (count > 8) {count = 8; isInvalid = true;}
if (isInvalid) return false;
if (imp != null) {
operation = gd.getNextChoice();
arg = operation.toLowerCase();
}
return true;
}
示例9: run
import ij.gui.GenericDialog; //導入依賴的package包/類
/**
* Main processing method for the Hysteresis_ object
*
* @param ip Description of the Parameter
*/
public void run(ImageProcessor ip) {
GenericDialog gd = new GenericDialog("Parameters");
gd.addNumericField("High threshold", 100, 2);
gd.addNumericField("Low threshold", 50, 2);
gd.showDialog();
float T1 = (float) gd.getNextNumber();
float T2 = (float) gd.getNextNumber();
ImageStack stack = imp.getStack();
ImageStack res_trin = new ImageStack(stack.getWidth(), stack.getHeight());
ImageStack res_hyst = new ImageStack(stack.getWidth(), stack.getHeight());
ImageProcessor tmp1;
ImageProcessor tmp2;
for (int s = 1; s <= stack.getSize(); s++) {
tmp1 = trin(stack.getProcessor(s), T1, T2);
tmp2 = hyst(tmp1);
res_trin.addSlice("", tmp1);
res_hyst.addSlice("", tmp2);
}
new ImagePlus("Trinarisation", res_trin).show();
new ImagePlus("Hysteresis", res_hyst).show();
}
示例10: createSetupDialog
import ij.gui.GenericDialog; //導入依賴的package包/類
private void createSetupDialog() {
setupDialog = new GenericDialog("Plugin options");
setupDialog.addCheckbox("Thickness", doThickness);
setupDialog.addCheckbox("Spacing", doSpacing);
setupDialog.addCheckbox("Graphic Result", doGraphic);
setupDialog.addCheckbox("Crop using ROI manager", doRoi);
if (roiManager == null) {
// Disable option if there's no ROI manager
Checkbox cropCheckbox = (Checkbox) setupDialog.getCheckboxes().elementAt(3);
cropCheckbox.setState(false);
cropCheckbox.setEnabled(false);
}
setupDialog.addCheckbox("Mask thickness map", doMask);
setupDialog.addHelp(HELP_URL);
}
示例11: dialogItemChanged
import ij.gui.GenericDialog; //導入依賴的package包/類
@Override
public boolean dialogItemChanged(final GenericDialog gd, final AWTEvent e) {
if (!DialogModifier.allNumbersValid(gd.getNumericFields()))
return false;
final Vector<?> checkboxes = gd.getCheckboxes();
final Vector<?> numbers = gd.getNumericFields();
final Checkbox box = (Checkbox) checkboxes.get(0);
final TextField num = (TextField) numbers.get(0);
if (box.getState()) {
num.setEnabled(true);
} else {
num.setEnabled(false);
}
DialogModifier.registerMacroValues(gd, gd.getComponents());
return true;
}
示例12: dialogItemChanged
import ij.gui.GenericDialog; //導入依賴的package包/類
@Override
public boolean dialogItemChanged(final GenericDialog gd, final AWTEvent e) {
if (!DialogModifier.allNumbersValid(gd.getNumericFields()))
return false;
final Vector<?> choices = gd.getChoices();
final Vector<?> numbers = gd.getNumericFields();
final Choice choice = (Choice) choices.get(0);
final TextField num = (TextField) numbers.get(0);
if (choice.getSelectedItem().contentEquals("Multithreaded")) {
num.setEnabled(true);
} else {
num.setEnabled(false);
}
DialogModifier.registerMacroValues(gd, gd.getComponents());
return true;
}
示例13: addSurfParamsToDialog
import ij.gui.GenericDialog; //導入依賴的package包/類
/** Adds SURF parameter to the ImageJ <code>GenericDialog</code>.
* <p>The order and types of fields do affect the method {@link Params#getSurfParamsFromDialog(GenericDialog)}.
* Bounds description depends on bounds check in constructor {@link Params#Params(int, int, float, int, boolean, boolean, int)}. */
public static void addSurfParamsToDialog(GenericDialog gd) {
Params p = new Params();
gd.addMessage("=================== DETECTOR ===================");
gd.addNumericField( "Octaves (3..4) :", p.getOctaves(), 0 );
gd.addNumericField( "Layers per Octave (3..4) :", p.getLayers(), 0 );
gd.addNumericField( "Hessian Threshold (0..1) :", p.getThreshold(), 5 );
gd.addNumericField( "Initial Sampling Step (1..6) :", p.getInitStep(), 0 );
gd.addMessage("================== DESCRIPTOR ==================");
gd.addCheckbox("Upright SURF (slightly faster, but not rotation invariant)", p.isUpright());
gd.addMessage("=============== DISPLAYING RESULTS ==============");
//TODO: add Matcher params: best/secondBest value, boolean reverseCheck, float tolerance for comparison with homography
// threshold for distance-between-matching-points (outlier/Ausreier)
gd.addCheckbox("Orientation Vectors (Length shows the strength of I.P.) ", p.isDisplayOrientationVectors());
gd.addCheckbox("Descriptor Windows", p.isDisplayDescriptorWindows());
gd.addNumericField( "Line Width (1..5) :", p.getLineWidth(), 0 );
gd.addCheckbox("Statistics", p.isDisplayStatistics());
}
示例14: getParametersFromGD
import ij.gui.GenericDialog; //導入依賴的package包/類
public static LucasKanadeParameters getParametersFromGD(final GenericDialog gd, boolean askForModelType)
{
if (gd.wasCanceled())
return null;
final int nIterations = (int) gd.getNextNumber();
final double minParameterChance = gd.getNextNumber();
final WarpFunctionType modelType;
if (askForModelType)
{
final int modelIdx = gd.getNextChoiceIndex();
modelType = WarpFunctionType.values()[modelIdx];
}
else
modelType = defaultModelType;
return new LucasKanadeParameters(modelType, nIterations, minParameterChance);
}
示例15: askUserForParameters
import ij.gui.GenericDialog; //導入依賴的package包/類
public static GlobalOptimizationParameters askUserForParameters()
{
// ask user for parameters
final GenericDialog gd = new GenericDialog("Global optimization options");
gd.addChoice( "Global_optimization_strategy", methodDescriptions, methodDescriptions[ defaultGlobalOpt ] );
gd.addNumericField( "relative error threshold", 2.5, 3 );
gd.addNumericField( "absolute error threshold", 3.5, 3 );
gd.showDialog();
if (gd.wasCanceled())
return null;
final double relTh = gd.getNextNumber();
final double absTh = gd.getNextNumber();
final int methodIdx = defaultGlobalOpt = gd.getNextChoiceIndex();
final GlobalOptType method;
if (methodIdx == 0)
method = GlobalOptType.SIMPLE;
else if (methodIdx == 1)
method = GlobalOptType.ITERATIVE;
else
method = GlobalOptType.TWO_ROUND;
return new GlobalOptimizationParameters(relTh, absTh, method);
}