Creating a new task type

Creating a new task type requires only basic scripting knowledge. For example a custom Python script can be wrapped in a new task type.

Checkout

As a starting point it can be helpful to checkout an existing example:

  • In the menu open Task Type ‣ View Task Types.

  • Find Example.Itk.AnisotropicDiffusion.

This is an example task type that uses an image processing algorithm provided by the Itk Python library.

  • Select it and use Task Type ‣ Checkout Task Type.

This copies the task type’s source files to disk for viewing and editing.

Edit Files

There is a metadata.json file to specify for example the name and version of the task type.

  • Change the name of the new task type, for example to YourName.Itk.Gauss.

There is a interface.json file to specify the available inputs and outputs.

  • Add a new input, for example variance.

There is a content/script.py file. In addition to the calls to the image processing library, it contains typical boilerplate code to accept the XamFlow inputs and provide the outputs.

  • Change the CurvatureAnisotropicDiffusionImageFilter to DiscreteGaussianImageFilter, and call SetVariance.

Checkin New Task Type

Finally once the files are ready for a first test the task type can be created:

  • Use the menu Task Type ‣ Checkin New Task Type to get the files into XamFlow as a new task type.

Checkin Task Type Version

After checking in the new task type, the files can be changed further, and a new version of the task type can be created:

  • Use the menu Task Type ‣ Checkin Task Type Version.