With the Cardiac Analysis tool, you can build your own calculation algorithms to work on the cardiac segments as plugins. Using a simple example, this section details how to create your calculation 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:
The example plugin we will simply calculate the area of each cardiac segment. The class you will create must extend the class com.xinapse.apps.cardiac.SelectableCardiacAnalysis The source code for our example can be found in SegmentArea.java. The source code contains explanations of the forms that must be followed. Save the example source code into a folder of your choice.
Compile the source code using the command:
javac SegmentArea.java
This will generate the class files SegmentArea.class and SegmentArea$Panel.class.
Both of these class files will need to be copied to the plugins folder.
Note: you must use javac version 17.
Jim can find your plugin if either:
If necessary, copy the plugin .class files created by the compilation above to your chosen location.
To import the new plugin, select Import plugin ... from the tool's Plugins menu: , and tell Jim the fully-qualified class name for your new plugin. In our example, we simply enter "SegmentArea", but if you had put you plugin into a particular package such as "edu.myuni.plugins", you would enter "edu.myuni.plugins.SegmentArea".
Then click the button.Restart Jim and your new plugin will be represented by a new tab in the Cardiac Analysis tool:
Note: if you recompile your plugin, you will need to restart Jim for the change to take effect.
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:
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: 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.