Developer documentation

Creating a parameter type

JIPipe extensions can register custom parameter types for the use in nodes.

  • If you just want custom lists of compound parameters, consider the usage of ParameterCollectionList (since JIPipe 1.73.0)

JIPipe requires you to register custom parameter types, where they are assigned an unique identifier. This is done to allow future refactoring without breaking a user’s project.

A custom parameter type must be JSON-serializable via the Jackson library. It is associated to an editor UI that is responsible for updating the parameter value from the GUI.

  • A parameter type cannot be a generic class. This is due to restrictions in the JVM. We recommend to create a sub-class for a list of a parameter if you require a list of it down the line. The list parameter inherits from the ListParameter class.

Required: creating an editor

New parameter types require a UI that will be used for interacting with the parameter.

  • Not needed for enums, (via registerEnumParameterType)
  • Not needed for JIPipeParameterCollection
  • Not needed for ListParameter and other JIPipe-provided generic parameter base classes

To create an editor UI, you have to inherit from JIPipeParameterEditorUI.

The UI class provides access to the JIPipeParameterCollection object and the JIPipeParameterAccess object that encapsulates the getter and setters, as well as additional annotations.

There is also access to the SciJava context object.

  • Please be careful to avoid infinite loops between reloading and setting parameters from UI elements.

Registering a parameter type

Please keep this in mind

Extensions can register multiple nodes and data types (and also parameters), so you can greatly simplify your projects by merging multiple functions into a single extension.

As users will need to activate extensions in the extension manager, just creating one extension service will greatly simplify the user experience

@Plugin(type = JIPipeJavaExtension.class)
public class MyExtension extends JIPipeDefaultJavaExtension {

    // ... See previous tutorial for other methods
    public void register() {
        // You have to provide an unique ID, the parameter class, a method to create a new instance, a method to create a deep copy, and an UI class
                              MyParameter::new, // Can be null if you have a default constructor
                              p -> p.clone(), // Can be null if you have a copy constructor
                              "My parameter",
                              "A custom parameter type",
                              MyParameterParameterEditorUI.class); // UI can be null if there is already a UI

        // If you have a hierarchy of parameters, you can register the editor for the whole hierarchy:
        registerParameterEditor(MyCollectionBase.class, MyCollectionParameterEditorUI.class);

        // There is a predefined method to register enum values:
        registerEnumParameterType("my-enum", MyEnum.class, "My Enum", "Enum of values");

  • Do not forget to register all algorithm parameter types. JIPipe will throw an error if it detects a missing parameter registration.
  • There is an overload of registerParameterType that takes the matching list directly and automatically generates the ID, name, and description.
  • You can set the instance creation function to null if the parameter is default-constructable. You can set the clone function to null if the parameter type can be copied via a copy constructor.
  • You can review your parameter UI via Tools > Development > Show all parameter types.