Dynamic Analysis Plugins

With the Dynamic Analysis tool, you can build your own data analysis methods as plugins. Using a simple example, this section details how to create your analysis method, which is written using the Java programming language. If you are not a java programmer, or find this task too daunting, you can commission Xinapse Systems to write your analysis plugin.

The steps needed to create and use a plugin are:

  1. Write the java source code for the class that extends com.xinapse.dynamic.DynamicModel.
  2. Compile the source code to produce java class files.
  3. Either place your plugin in a standard location or extend Jim's classpath so that Jim knows where to find the new class.
  4. Import the new plugin into Jim.
  5. Restart Jim.

Source code for the example plugin

The example plugin we will create estimates a linear trend in the data, and calculates two parametric images: the slope and the intercept of the linear trend graph. The class you will create must extend the class com.xinapse.dynamic.DynamicModel The source code for our example can be found in LinearTrend.java. The source code contains explanations of the forms that must be followed. Save the example source code into a folder of your choice.

Compiling the source code

Compile the source code using the command:

javac LinearTrend.java

Note: you must use javac version 17.
This will generate the class files LinearTrend.class, LinearTrend$1.class, LinearTrend$LinearTrendPanel.class and LinearTrend$LinearTrendResult.class. All these class files will need to be copied to the plugins folder.

Telling Jim where to find your new class

Jim can find your plugin if either:

  1. You place all the .class files for your plugin in one of two standard locations. These are:
  2. You modify Jim's standard classpath to include the folder where your new class files are. Please see the relevant sections about customising an installation on Windows, Unix or Mac OS.

If necessary, copy the plugin .class files created by the compilation above to your chosen location.

Import the plugin into Jim

To import the new plugin, select Import plugin ... from the tool's Plugins menu: plugins_import_plugin, and tell Jim the fully-qualified class name for your new plugin. In our example, we simply enter "LinearTrend", but if you had put you plugin into a particular package such as "edu.myuni.plugins", you would enter "edu.myuni.plugins.LinearTrend".

dynamic_plugin_import

Then click the ok button.

Restart Jim and your new plugin will be represented by a new tab in the Dynamic Analysis tool:

dynamic_analysis_with_plugin

Note: if you recompile your plugin, you will need to restart Jim for the change to take effect.

Removing a plugin from Jim

If, at sometime in the future, you wish to stop using a plugin, you can simply delete the .class files from the plugin folder. When you do this, Jim will give you a warning message next time you try to use the tool, like this:

dynamic_plugin_not_found

After this one warning, Jim will not try to use the plugin again.

If you temporarily want to stop using the plugin, but without deleting the .class files, select Manage plugins ... from the tool's Plugins menu: plugins_manage_plugins and delete the plugin from the list of current plugins that pops up. To start using the plugin again you will have to repeat the procedure of importing your plugin into Jim.

Jim Home