Postprocessing plugins

From Dynamo
Jump to navigation Jump to search

Postprocessing plugins are a tool for customization of the alignment procedure in Dynamo. With this kind of plugin, the user can define an action that Dynamo will execute after each iteration during a project alignment.

Applications of plugins

Users have reported the use of plugins in very different scenarios and with very different levels of complexity. Here some examples:

  • Online definition of mask, depending on the average computed in the iteration.
  • Online definition of symmetrization operator;
  • Customization of golden-standard policy.
  • Fine tuning of MRA policy by PCA classification after each iteration.

Naming of a plugin script

Matlab plugin

Dynamo requires that the plugin script itself is named with the pattern


where PLUGINNAME is the shortname of the plugin.

The script should be in the execution path of Matlab (i.e., you should use addpath on the directory where you have defined your plugin). We recommend not to save your plugin files inside the folders of a Dynamo installation, but in your own folders.

System executables

If you put your plugin as a system executable, the same naming convention will be used. You just need to skip the file extension .m.

Linking plugin and project

You need two orders. With the first one you tell Dynamo that round 1 (for instance) will look for a plugin after normal Dynamo execution. For a project called ptest, you would write:

dvput ptest plugin_post_r1 1

Then, you pass the plugin itself:

dvput ptest plugin_post_order_r1 myExample().

This assumes that the plugin script has the name dynamo_plugin_post_myExample.m. If necessary, you can also pass parameters.

dvput ptest plugin_post_order_r1 myExample parameterForPlugin1 parameterForPlugin2.

The parentheses are necessary to tell Dynamo that the plugin is a Matlab script. If you skip them

Do not forget to unfold again the project before running it.

Syntax of a plugin script

Input arguments

The execution pipeline of Dynamo will deliver to the plugin function a text card with all the parameter values used in the project for the iteration that just got executed. It also identifies the iteration number currently on execution.

Thus, when creating your script, your first input variable should be reserved to accept this file.

function dynamo_plugin_post_example(iterationCard);

Location of iteration and round


%   1 from which iteration it is being executed:
ite = scard.database_ite;

%   2 from which project it is being invoked
name_projec t= scard.name_project;

% 3 we read the corresponding virtual project 

The project database

Example script