Skip to content

Writing your first Plugin

JulianThijssen edited this page Sep 16, 2019 · 10 revisions

In order to extend the functionality of the HDPS system, it is possible to write your own plug-ins and add them to the system. The first step to doing so would be to decide what kind of plug-in you want to write. There are five possible types of plug-ins:

View Plugin

A View Plugin is specifically targeted at visualization of some data. Examples of such plugins would be:

  • A scatter plot
  • An image viewer
  • A 3D volume viewer
  • A chart or histogram

An example of how to write a View Plugin is given here: https://github.com/hdps/ExampleViewPlugin

Analysis Plugin

An Analysis Plugin is used for controlled computations. These plugins have no direct visual output (although their output can be visualized with a View Plugin), but are purely concerned with transformation of input data or generation of new data. Examples of such plugins would be:

  • Generating a t-SNE embedding from input data
  • Computing clusters of data
  • Generating random points
  • Subsampling input data

An example of how to write an Analysis Plugin is given here: https://github.com/hdps/ExampleAnalysisPlugin

Data Plug-in

A Data Plugin provides a raw data store and a view on this data. It defines a type derived from RawData which contains the actual data. In addition it defines a type derived from Set which provides an indexed subset of the data and is what gets passed to all interested plugins.

Examples of data plugins would be:

  • Point data
  • Image data
  • Volume data

An example of how to write a Data Plugin is given here: https://github.com/hdps/ExampleDataPlugin

Be aware that in most cases it will not be necessary to write a Data Plugin. Many types of data can be stored as Point Data which is available by default in the library.

Loader Plug-in

A Loader Plugin is used for loading data into the system. It automatically gets added to the menu options and once triggered will launch the logic defined in the plugin for loading the appropriate data. Typical implementations launch a file explorer window to select the file the user wants to load, then processes it to be in the desired format and passes the data to the core system where it is stored in the central data manager.

An example of how to write a Loader Plugin is given here: https://github.com/hdps/ExampleLoaderPlugin

Writer Plug-in

A Writer Plugin is used for writing data from the system to disk. It automatically gets added to the menu options and once triggered will launch the logic defined in the plugin for writing the data. Typical implementations launch a file explorer window to decide under which file name and where the data will be saved, then prepares the data into the desired output format and saves it to disk.

An example of how to write a Writer Plugin is given here: https://github.com/hdps/ExampleWriterPlugin [TODO]

Clone this wiki locally