Class ParameterScriptProcessor

  • All Implemented Interfaces:
    SciJavaPlugin, ScriptProcessor

    public class ParameterScriptProcessor
    extends Object
    implements ScriptProcessor
    A ScriptProcessor which parses the script's input and output parameters from the script header.

    SciJava's scripting framework supports specifying @Parameter-style inputs and outputs in a preamble. The format is a simplified version of the Java @Parameter annotation syntax. The following syntaxes are supported:

    • #@ <type> <varName>
    • #@ <type>(<attr1>=<value1>, ..., <attrN>=<valueN>) <varName>
    • #@<IOType> <varName>
    • #@<IOType> <type> <varName>
    • #@<IOType>(<attr1>=<value1>, ..., <attrN>=<valueN>) <type> <varName>

    Where:

    • #@ - signals a special script processing instruction, so that the parameter line is ignored by the script engine itself.
    • <IOType> - one of INPUT, OUTPUT, or BOTH.
    • <varName> - the name of the input or output variable.
    • <type> - the Java Class of the variable, or Object if none specified.
    • <attr*> - an attribute key.
    • <value*> - an attribute value.

    See the @Parameter annotation for a list of valid attributes.

    Here are a few examples:

    • #@Dataset dataset
    • #@double(type=OUTPUT) result
    • #@both ImageDisplay display
    • #@input(persist=false, visibility=INVISIBLE) boolean verbose
    • #@output thing

    Parameters will be parsed and filled just like @Parameter-annotated fields in Commands.

    Author:
    Curtis Rueden