From Slicer Wiki
Jump to: navigation, search
Home < Documentation < Nightly < Developers < FAQ < SlicerExecutionModel

For the latest Slicer documentation, visit the read-the-docs.


What facilities are available for third party software to interface with the NA-MIC Kit?

NA-MIC has committed to developing and supporting a generic batch processing interface. This is the Slicer3 Command Line Interface (CLI). The application programming interface (API) for CLI was worked out based on interactions with the community including input from those familiar with LONI, ITK, Python and Matlab software development practices.

We believe this API already supports all the features required by to implement batch processing with BatchMake, the LONI Pipeline, and any other systems that we may want to work with in the future. The Slicer3 Execution Model provides a simple XML-based descriptor for command line arguments for input/output volumes and related parameters.

Which Third Party software has currently been interfaced to the NA-MIC Kit using the CLI?

  • Batchmake (Kitware)
  • Python
  • Matlab

How do I debug my command line module?

See Debugging

How do I specify a Logo?

You need to create a logo.h file (embedding the zipped pixel data as base64 strings in a C source code). There is a utility bundled with kwwidgets that accomplishes this. From a Slicer3 build directory you can do something like this:

./Slicer3 --launch ../Slicer3-lib/KWWidgets-build/bin/KWConvertImageToHeader --base64 --zlib ~/Desktop/bioimagesuite_logo_www.h ~/Desktop/bioimagesuite_logo_www.png

The resulting .h header file can then be used as an argument to the 'generateclp' cmake macro like this:

generateclp(${CLP}_SOURCE ${CLP}.xml ${Slicer3_SOURCE_DIR}/Resources/bioimagesuite_logo_www.h)

Note: logos are limited in size: if your .h file contains a symbol like 'image_bioimagesuite_logo_www' it will work. But if it has several symbols like 'image_bioimagesuite_logo_www_1' 'image_bioimagesuite_logo_www_2' etc then the logo was too large and needs to be downsampled for use.

What do I do if I want to use the CLI outside of slicer?

In general CLI executables will depend on shared libraries provided by Slicer (such as ITKCommon, etc). To be sure your run-time environment resolves to the correct versions, you should always use a form like:

./Slicer --launch <CLI>

or, you can start a shell from which you can run multiple CLI modules. Something like:

./Slicer --launch xterm &

We do not suggest hard-coding the runtime paths into, for example, your .bashrc since this may interfere with other programs and can make it hard to use multiple versions of slicer on the same account.