/** @return the chosen mode, or -1 when canceled. */ final static private int chooseAlignmentMode() { final GenericDialog gdMode = new GenericDialog( "Montage mode" ); gdMode.addChoice( "mode :", modeStrings, modeStrings[ mode ] ); gdMode.showDialog(); if ( gdMode.wasCanceled() ) return -1; final int m = gdMode.getNextChoiceIndex(); // Set the static for future use mode = m; return m; }
private void createSettingsDialog(final String[] titles) { settingsDialog = new GenericDialog("Watershed from markers"); settingsDialog.addChoice("Seeds", titles, titles[0]); settingsDialog.addCheckbox("Show class indices", showIndices); settingsDialog.addCheckbox("Show mean intensities", showIntensities); settingsDialog.addCheckbox("Show results table", showResults); settingsDialog.addHelp("http://imagej.net/3D_Binary_Filters"); }
public void addAlignmentFields( final GenericDialog gd ) { gd.addChoice( "desired_transformation :", modelStrings, modelStrings[ desiredModelIndex ] ); gd.addNumericField( "correspondence weight :", correspondenceWeight, 2 ); gd.addCheckbox( "regularize", regularize ); }
public void showDialog() { Color color = Toolbar.getForegroundColor(); String colorName = Colors.colorToString2(color); String name = isPencil?"Pencil":"Brush"; gd = new NonBlockingGenericDialog(name+" Options"); gd.addSlider(name+" width:", 1, 50, width); //gd.addSlider("Transparency (%):", 0, 100, transparency); gd.addChoice("Color:", Colors.getColors(colorName), colorName); gd.addCheckbox("Paint on overlay", paintOnOverlay); gd.addDialogListener(this); gd.addHelp(getHelp()); Point loc = Prefs.getLocation(LOC_KEY); if (loc!=null) { gd.centerDialog(false); gd.setLocation (loc); } gd.showDialog(); Prefs.saveLocation(LOC_KEY, gd.getLocation()); gd = null; }
/** * Querys a single element from the list * * @param name - type of elements (e.g. "Timepoint") * @param list - list of available elements * @param defaultSelection - default selection * @return the selection or -1 if cancelled */ public static int queryIndividualEntry( final String name, final String[] list, int defaultSelection ) { if ( defaultSelection >= list.length ) defaultSelection = 0; final GenericDialog gd = new GenericDialog( "Select Single " + name ); gd.addChoice( "Processing_" + name, list, list[ defaultSelection ] ); gd.showDialog(); if ( gd.wasCanceled() ) return -1; return gd.getNextChoiceIndex(); }
/** 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"); gd.addNumericField("Start slice:",startSlice,0/*digits*/); gd.addNumericField("Stop slice:",stopSlice,0/*digits*/); gd.addChoice("Projection type", METHODS, METHODS[method]); if (isHyperstack && imp.getNFrames()>1&& imp.getNSlices()>1) gd.addCheckbox("All time frames", allTimeFrames); return gd; }
@Override public void addQuery( final GenericDialog gd ) { if ( presetModel == null ) { gd.addChoice( "Transformation model", TransformationModelGUI.modelChoice, TransformationModelGUI.modelChoice[ defaultModel ] ); gd.addCheckbox( "Regularize_model", defaultRegularize ); } gd.addSlider( "Maximal_distance for correspondence (px)", 0.25, 40.0, IterativeClosestPointParameters.maxDistance ); gd.addNumericField( "Maximal_number of iterations", IterativeClosestPointParameters.maxIterations, 0 ); }
public void showDialog() { Color color = Toolbar.getForegroundColor(); String colorName = Colors.colorToString2(color); String name = isPencil?"Pencil":"Brush"; gd = new NonBlockingGenericDialog(name+" Options"); gd.addSlider(name+" width:", 1, 50, width); //gd.addSlider("Transparency (%):", 0, 100, transparency); gd.addChoice("Color:", Colors.getColors(colorName), colorName); gd.addCheckbox("Paint on overlay", paintOnOverlay); gd.addDialogListener(this); gd.addHelp(getHelp()); Point loc = Prefs.getLocation(LOC_KEY); if (loc!=null) { gd.centerDialog(false); gd.setLocation (loc); } gd.showDialog(); Prefs.saveLocation(LOC_KEY, gd.getLocation()); gd = null; }
/**Dialog to ask which method to be used for Bleach Correction * * @return */ public boolean showDialog() { GenericDialog gd = new GenericDialog("Bleach Correction"); gd.addChoice("Correction Method :", CorrectionMethods , CorrectionMethods[CorrectionMethod]); gd.showDialog(); if (gd.wasCanceled()) return false; BleachCorrection.setCorrectionMethod(gd.getNextChoiceIndex()); return true; }
/** 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"); gd.addNumericField("Start slice:",startSlice,0/*digits*/); gd.addNumericField("Stop slice:",stopSlice,0/*digits*/); gd.addChoice("Projection type", METHODS, METHODS[method]); if (isHyperstack && imp.getNFrames()>1&& imp.getNSlices()>1) gd.addCheckbox("All time frames", allTimeFrames); return gd; }
@Override public void addQuery( final GenericDialog gd ) { if ( presetModel == null ) { gd.addChoice( "Transformation model", TransformationModelGUI.modelChoice, TransformationModelGUI.modelChoice[ defaultModel ] ); gd.addCheckbox( "Regularize_model", defaultRegularize ); } gd.addSlider( "Redundancy for descriptor matching", 0, 10, GeometricHashingParameters.redundancy ); gd.addSlider( "Significance required for a descriptor match", 1.0, 20.0, GeometricHashingParameters.ratioOfDistance ); gd.addMessage( "" ); gd.addMessage( "Parameters for robust model-based outlier removal (RANSAC)", new Font( Font.SANS_SERIF, Font.BOLD, 12 ) ); gd.addMessage( "" ); gd.addSlider( "Allowed_error_for_RANSAC (px)", 0.5, 100.0, RANSACParameters.max_epsilon ); gd.addChoice( "Number_of_RANSAC_iterations", RANSACParameters.ransacChoices, RANSACParameters.ransacChoices[ defaultRANSACIterationChoice ] ); }
int showOptionDialog(int w1, int h1,int w, int h) { String[] options = new String[]{"inserting a cropped image", "inserting a reduced size image", "resizing the destination stack by adding border pixels", "resizing the destination stack by scaling it up"}; GenericDialog gd = new GenericDialog("Options"); gd.addMessage("The image does not fit. Source: "+w1+"x"+h1+" pixels. Dest.: "+w+"x"+h+" pixels."); gd.addChoice("Adjust by", options, options[0]); gd.showDialog(); if (gd.wasCanceled()) return QUIT; return gd.getNextChoiceIndex(); } public void windowClosing(WindowEvent e) {
public void addGeometricConsensusFilterFields( final GenericDialog gd ) { gd.addNumericField( "maximal_alignment_error :", maxEpsilon, 2, 6, "px" ); gd.addNumericField( "minimal_inlier_ratio :", minInlierRatio, 2 ); gd.addNumericField( "minimal_number_of_inliers :", minNumInliers, 0 ); gd.addChoice( "expected_transformation :", modelStrings, modelStrings[ expectedModelIndex ] ); gd.addCheckbox( "ignore constant background", rejectIdentity ); gd.addNumericField( "tolerance :", identityTolerance, 2, 6, "px" ); }
int showDialog(String[] versions) { GenericDialog gd = new GenericDialog("ImageJ Updater 2"); gd.addChoice("Upgrade To:", versions, versions[0]); String msg = "You are currently running v"+ImageJ.VERSION+ImageJ.BUILD+".\n"+ " \n"+ "If you click \"OK\", ImageJ will quit\n"+ "and you will be running the upgraded\n"+ "version after you restart ImageJ.\n"; gd.addMessage(msg); gd.showDialog(); if (gd.wasCanceled()) return -1; else return gd.getNextChoiceIndex(); }
@Override public void addQuery( final GenericDialog gd ) { if ( presetModel == null ) { gd.addChoice( "Transformation model", TransformationModelGUI.modelChoice, TransformationModelGUI.modelChoice[ defaultModel ] ); gd.addCheckbox( "Regularize_model", defaultRegularize ); } gd.addSlider( "Redundancy for descriptor matching", 0, 10, FRGLDMParameters.redundancy ); gd.addSlider( "Significance required for a descriptor match", 1.0, 10.0, FRGLDMParameters.ratioOfDistance ); gd.addMessage( "" ); gd.addMessage( "Parameters for robust model-based outlier removal (RANSAC)", new Font( Font.SANS_SERIF, Font.BOLD, 12 ) ); gd.addMessage( "" ); gd.addSlider( "Allowed_error_for_RANSAC (px)", 0.5, 100.0, RANSACParameters.max_epsilon ); gd.addSlider( "Inlier_factor (minimal amount of inliers)", 1, 20, min_inlier_factor ); gd.addChoice( "RANSAC_iterations", RANSACParameters.ransacChoices, RANSACParameters.ransacChoices[ defaultRANSACIterationChoice ] ); }
int showDialog(String[] versions) { GenericDialog gd = new GenericDialog("ImageJ Updater 2"); gd.addChoice("Upgrade To:", versions, versions[0]); String msg = "You are currently running v"+ImageJ.VERSION+ImageJ.BUILD+".\n"+ " \n"+ "If you click \"OK\", ImageJ will quit\n"+ "and you will be running the upgraded\n"+ "version after you restart ImageJ.\n"; gd.addMessage(msg); gd.showDialog(); if (gd.wasCanceled()) return -1; else return gd.getNextChoiceIndex(); }
@Override public void addQuery( final GenericDialog gd ) { if ( presetModel == null ) { gd.addChoice( "Transformation model", TransformationModelGUI.modelChoice, TransformationModelGUI.modelChoice[ defaultModel ] ); gd.addCheckbox( "Regularize_model", defaultRegularize ); } gd.addSlider( "Number_of_neighbors for the descriptors", 1, 10, RGLDMParameters.numNeighbors ); gd.addSlider( "Redundancy for descriptor matching", 0, 10, RGLDMParameters.redundancy ); gd.addSlider( "Significance required for a descriptor match", 1.0, 10.0, RGLDMParameters.ratioOfDistance ); gd.addMessage( "" ); gd.addMessage( "Parameters for robust model-based outlier removal (RANSAC)", new Font( Font.SANS_SERIF, Font.BOLD, 12 ) ); gd.addMessage( "" ); gd.addSlider( "Allowed_error_for_RANSAC (px)", 0.5, 100.0, RANSACParameters.max_epsilon ); gd.addChoice( "RANSAC_iterations", RANSACParameters.ransacChoices, RANSACParameters.ransacChoices[ defaultRANSACIterationChoice ] ); }
private void reset() { GenericDialog gd = new GenericDialog(""); gd.addChoice("Reset:", choices, choices[choiceIndex]); gd.showDialog(); if (gd.wasCanceled()) return; choiceIndex = gd.getNextChoiceIndex(); switch (choiceIndex) { case 0: unlock(); break; case 1: resetClipboard(); break; case 2: resetUndo(); break; } }
protected void addFields( final GenericDialog gd ) { gd.addMessage( "Block Matching:" ); gd.addNumericField( "layer_scale :", scale, 2 ); gd.addNumericField( "search_radius :", searchRadius, 0, 6, "px" ); gd.addNumericField( "block_radius :", blockRadius, 0, 6, "px" ); gd.addNumericField( "resolution :", meshResolution, 0 ); gd.addMessage( "Correlation Filters:" ); gd.addNumericField( "minimal_PMCC_r :", minR, 2 ); gd.addNumericField( "maximal_curvature_ratio :", maxCurvatureR, 2 ); gd.addNumericField( "maximal_second_best_r/best_r :", rodR, 2 ); gd.addMessage( "Local Smoothness Filter:" ); gd.addCheckbox( "use_local_smoothness_filter", useLocalSmoothnessFilter ); gd.addChoice( "approximate_local_transformation :", modelStrings, modelStrings[ localModelIndex ] ); gd.addNumericField( "local_region_sigma:", localRegionSigma, 2, 6, "px" ); gd.addNumericField( "maximal_local_displacement (absolute):", maxLocalEpsilon, 2, 6, "px" ); gd.addNumericField( "maximal_local_displacement (relative):", maxLocalTrust, 2 ); }
public boolean queryRegularizedModel() { final GenericDialog gd = new GenericDialog( "Regularization Parameters" ); gd.addChoice( "Model_to_regularize_with", regularizationModelChoice, regularizationModelChoice[ defaultRegularizationModelIndex ] ); gd.addNumericField( "Lamba", defaultLambda, 2 ); gd.showDialog(); if ( gd.wasCanceled() ) { this.regularize = false; return false; } this.regularizedModelIndex = defaultRegularizationModelIndex = gd.getNextChoiceIndex(); this.lambda = defaultLambda = gd.getNextNumber(); this.regularize = true; return true; }