/** Adds a group of checkboxs using a grid layout. * @param rows the number of rows * @param columns the number of columns * @param labels the labels * @param defaultValues the initial states */ public void addCheckboxGroup(int rows, int columns, String[] labels, boolean[] defaultValues) { addCheckboxGroup(rows, columns, labels, defaultValues, null); }
/** Adds a group of checkboxs using a grid layout. * @param rows the number of rows * @param columns the number of columns * @param labels the labels * @param defaultValues the initial states */ public void addCheckboxGroup(int rows, int columns, String[] labels, boolean[] defaultValues) { addCheckboxGroup(rows, columns, labels, defaultValues, null); }
private boolean GUI() { GenericDialog gd = new GenericDialog("Lipschitz filter v"+Lipschitz_Version); gd.addNumericField("Slope", m_Slope, 2); String[] labels = {"TopDown", "TopHat"}; boolean[] values = {m_Down, m_TopHat}; gd.addCheckboxGroup(1, 2, labels, values); gd.addMessage("Incorrect values will be replaced by defaults.\nLabels are drawn in the foreground color.\nPress Esc to stop processing."); return getUserParams(gd); }// end of 'GUI' method
private boolean GUI() { GenericDialog gd = new GenericDialog("Lipschitz filter v"+Lipschitz_Version); gd.addNumericField("Slope", m_Slope, 2); String[] labels = {"TopDown", "TopHat"}; boolean[] values = {m_Down, m_TopHat}; gd.addCheckboxGroup(1, 2, labels, values); gd.addMessage("Incorrect values will be replaced by defaults.\nLabels are drawn in the foreground color.\nPress Esc to stop processing."); return getUserParams(gd); }// end of 'GUI' method
/** Shows a dialog to pick which classes is one interested in. */ static public final void extractAndShowGraph(final LayerSet ls) { GenericDialog gd = new GenericDialog("Graph elements"); Class<Displayable>[] c = new Class[]{AreaList.class, AreaTree.class, Ball.class, Connector.class, Patch.class, Pipe.class, Polyline.class, Profile.class, DLabel.class, Treeline.class}; String[] types = new String[]{"AreaList", "AreaTree", "Ball", "Connector", "Image", "Pipe", "Polyline", "Profile", "Text", "Treeline"}; boolean[] states = new boolean[]{true, true, false, false, false, false, true, true, false, true}; assert(c.length == types.length && types.length == states.length); for (int i=0; i<c.length; i++) { if (ZDisplayable.class.isAssignableFrom(c[i])) { if (!ls.contains(c[i])) states[i] = false; } else if (!ls.containsDisplayable(c[i])) states[i] = false; } gd.addCheckboxGroup(types.length, 1, types, states, new String[]{"Include only:"}); gd.showDialog(); if (gd.wasCanceled()) return; HashSet<Class<Displayable>> only = new HashSet<Class<Displayable>>(); for (int i=0; i<types.length; i++) { if (gd.getNextBoolean()) only.add(c[i]); } Graph.extractAndShowGraph(ls, only); } }
void addCheckboxGroup(GenericDialog gd) { int rows = (int)getFirstArg(); int columns = (int)getNextArg(); interp.getComma(); String[] labels = getStringArray(); int n = labels.length; double[] dstates = getLastArray(); if (n!=dstates.length) interp.error("labels.length!=states.length"); boolean[] states = new boolean[n]; for (int i=0; i<n; i++) states[i] = dstates[i]==1.0?true:false; gd.addCheckboxGroup(rows, columns, labels, states); }
void addCheckboxGroup(GenericDialog gd) { int rows = (int)getFirstArg(); int columns = (int)getNextArg(); interp.getComma(); String[] labels = getStringArray(); int n = labels.length; double[] dstates = getLastArray(); if (n!=dstates.length) interp.error("labels.length!=states.length"); boolean[] states = new boolean[n]; for (int i=0; i<n; i++) states[i] = dstates[i]==1.0?true:false; gd.addCheckboxGroup(rows, columns, labels, states); }
String[] labels = {"Case Sensitive", "Whole Words"}; boolean[] states = {caseSensitive, wholeWords}; gd.addCheckboxGroup(1, 2, labels, states); gd.showDialog(); if (gd.wasCanceled())
String[] labels = {"Case Sensitive", "Whole Words"}; boolean[] states = {caseSensitive, wholeWords}; gd.addCheckboxGroup(1, 2, labels, states); gd.showDialog(); if (gd.wasCanceled())
private boolean showDialog() { gd = new GenericDialog("Render Paths as Topographic Skeletons"); final String[] pwScopes = { "Render all paths", "Render only selected paths" }; gd.addRadioButtonGroup("Path selection:", pwScopes, 2, 1, pwScopes[useOnlySelectedPaths ? 1 : 0]); final String[] roiScopes = { "None", "Render only segments contained by ROI" }; gd.addRadioButtonGroup("ROI filtering:", roiScopes, 2, 1, roiScopes[restrictByRoi ? 1 : 0]); // Assemble SWC choices final ArrayList<String> swcTypeNames = Path.getSWCtypeNames(); final int nTypes = swcTypeNames.size(); final String[] typeNames = swcTypeNames.toArray(new String[nTypes]); final boolean[] typeChoices = new boolean[nTypes]; for (int i = 0; i < nTypes; i++) typeChoices[i] = typeNames[i].contains("dendrite"); final String[] swcScopes = { "None", "Include only the following SWC types:" }; gd.addRadioButtonGroup("SWC filtering:", swcScopes, 2, 1, swcScopes[restrictBySWCType ? 1 : 0]); gd.setInsets(0, 40, 0); gd.addCheckboxGroup(nTypes / 2, 2, typeNames, typeChoices); final String[] analysisScopes = { "None", "Obtain summary", "Run \"Analyze Skeleton\" plugin" }; gd.addRadioButtonGroup("Analysis of rendered paths:", analysisScopes, 3, 1, analysisScopes[0]); gd.addDialogListener(this); dialogItemChanged(gd, null); gd.showDialog(); if (gd.wasCanceled()) return false; else if (gd.wasOKed()) { return dialogItemChanged(gd, null); } return false; }
public void changeChannels(final Content c) { if (!checkSel(c)) return; final ContentInstant ci = c.getCurrent(); final GenericDialog gd = new GenericDialog("Adjust channels ...", univ.getWindow()); gd.addMessage("Channels"); gd.addCheckboxGroup(1, 3, new String[] { "red", "green", "blue" }, ci .getChannels()); gd.addCheckbox("Apply to all timepoints", true); gd.showDialog(); if (gd.wasCanceled()) return; final boolean[] channels = new boolean[] { gd.getNextBoolean(), gd.getNextBoolean(), gd.getNextBoolean() }; if (gd.getNextBoolean()) c.setChannels(channels); else ci.setChannels(channels); univ.fireContentChanged(c); record(SET_CHANNELS, Boolean.toString(channels[0]), Boolean .toString(channels[1]), Boolean.toString(channels[2])); }
private boolean GUI() { GenericDialog gd = new GenericDialog("2D Anisotropic Diffusion Tschumperle-Deriche v"+ADTDVersion); gd.addNumericField("Number of iterations", stored_nb_iter, 0); gd.addNumericField("Smoothings per iteration", stored_nb_smoothings, 0); if (scount==1) { if (save>nb_iter) save = nb_iter; gd.addNumericField("Keep each ", stored_save, 0, 2, "iteration"); } gd.addNumericField("a1 (Diffusion limiter along minimal variations)", stored_a1, 2); gd.addNumericField("a2 (Diffusion limiter along maximal variations)", stored_a2, 2); gd.addNumericField("dt (Time step)", stored_dt, 1); gd.addNumericField("edge threshold height", stored_edgeheight, 1); String[] labels = {"Show_filter stats", "Show_time stats", "Add labels"}; boolean[] values = {stored_sstats, stored_tstats, stored_add_labels}; gd.addCheckboxGroup(2, 2, labels, values); gd.addMessage("Incorrect values will be replaced by defaults.\nLabels are drawn in the foreground color.\nPress Esc to stop processing."); return getUserParams(gd); }
private boolean GUI() { GenericDialog gd = new GenericDialog("2D Anisotropic Diffusion Tschumperle-Deriche v"+ADTDVersion); gd.addNumericField("Number of iterations", stored_nb_iter, 0); gd.addNumericField("Smoothings per iteration", stored_nb_smoothings, 0); if (scount==1) { if (save>nb_iter) save = nb_iter; gd.addNumericField("Keep each ", stored_save, 0, 2, "iteration"); } gd.addNumericField("a1 (Diffusion limiter along minimal variations)", stored_a1, 2); gd.addNumericField("a2 (Diffusion limiter along maximal variations)", stored_a2, 2); gd.addNumericField("dt (Time step)", stored_dt, 1); gd.addNumericField("edge threshold height", stored_edgeheight, 1); String[] labels = {"Show_filter stats", "Show_time stats", "Add labels"}; boolean[] values = {stored_sstats, stored_tstats, stored_add_labels}; gd.addCheckboxGroup(2, 2, labels, values); gd.addMessage("Incorrect values will be replaced by defaults.\nLabels are drawn in the foreground color.\nPress Esc to stop processing."); return getUserParams(gd); }
labels[17]="Stack position"; states[17]=(systemMeasurements&STACK_POSITION)!=0; gd.setInsets(0, 0, 0); gd.addCheckboxGroup(10, 2, labels, states); labels = new String[6]; states = new boolean[6]; labels[5]="NaN empty cells"; states[5]=(systemMeasurements&NaN_EMPTY_CELLS)!=0;; gd.setInsets(0, 0, 0); gd.addCheckboxGroup(3, 2, labels, states); gd.setInsets(15, 0, 0); gd.addChoice("Redirect to:", titles, target);
labels[17]="Stack position"; states[17]=(systemMeasurements&STACK_POSITION)!=0; gd.setInsets(0, 0, 0); gd.addCheckboxGroup(10, 2, labels, states); labels = new String[6]; states = new boolean[6]; labels[5]="NaN empty cells"; states[5]=(systemMeasurements&NaN_EMPTY_CELLS)!=0;; gd.setInsets(0, 0, 0); gd.addCheckboxGroup(3, 2, labels, states); gd.setInsets(15, 0, 0); gd.addChoice("Redirect to:", titles, target);
gd.addMessage("Startup Options:", font); gd.setInsets(0, 0, 0); gd.addCheckboxGroup(startupOptions, 1, startupLabels, startupStates); gd.setInsets(20, 0, 0); gd.addMessage("Advanced Options:", font); gd.setInsets(0, 0, 0); gd.addCheckboxGroup(pluginOptions, 1, pluginLabels, pluginStates);
nextSeries++; gd.addCheckboxGroup(nRows, 1, labels, defaultValues);
nextSeries++; gd.addCheckboxGroup(nRows, 1, labels, defaultValues);
gd.addCheckboxGroup( numStitchingTypes, 1, stichingTypes, defaultState, extraExplanations );
gd.addNumericField("Resampling factor", 2, 0); gd.addMessage("Channels"); gd.addCheckboxGroup(1, 3, new String[] {"red", "green", "blue"}, new boolean[]{true, true, true});