Chargement...
 
Skip to main content

Common Features


Plugins may need settings to be run.
The list of parameters needed by the plugin is defined by the developer.
They defined either in the header of the class or in a void constructor.

To help tuning:

  • It is possible to set default values
  • Some parameters can have a limited range
  • It is possible to associate help to each parameter, it will be displayed we the user mouse over the label of the parameter.
  • The field "String label" is the displayed label of the parameter
  • The field "String id" is the id of the parameters's value in the database. It should be unique within a single list of parameters.
Copy to clipboard
public void setHelp(String help, boolean basic); // sets the help associated to the parameter. //TANGO allows two levels of help, a basic (to avoid flooding the user with to much information) and a more advanced level (for a detailed description) //If only one help level is provided, it will be displayed both in basic and advanced level
  • Optional parameters:
Copy to clipboard
public void setCompulsary(boolean compulsary); //if a parameter is not necessary, use this method with false. It won't be displayed in red if it is not filled correctly //default value is true

Cannonical Parameters

  • BooleanParameter : a boolean (checkbox)
  • Intparameter : an integer value
  • DoubleParameter a real value, with a defined number of decimals
  • SliderParameter : an integer value, with a minimum and maximum value
  • SliderDoubleParameter : an real value, with a defined number of decimals and a minimum and maximum value
  • Text parameter : a simple text value
  • ChoiceParameter : a simple String list


for instance for the 3D filtering plugin:

Copy to clipboard
String filters[] = {"Mean", "Median", "Minimum", "Maximum", "MaximumLocal", "TopHat", "Variance", "Sobel", "Adaptive"}; // "Choose filter:" is the text to be displayed // "filter" is the id in the database // follows the choices and the default value ChoiceParameter filter_P = new ChoiceParameter("Choose Filter: ", "filter", filters, filter[0]); // "VoisXY:" is the text to be displayed in label // voisxy is the identifier for the parameter in the database // 2 is the default value // Parameter.nfDEC1 is the NumberFormat, here we use an already defined one with one value after decimal DoubleParameter voisXY_P = new DoubleParameter("VoisXY: ", "voisxy", 2, Parameter.nfDEC1); DoubleParameter voisZ_P = new DoubleParameter("VoisZ: ", "voisZ", 2, Parameter.nfDEC1);


Structure Parameter

  • StructureParameter : this parameter allows to select a structure. It returns the index of the selected structure, that is accessible to the plugin through the InputImages (associated channel images) or OutputImage (labelled image) objects provided in to the plugin in the run method.
Copy to clipboard
// in the header of a plugin: StructureParameter structure1 = new StructureParameter("Choose Structure 1:", "structure1", -1, true); // The last boolean provided allows the user to choose virtual structure. //(caution: virtual structures don't have an associated channel image, only a labelled image) // in the run method: (for instance for a preFilter) public ImageHandler runPreFilter(ImageHandler input, InputImages images) { ImageHandler secondInput = images.getChannelFile(structure1.getIndex()); //.... }

Plugin Parameters

Those parameter call an external plugin. If the external plugin needs parameters itself, they will be prompted.

  • ThresholdParameter : prompt for a thresholder method and its associated parameter. On a developer side, the corresponding threshold is computed this way:
Copy to clipboard
// in the header of a plugin: ThresholdParameter thresholdHigh_P = new ThresholdParameter("Threshold High:", "thldHigh", null); // in the run method: (for instance for a nucleusSegmenter) @Override public ImageInt runNucleus(ImageHandler input, InputFieldImages rawImages) { double thldHigh = thresholdHigh_P.getThreshold(input, rawImages, nbCPUs, verbose); // the variable nbCPUs and verbose are provided to the plugin before the runNucleus is called // ...... }


Nested Parameters (advanced)

Those parameters contain several other parameters.

  • GroupParameter : contains an array of parameter. Only for display purpose. Useful to group parameters that go together.
  • ConditionalParameter : arrays of parameters that depend on an other parameter.

For instance, a filter needs a XY radius, and a Z raidus. The Z radius is either computed using the image scale or prompted directly to the user:

Copy to clipboard
DoubleParameter radiusXY = new DoubleParameter("XY-radius: ", "radiusXY", 1d, Parameter.nfDEC1); DoubleParameter radiusZ = new DoubleParameter("Z-radius: ", "radiusZ", 1d, Parameter.nfDEC1); BooleanParameter useScale=new BooleanParameter("Use Image Scale for Z radius: ", "useScale", true); HashMap<Object, Parameter[]> map = new HashMap<Object, Parameter[]>(){{ put(false, new Parameter[]{radiusZ}); put(true, new Parameter[0]); }}; ConditionalParameter cond = new ConditionalParameter(useScale, map); Parameter[] parameters = new Parameter[] {radiusXY, cond}; // the returned parameter array

radiusZ is displayed only if the useScale parameter is not selected.

  • MultiParameter : an array of parameter repeated a user-defined number of times.